Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
atts = array_merge( Options::unprefix( pdf_embedder()->options()->get() ), $atts ); } /** * Render the PDF viewer. * * @since 4.8.0 */ public function render(): string { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh $title = ! empty( $this->atts['title'] ) ? $this->atts['title'] : Links::make_title_from_url( $this->atts['url'] ); $html_node = ''; $extra_style = ''; /* * Extra styles based on the PDF width and height settings. */ if ( is_numeric( $this->atts['width'] ) ) { $extra_style .= 'width:' . (int) $this->atts['width'] . 'px;'; } elseif ( $this->atts['width'] !== 'max' && $this->atts['width'] !== 'auto' ) { $this->atts['width'] = 'max'; } if ( is_numeric( $this->atts['height'] ) ) { $extra_style .= 'height:' . (int) $this->atts['height'] . 'px;'; } elseif ( $this->atts['height'] === 'auto' ) { $this->atts['height'] = 'max'; } elseif ( $this->atts['height'] !== 'max' && $this->atts['height'] !== 'auto' ) { $this->atts['height'] = 'max'; } /** * Filter the HTML attributes for the PDF Embedder shortcode. * * @since 4.7.0 * * @param array $html_attr HTML attributes. */ $html_attr = apply_filters( 'pdfemb_shortcode_html_attributes', [ 'class' => 'pdfemb-viewer', 'style' => $extra_style, 'data-width' => $this->atts['width'], 'data-height' => $this->atts['height'], 'data-toolbar' => $this->atts['toolbar'], 'data-toolbar-fixed' => $this->atts['toolbarfixed'], ] ); $html_node .= ' $value ) { if ( ! is_scalar( $key ) || ! is_scalar( $value ) ) { continue; } $html_node .= ' ' . sanitize_key( (string) $key ) . '="' . esc_attr( (string) $value ) . '"'; } $html_node .= '>'; $html_node .= esc_html( $title ); $html_node .= ''; return $html_node; } /** * Inline scripts and styles for the shortcode. * * @since 4.8.0 */ public function enqueue_inline_assets() { // phpcs:ignore WPForms.PHP.HooksMethod.InvalidPlaceForAddingHooks // Assets should be enqueued only once on a page. // They are shared across all instances of the shortcode. static $is_enqueued = false; if ( $is_enqueued ) { return; } $is_enqueued = true; wp_enqueue_script( 'pdfemb_embed_pdf' ); wp_enqueue_style( 'pdfemb_embed_pdf_css', Assets::url( 'css/pdfemb.css', true ), [], Assets::ver() ); } }