AJAX Request on Frontoffice with autosort doesn’t work
-
Hello,
I unchecked the “autosort” option, as explained in the documentation, I shouldn’t have automatic sorting on menu_order anymore.
However, all my AJAX requests from the frontoffice, connected or not, are sorted with menu_order.
The problem is in the file “includes/class.cpto.php” line 163.
During an AJAX request on WordPress “WP_ADMIN” is true and therefore is_admin() is true:
https://github.com/WordPress/WordPress/blob/master/wp-admin/admin-ajax.php
Result, each request calling the admin-ajax.php file is sorted with menu_order which gives an incorrect result.
To solve the problem (perhaps temporarily, in my case), I modified the plugin so that line 163 becomes:
if (is_admin() && !defined('DOING_AJAX'))
In this way, all requests on the front are good.
Can you fix it ?
Thank you !
Adrien.
- The topic ‘AJAX Request on Frontoffice with autosort doesn’t work’ is closed to new replies.