Hello,
Thanks for using our plugin,
Yes, you can pass the parameter $post_id , so pass it and then check!
Make sure you not change any other code, otherwise it will effect the PDF.
Regards,
Thanks for the quick response. Shouldn’t we release new plugin version with above fix?
If I am going to do the fix on plugin files, then if we update they will be lost again.
Hello,
You can share the changes here , and we will analysed your changes and if possible then we will implement in upcoming update in our plugin
Regards,
Plugin code:
$html .= '<div class="pgfw-pdf-body-title">
' . do_shortcode( str_replace( '[WORDPRESS_PDF]', '', apply_filters( 'the_title', $post->post_title ) ) ) . '
</div>';
Change code:
$html .= '<div class="pgfw-pdf-body-title">
' . do_shortcode( str_replace( '[WORDPRESS_PDF]', '', apply_filters('the_title', $post->post_title , $post->ID) ) ) . '
</div>';
In 382 line and file path : pdf-generator-for-wp/admin/partials/pdf_templates/pdf-generator-for-wp-admin-template1.php
Hello,
Thank you for sharing the changes , we will check and do the required changes to fix your issue in upcoming update
One more thing , i need to ask , as you said you get fatal error, can you send us that fatal error warning.
So, that we can check the issue and do the changes.
Regards,
When I print a PDF, the pdf-generator-for-wp-admin-template1.php file template is rendered. While rendering the template, the the_title filter hook runs. Additionally, other plugins that use the the_title filter hook in their constructor also run. Due to a few arguments passed in your code, it results in a fatal error.
Fatal error: Uncaught ArgumentCountError: Too few arguments to function PrestoPlayer\Services\VideoPostType::filterVideoTitle(), 1 passed in /home3/idevsoos/repositories/help-primexm/wp-includes/class-wp-hook.php on line 310 and exactly 2 expected in /home3/idevsoos/repositories/help-primexm/wp-content/plugins/presto-player/inc/Services/VideoPostType.php:689 Stack trace: #0 /home3/idevsoos/repositories/help-primexm/wp-includes/class-wp-hook.php(310): PrestoPlayer\Services\VideoPostType->filterVideoTitle('Modules') #1 /home3/idevsoos/repositories/help-primexm/wp-includes/plugin.php(205): WP_Hook->apply_filters('Modules', Array) #2 /home3/idevsoos/repositories/help-primexm/wp-content/plugins/pdf-generator-for-wp/admin/partials/pdf_templates/pdf-generator-for-wp-admin-template1.php(382): apply_filters('the_title', 'Modules') #3 /home3/idevsoos/repositories/help-primexm/wp-content/plugins/pdf-generator-for-wp/common/class-pdf-generator-for-wp-common.php(215): return_ob_html('33073', '') #4 /home3/idevsoos/repositories/help-primexm/wp-content/plugins/pdf-generator-for-wp/common/class-pdf-generator-for-wp-common.php(121): Pdf_Generator_For_Wp_Common->pgfw_generate_pdf_from_library('33073', 'open_window') #5 /home3/idevsoos/repositories/help-primexm/wp-content/plugins/pdf-generator-for-wp/common/class-pdf-generator-for-wp-common.php(101): Pdf_Generator_For_Wp_Common->pgfw_generate_pdf('33073') #6 /home3/idevsoos/repositories/help-primexm/wp-includes/class-wp-hook.php(310): Pdf_Generator_For_Wp_Common->pgfw_generate_pdf_link_catching_user('') #7 /home3/idevsoos/repositories/help-primexm/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #8 /home3/idevsoos/repositories/help-primexm/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /home3/idevsoos/repositories/help-primexm/wp-settings.php(632): do_action('init') #10 /home3/idevsoos/repositories/help-primexm/wp-config.php(99): require_once('/home3/idevsoos...') #11 /home3/idevsoos/repositories/help-primexm/wp-load.php(50): require_once('/home3/idevsoos...') #12 /home3/idevsoos/repositories/help-primexm/wp-blog-header.php(13): require_once('/home3/idevsoos...') #13 /home3/idevsoos/repositories/help-primexm/index.php(17): require('/home3/idevsoos...') #14 {main} thrown in /home3/idevsoos/repositories/help-primexm/wp-content/plugins/presto-player/inc/Services/VideoPostType.php on line 689
Okay thanks,
We will surely check this in next coming update.
Regards,