Fatal error with this snippet in page builder
-
Post Snippets. free. 3.0.21
wpbakery page builder 6.1I use this snippets with page builder (wpbakery) in text block
inside single product (also if use the snippet in product description this work ) :( flagged: shortcode and PHP Code )
global $product;
echo “<h2 style=’color:#929292′ align=center >” . $product->get_name() .”</h2>”;now when save (and any time save ) the product page get this error (also the product save the snippet and in frontend work ) :
Fatal error: Uncaught Error: Call to a member function get_name() on null in /home/too5948/public_html/website.com/wp-content/plugins/post-snippets/src/PostSnippets/Shortcode.php(104) : eval()’d code:2 Stack trace: #0 /home/too5948/public_html/website.com/wp-content/plugins/post-snippets/src/PostSnippets/Shortcode.php(104): eval() #1 /home/too5948/public_html/website.com/wp-content/plugins/post-snippets/src/PostSnippets/Shortcode.php(72): PostSnippets\Shortcode::phpEval(‘global $product…’) #2 /home/too5948/public_html/website.com/wp-includes/shortcodes.php(343): PostSnippets\Shortcode->PostSnippets\{closure}(”, ”, ‘product-name’) #3 [internal function]: do_shortcode_tag(Array) #4 /home/too5948/public_html/website.com/wp-includes/shortcodes.php(218): preg_replace_callback(‘/\\[(\\[?)(carous…’, ‘do_shortcode_ta…’, ‘[vc_row full_wi…’) #5 /home/too5948/public_html/website.com/wp-includes/class-wp-hook.php(287): do_shortcode(‘[vc_row full_wi…’) #6 /home/too5948 in /home/too5948/public_html/website.com/wp-content/plugins/post-snippets/src/PostSnippets/Shortcode.php(104) : eval()’d code on line 2
note: i think you can try with any woocommerce/wpbackery/page snippets
thank you
- The topic ‘Fatal error with this snippet in page builder’ is closed to new replies.