• Resolved vandung93

    (@vandung93)


    Hello team,
    – There is a problem with Instructor’s capabilities in your plugin.
    When query courses in wp_ajax action, your query auto append current logged author id and posts of the authors.

    Please check and fix it soon.

    Note: this happinng when you logged in as Instructor user.

    Code Reference:

    add_action( 'wp_ajax_get_simple_courses', 'simple_ajax_call' );
    add_action( 'wp_ajax_nopriv_get_simple_courses', 'simple_ajax_call' );
    function simple_ajax_call() {
    	$query_args = [
    		'post_type'      => 'courses',
    		'posts_per_page' => 10,
    		'post_status'    => 'publish',
    	];
    	$query = new WP_Query( $query_args );
    	/**
    	 * Logged in with Instructor have ID = 6.
    	 *
    	 * This is value of $query->request
    	 * SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'courses' AND ((wp_posts.post_status = 'publish'))  AND ( wp_posts.post_author = 6 OR wp_posts.ID IN(208,209,210,211,212,213,214,215,205) )   ORDER BY wp_posts.post_date DESC LIMIT 0, 10
    	 */
    	wp_die();
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter vandung93

    (@vandung93)

    @badsha_eee I have no idea about this problem, please help

    We have received a similar report via email. Do you use the name Frankie? If yes, we are already looking into the issue. Please allow us some time.

    Thread Starter vandung93

    (@vandung93)

    Yes, Frankie is my account. That account bought full-time unlimited license.

    Please help me resolve this problem soon.

    Thread Starter vandung93

    (@vandung93)

    Hello team,

    How about news on this? please fix this bug asap.

    I tested with default theme “Twenty twenty” and only Tutor LMS plugin activate.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP_Query bug in wp_ajax action’ is closed to new replies.