• Resolved adricorse

    (@adricorse)


    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.

    • This topic was modified 2 years, 3 months ago by adricorse.
    • This topic was modified 2 years, 3 months ago by adricorse.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello!

    I had the same problem and the piece of code suggested in the previous post solved it.

    I was wondering if you could put this in the next update.

    Thanks in advance!

    Plugin Author Maya

    (@tdgu)

    Hi,
    Thanks for your feedback, we will check this and implement in the next plugin release.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AJAX Request on Frontoffice with autosort doesn’t work’ is closed to new replies.