• Resolved morganleek_n

    (@morganleek_n)


    I have created a plugin that uses WP ajax functionality to narrow a set of search requirements for a user. It works wonderfully, but after a period of time (anything from hours to just a few minutes) it will stop working and my ajax post requests will start returning 0 instead of the intended values.

    This is quite confusing because I can’t see any comminalities between when it is working and the moment it stops.

    Has anyone experienced anything similar? Any help would be greatly appriciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter morganleek_n

    (@morganleek_n)

    I’ve just added ‘Login with Ajax’ and noticed that the 0 return would occur when I’d used it to login. Is this a clash of AJAX functions?

    Thread Starter morganleek_n

    (@morganleek_n)

    Well I feel stupid.

    I just hadn’t noticed that with the authenticated users I hadn’t added the priviledged ajax hook.


    // Had
    add_action('wp_ajax_nopriv_narrow_vehicle','narrowResults');
    // Didn't have, but also required
    add_action('wp_ajax_narrow_vehicle','narrowResults');

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ajax failure after a period of time’ is closed to new replies.