redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Warning: call_user_func_array() expects parameter 1 to be a valid callback when using WooCommerce

Open wpinsite opened this issue 12 years ago • 6 comments

Hi, Since installing WooCommerce v2.1.5 I have been receiving the following warning in my WordPress site, both backend and front end.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'woocommerce_reset_loop' not found or invalid function name in C:\xampp\htdocs\Manta\wp-includes\plugin.php on line 507

It seems to be generated by my Redux Settings page. The page that holds all the redux settings for my theme. If I do not includemy Redux settings page the warning is not displayed. I have investigated this and can not find the issue, although a lot of WooCommerce users are receiving similar warnings.

I am using the Redux framework integrated into my theme.

Any help into the cause of this warning would be great appreciated.

wpinsite avatar Mar 19 '14 22:03 wpinsite

Oh woo,woo. Not forcing your code to only apply on the pages you have control. sigh

Skype me: DovyDigital

dovy avatar Mar 19 '14 22:03 dovy

And/or pop me your code:

[email protected] http://wetransfer.com

dovy avatar Mar 19 '14 22:03 dovy

Hi Dovy,

Thanks for the very quick reply. Sorry to post this issue. I understand WooCommerce is very frustrating in their coding standards. Investigating the issue and doing some Googling I found a lot of developers were frustrated with these issues.

I have attached my Redux config file to this email.

Kind Regards

Jason http://www.wpinsite.com

On Thu, Mar 20, 2014 at 9:30 AM, Dovy Paukstys [email protected]:

And/or pop me your code:

[email protected] http://wetransfer.com

Reply to this email directly or view it on GitHubhttps://github.com/ReduxFramework/redux-framework/issues/960#issuecomment-38115491 .

wpinsite avatar Mar 19 '14 22:03 wpinsite

It got stripped. You need to email it directly. ;)

dovy avatar Mar 19 '14 22:03 dovy

Hi Dovy,

Thank you for your time and help. I found the issue and luckily it was an issue on my coding.

I use the below code to retrieve some of the custom post types in my theme:

/* Get Parallax Sections */ $theme_parallax = array(); $theme_parallax['none'] = __('Attach Parallax', 'manta');

        $parallax_query = new WP_Query(array('post_type' =>

'parallax-sections', 'posts_per_page' => -1, 'order' => 'ASC'));

        if($parallax_query->have_posts()):

while($parallax_query->have_posts()) : $parallax_query->the_post(); $theme_parallax[get_the_ID()] = get_the_title(); endwhile; endif;

        /* Get Page Sections */
        $theme_page_section = array();
        $theme_page_section['none'] = __('Attach Section','framework');

        $section_query = new WP_Query(array('post_type' =>

'page-sections', 'posts_per_page' => -1, 'order' => 'ASC'));

        if($section_query->have_posts()):

while($section_query->have_posts()) : $section_query->the_post();

                $theme_page_section[get_the_ID()] = get_the_title();

            endwhile;
        endif;

If I remove this code the warning goes away. I will try and figure out why this code is causing issues.

Kind Regards

Jason http://www.wpinsite.com

On Thu, Mar 20, 2014 at 9:37 AM, Dovy Paukstys [email protected]:

It got stripped. You need to email it directly. ;)

Reply to this email directly or view it on GitHubhttps://github.com/ReduxFramework/redux-framework/issues/960#issuecomment-38116080 .

wpinsite avatar Mar 19 '14 22:03 wpinsite

You can just print_r($GLOBALS['wp_post_types']) to get the custom post types. No extra DB calls needed. ;)

Good luck.

dovy avatar Mar 19 '14 23:03 dovy