How can I detect when a post/page is being filtered in WordPress by Advanced Access Manager (AAM) Plugin?

How can I detect when a post/page is being filtered by this plugin?

Advanced Access Manager
https://wordpress.org/plugins/advanced-access-manager/

Read More

The goal I have is to remove restricted posts from the wordpress loop, right now it shows the post title and the following excerpt:

To view the contents of this page, you must be authenticated and have the required access level.

I can’t seem to find a variable or array key/value that would allow me to remove use some conditional code to remove the restricted posts from the loop.

Using:

<?php print_r($post); ?>

inside the loop shows the original post content without it being filtered.

Related posts

1 comment

  1. Figured it out, found a post meta value using:

     <?php get_post_meta($post->ID, '_wpac_restricted_to', false); ?>
    

Comments are closed.