WordPress.org

Ready to get started?Download WordPress

Forums

Ajax on admin pages isn't working correctly (5 posts)

  1. godavid33
    Member
    Posted 6 months ago #

    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

  2. Christian1012
    Member
    Posted 6 months ago #

    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
  3. godavid33
    Member
    Posted 6 months ago #

    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

  4. Christian1012
    Member
    Posted 6 months ago #

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

  5. godavid33
    Member
    Posted 6 months ago #

    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?

Reply

You must log in to post.

About this Topic