WPIntell

Source evidence

Single pdf view post id problem?

3D Flipbook PDF Viewer & Embedder · support · 2025-11-11T20:22:00+00:00

mixedsentiment
mediumseverity
0.85relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 13 rows with source links

46.2% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

7 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
juaalton resolved
The shortcode e.g., [pdfev_embed_viewer id=”99530″] seems to provide empty view and inspecting the html shows that the data-pdfev-url is empty string even though the id is in place and is correct. In functions.php: 176 public static function shortcode_view($post_id){ 177 $link = \PDFEV_Functions::get_pdf_link(); 178 $flipbook = get_option('pdfev_flipbook_status'); $post_id is passed but discarded, and get_pdf_link() uses get_the_ID() instead. “However, this function only works correctly within The Loop or when global $post is properly set”. I tested by modifying the code so that $post_id is used (and not get_the_ID()), and the PDF was shown correctly. Has anyone else noticed problems with this shortcode? Hi @juaalton , Thank you for your ticket. I’ll check and debug if this is a bug. But no one noticed yet. Thanks. It might be that this is related to my configuration only (intranet development site; Kadence child theme). I fixed the problem in my child theme’s functions.php: function pdfev_fixed_shortcode($atts) { $atts = shortcode_atts( array( 'id' => '', ), $atts, 'pdfev_fixed_viewer' ); $post_id = intval($atts['id']); if ($post_id <= 0) { return ''; } ob_start(); // Set global $post so get_the_ID() works global $post; $original_post = $post; $post = get_post($post_id); setup_postdata($post); // Call original rendering logic if (class_exists('PDFEV_Functions')) { PDFEV_Functions::shortcode_view($post_id); } // Restore global $post $post = $original_post; wp_reset_postdata(); return ob_get_clean(); } add_shortcode('pdfev_fixed_viewer', 'pdfev_fixed_shortcode'); I am having the same issue, standard short code does not work. Post created from plugin does work. I need the shortcode Hi @osjewel , We appreciate your reply for this bug. Please kindly download from our git-hub latest released version 1.3.9 if you not get updated notice in your dashboard. I hope your issue will be solved. https://github.com/raselsha/pdf-embed-viewer/releases

Comments

4 shown
Shahadat Hossain 2025-11-12T02:30:00+00:00

Hi @juaalton , Thank you for your ticket. I’ll check and debug if this is a bug. But no one noticed yet.

juaalton 2025-11-12T15:57:00+00:00

Thanks. It might be that this is related to my configuration only (intranet development site; Kadence child theme). I fixed the problem in my child theme’s functions.php: function pdfev_fixed_shortcode($atts) { $atts = shortcode_atts( array( 'id' => '', ), $atts, 'pdfev_fixed_viewer' ); $post_id = intval($atts['id']); if ($post_id <= 0) { return ''; } ob_start(); // Set global $post so get_the_ID() works global $post; $original_post = $post; $post = get_post($post_id); setup_postdata($post); // Call original rendering logic if (class_exists('PDFEV_Functions')) { PDFEV_Functions::shortcode_view($post_id); } // Restore global $post $post = $original_post; wp_reset_postdata(); return ob_get_clean(); } add_shortcode('pdfev_fixed_viewer', 'pdfev_fixed_shortcode');

osjewel 2026-03-24T13:13:00+00:00

I am having the same issue, standard short code does not work. Post created from plugin does work. I need the shortcode

Shahadat Hossain 2026-03-29T14:02:00+00:00

Hi @osjewel , We appreciate your reply for this bug. Please kindly download from our git-hub latest released version 1.3.9 if you not get updated notice in your dashboard. I hope your issue will be solved. https://github.com/raselsha/pdf-embed-viewer/releases