Support » Plugin: Advanced Access Manager » Advanced Access Manager Plugin Conflict with post__not_in with WP_Query

  • Resolved Leo Caseiro

    (@leocaseiro)


    When I active this Plugin, the param post__not_in in WP_Query not working.

    My code is:

    <?php
    		$news = new WP_Query(array(
    			'post_type' => 'post',
    			'category_name' => 'news',
    			'posts_per_page' => 3,
    			'post__not_in' => array(22,25) //not working when activate Advanced Access Manager Plugin
    		));
    
    		if ($news->have_posts()) : while($news->have_posts()) : $news->the_post(); 	?>
    			<a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
    	<?php endwhile; else :  ?>
    			<h1>Not Found</h1>
    	<?php endif;  ?>

    I solved commenting the line 197 at mvb_wp_access.php. But I would like the correctly solution.

    Thanks

    http://wordpress.org/extend/plugins/advanced-access-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Leo,
    Thanks for good call. I’ll check this issue and will let you know what is probably wrong.

    Regards,
    Vasyl

    Hi Leo,
    During my tests, I didn’t find the wrong behavior in post__not_in issue. Can you please explain me why it is not works for you?
    Regards,
    Vasyl

    Same error here.

    My code:

    $posts = new WP_Query(array(
    	'post_type' => 'post',
    	'posts_per_page' => 4,
    	'paged' => $paged,
    	'post__not_in' => array_values($ids),
    ));

    The ids in $ids var has no effect. I mean, the posts with the id in the array appear in the result.

    I am using version 1.5.8.2 of the plugin. The same line that Leo Caseiro commented (in this version #317) fixes the bug.

    Hi guys,
    I checked this issue. And this was my fault. I overwrote the post_not_on array instead of merging.
    Next release has this fix.

    Regards,
    Vasyl

    Thread Starter Leo Caseiro

    (@leocaseiro)

    Hi, Vasyl

    Thanks for the solution!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Advanced Access Manager Plugin Conflict with post__not_in with WP_Query’ is closed to new replies.