As Administrator of the Ford Anglia Owners Club, I have needed to extend WordPress to suit the individual needs of the Club.
An excellent plugin called Contexture Page Security provides the ability to restrict access to certain pages or posts to members of a specific group – perfect for ensuring that the content that current Club Members should have access to as part of their subscription is only accessed by those who have paid for it.
Whilst this is great for restricting access to entire pages, I want to contextually show content within a specific page – which is something that Contexture Page Security does not supply.
Therefore, this plugin was born, which bridges the gap and provides the ability to restrict content within a page or post, by simply using a shortcode.
[ctxps_is_member group=”Group Name”]Content to restrict here[/ctxps_is_member]
[ctxps_is_member group=”Another Group,Yet Another Group”]More restricted content[/ctxps_is_member]
[ctxps_is_not_member group=”Group Name”]Content to show a non-member[/ctxps_is_not_member]
The above will only say restrict on whether the user is a member of the group or not – including expired memberships (where an expiry date is set). So, there’s another couple of shortcodes to deal with this:
[ctxps_is_expired_member group=”Group Name”]Your membership has expired[/ctxps_is_expired_member]
[ctxps_is_not_expired_member group=”Group Name”]Your membership is currently active[/ctxps_is_not_expired_member]
I also wanted to show users their expiry details for the Membership. To do this, simply place the following shortcode on your page/post.
[ctxps_expiry group=”Group Name”]
Or, to specify the date/time format (or the text if no expiry set)(, and to override the default text for an expired membership.
[ctxps_expiry group=”Group Name” format=”Y-m-d H:i:s” none=”Never” expired=”Expired” ]
Current version: 1.0.0
Click here to download the plugin: Contexture Page Security Shortcodes Plugin Download