• Resolved Jason Ryan

    (@viablethought)


    Hello –

    I have added your shortcode code to my functions.php file and then added the shortcode to a page I am using it on, however every time I save the page I get the following error:

    Notice: Undefined property: Woocommerce_Products_Per_Page::$front_end in /public_html/wp-content/themes/Impreza-child/functions.php on line 18
    
    Fatal error: Uncaught Error: Call to a member function products_per_page_dropdown() on null in /public_html/wp-content/themes/Impreza-child/functions.php:18 
    
    Stack trace: 
    #0 /public_html/wp-includes/shortcodes.php(343): custom_wppp_shortcode('', '', 'wppp') 
    #1 [internal function]: do_shortcode_tag(Array) 
    #2 /public_html/wp-includes/shortcodes.php(218): preg_replace_callback('/\\[(\\[?)(wppp)(...', 'do_shortcode_ta...', '[wppp]\n') 
    #3 /public_html/wp-includes/class-wp-hook.php(287): do_shortcode('[wppp]\n') 
    #4 /public_html/wp-includes/plugin.php(206): WP_Hook->apply_filters('[wppp]\n', Array) 
    #5 /public_html/wp-content/plugins/us-core/templates/elements/vc_column_text.php(41): apply_filters('widget_text_con...', '[wppp]')
    #6 /public_html/wp-c in /public_html/wp-content/themes/Impreza-child/functions.php on line 18

    If I then remove the post edit portion from the URL string and just navigate back to WP admin, the site is fine and the page was actually saved.

    Any idea what might be causing this issue?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    I’m unable to reproduce this, maybe your theme or another plugin is trying to load in a preview or something that is calling the functionality..?

    Cheers,
    Jeroen

    Thread Starter Jason Ryan

    (@viablethought)

    @sormano

    Maybe? The site is using WP Bakery’s Page Builder where I just pasted the shortcode into a “TextBlock” element, which is pretty common with other shortcodes.

    It is only happening during page save, going to the page afterwards it loads fine and if I visit the page on the front end it seems to work as intended as well. It is very odd.

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi Jason,

    Could very well be related to that. I’d just ignore it if it doesn’t pose any additional issues and you don’t need to save the page any further.

    Cheers,
    Jeroen

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error on Page Save Where Shortcode was Added’ is closed to new replies.