#147: Restricting Logic with Restrict Content Pro

(Updated on )

Using Restrict Content Pro, we play around with creating a subscription for a user. I use my own WordPress account as a test, giving it an active subscription.

We reference some of the help materials for RCP, which is actually right within the plugin settings itself, which is pretty cool.

When we create/edit a page in WordPress, there is a new module of settings that comes from RCP. We could, for example, make an entire page only viewable by a user with an active subscription of a certain level. We’re not going to do that for the most part though, we’re going to make our own templates and decide what to show and not show with logic inside the templates themselves.

For instance:

<?php if (rcp_is_active()) { ?>

  Content for users with an active subscription

<?php } else { ?>

  Content for logged out or inactive subscribers

<?php } ?>

Within that logic, you could do more specific logic for levels.

If we want to expose content to only a certain level of user right from within the content editor itself, RCP also gives us shortcodes for that purpose.