Add a call to wp_doing_ajax to suffix template condition

Home Forums Feature Requests Add a call to wp_doing_ajax to suffix template condition

Tagged: , ,

This topic contains 2 replies, has 3 voices, and was last updated by  Vincent Mimoun-Prat 1 year ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #364307

    Celia Vazquez
    Participant

    Hi,

    When you are calling via Ajax a method that is requesting a template, the $template_suffix is set to '-admin'.

    This bug will be avoided if the condition were:
    $template_suffix = (is_admin() && !wp_doing_ajax()) ? '-admin' : '-frontend';

    More info: https://facetwp.com/is_admin-and-ajax-in-wordpress/

    Thanks!

    #364657

    Thomas Lartaud
    Keymaster

    Hi,

    Yes, we could improve that, great idea. I’ve created a GitHub issue that you can follow to know when it gets done.

    Regards.

    #365349

    @Celia Do not hesitate to submit pull requests on our github repository if you can. If there are any occurences of that in our addons, you can also open a new issue per addon, with a reference to the file and line where to correct the issue.

    Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.