• Resolved Vishnja1

    (@vishnja1)


    Version of plugin 1.3.11

    On WP post when using shortcode from plugin (e.g. [recipe id=”6696″]) and after save next error is shown:

    Fatal error: Uncaught Error: Call to undefined function simmer_get_template_part() in /home/practifo/public_html/wp-content/plugins/simmer/core/recipes/class-simmer-recipe-shortcode.php:101 Stack trace: #0 /home/practifo/public_html/wp-includes/shortcodes.php(345): Simmer_Recipe_Shortcode->display_shortcode(Array, ”, ‘recipe’) #1 [internal function]: do_shortcode_tag(Array) #2 /home/practifo/public_html/wp-includes/shortcodes.php(223): preg_replace_callback(‘/\\[(\\[?)(the_ad…’, ‘do_shortcode_ta…’, ‘<input type=”hi…’) #3 /home/practifo/public_html/wp-includes/class-wp-hook.php(298): do_shortcode(‘ apply_filters(‘<input type=”hi…’, Array) #5 /home/practifo/public_html/wp-content/plugins/wordpress-seo/admin/links/class-link-watcher.php(45): apply_filters(‘the_content’, ‘ save_post(3496, Object(WP_Post)) #7 /home/practifo/pub in /home/practifo/public_html/wp-content/plugins/simmer/core/recipes/class-simmer-recipe-shortcode.php on line 101

    This topic is duplicate of https://www.ads-software.com/support/topic/php-fatal-error-call-to-undefined-function-4/

    I managed to find workaround on this, commenting 114 and 118 line of ‘class-simmer.php’

    		//if ( ! is_admin() ) {
    
    			// Load the front-end.
    
    			$this->frontend = new Simmer_Frontend;
    		//}
    

    and 247 – 253 lines

    }
            //else {
    
    			/**
    			 * The front-end class.
    			 */
    			require_once( plugin_dir_path( __FILE__ ) . 'frontend/class-simmer-frontend.php' );
    		//}
    

    making all front end scripts and styles enqueued on admin and thus making function simmer_get_template_part() present at the moment of saving.

    We would be grateful if you take a look on that problem and also make comment on
    possible drawbacks of this approach fixing the bug. Thanks!

    • This topic was modified 7 years, 3 months ago by Vishnja1.
    • This topic was modified 7 years, 3 months ago by Vishnja1.
    • This topic was modified 7 years, 3 months ago by Vishnja1.
    • This topic was modified 7 years, 3 months ago by Vishnja1.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Call to undefined function simmer_get_template_part()’ is closed to new replies.