WordPress.org

Support

Support » How-To and Troubleshooting » Ajax on admin pages isn't working correctly

Ajax on admin pages isn't working correctly

  • godavid33
    Member

    @godavid33

    I’m noticing when I try to add new categories on the post editor nothing happens. I can’t quite figure out why but my suspicion is that admin-ajax.php isn’t working as it should. I also can’t ajax add categories on the categories page in the backend. Any suggestions for fixes or how I can debug this?

    On the post editor page I get a 0 returned

Viewing 4 replies - 1 through 4 (of 4 total)
  • Christian1012
    Member

    @christian1012

    0 is returned because ‘yoursite.com/wp-admin/admin-ajax.php died and returned 0.

    However, die() isn’t very helpful. You can try turning debugging on and outputing to debug.log. In wp-config:

    @ini_set('display_errors',0);
    define('WP_DEBUG',         true);  // Turn debugging ON
    define('WP_DEBUG_DISPLAY', false); // Turn forced display OFF
    define('WP_DEBUG_LOG',     true);  // Turn logging to wp-content/debug.log ON
    godavid33
    Member

    @godavid33

    My site is currently live – I need to make a local installation for dev and debugging purposes. Is there a way to figure out what’s possibly causing the problem without using debug? I would like to wait till the end of the work day before making a backup of my installation

    Christian1012
    Member

    @christian1012

    The above will output debug to wp-content/debug.log, it won’t display them on the site.

    godavid33
    Member

    @godavid33

    On localhost I managed to get my debug.log down to just this:

    [27-Jan-2014 22:19:05 UTC] PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in C:\xampp\htdocs\dsn\wp-includes\functions.php on line 3049

    the problem being functions.php ends at like 405. Any clue on what is causing this PHP Notice?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ajax on admin pages isn't working correctly’ is closed to new replies.