Error in adminimize.php, line 121, when using wp_ajax_nopriv
-
I’m using admin-ajax.php for a front-end function. So I used this code to register my PHP function for both admin and non-admin users.
add_action(‘wp_ajax_nopriv_checkProducts’, ‘checkProducts’);
add_action(‘wp_ajax_checkProducts’, ‘checkProducts’);My checkProducts function runs fine when I’ve logged in, but I get this warning if I’m not logged in.
<b>Warning</b>: Invalid argument supplied for foreach() in <b>[…]wp-content\plugins\adminimize\adminimize.php</b> on line <b>121</b>
I tried to suppress the warning using this:
error_reporting(0);But that hasn’t been working, and the warning prohibits further parsing of the AJAX response – which is actually coming through just fine. So I either need to find a way to suppress the warning or fix it.
- The topic ‘Error in adminimize.php, line 121, when using wp_ajax_nopriv’ is closed to new replies.