• Resolved Imagewavi

    (@wavi)


    Any chance to solve this ?

    i have added this code for shortcode (flagged: shortcode and PHP Code) :

    global $product;
    echo “<h2 style=’color:#929292′ align=center >” . $product->get_name() .”</h2>”;

    when save get this error (if back to page data is saved )

    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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ImageWPExperts.io

    (@wpexpertsio)

    Hi @wavi,
    We have forwarded the details to the QA Team so they can replicate this issue.

    Plugin Author ImageWPExperts.io

    (@wpexpertsio)

    Hi @wavi,
    We have tested it with multiple different scenarios and it is working fine in our staging site.
    It is not giving any error while saving or displaying the snippet as you can see in the attached video.

    https://drive.google.com/file/d/1pK6dykonohHXyrQEPuSGr7zWW2SWK4fI/view

    Thread Starter Imagewavi

    (@wavi)

    Forget mention :

    I use this snippets in.page builder (bakery) in text block
    please try

    you test in short description
    ( i’m also if add the shortcode in short description work fine)

    • This reply was modified 5 years, 7 months ago by Imagewavi.
    Plugin Author ImageWPExperts.io

    (@wpexpertsio)

    Hi @wavi,
    Can you share the link to the free version of that plugin so we may test the shortcode using that plugin?
    Also as you are using a global $product, you will have to use that shortcode in product editor, you cant use it on any other post type.

    • This reply was modified 5 years, 7 months ago by ImageWPExperts.io.
    Plugin Author ImageWPExperts.io

    (@wpexpertsio)

    Hi @wavi,

    We are pleased to announce important news. Post snippets have been acquired by WP Experts. If being a user, you have any queries and issues, then we are solving your problems right here.

    Thanks.

    Plugin Author ImageWPExperts.io

    (@wpexpertsio)

    Hi @wavi,
    Due to lack of activity, this thread has been marked as resolved.

    You’re always welcome to open a new topic.

    Thanks for understanding!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Fatal error with this snippet’ is closed to new replies.