12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Nov 29, 2022

Advanced Query Param for Excluding Restricted Posts To Current User with Restrict Content Pro in Oxygen

Sridhar Katakam

Restrict Content Pro enables us to restrict posts by various criteria like per post or per category/taxonomy.

Post titles/links in WordPress loops will output all the posts by default, even those that the current user has no access to.

For default queries, it is possible to not show such restricted posts by ticking "Hide Restricted Posts" at Restrict → Membership Levels → Misc.

This members-only tutorial shows how the same can be done for custom queries in Oxygen when using its Repeater or Easy Posts component with Advanced Query.

Step 1

Add the following code in a code snippets plugin or a custom functionality plugin (if needed, after a opening PHP tag):

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right