latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Restrict child pages of page template

Home Forums Community Forum Restrict child pages of page template

This topic contains 3 replies, has 3 voices. Last updated by  Dan Stramer 3 years, 11 months ago.

Topic Author Topic
Posted: Wednesday Jan 16th, 2013 at 1:13 am #37702

Hi
I created a wordpress page template for all my restricted pages.
All the restricted pages will be child pages of this template.
How can I make all the child pages automatically restricted to at least the restriction level of the parent page template without going through all the child pages?

Thanks
Dan

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Thursday Jan 17th, 2013 at 2:28 am #37853
Bruce
Username: Bruce
Staff Member

Thanks for your great question.

I would suggest using Dashboard -› s2Member® -› Restriction Options -› Tag Access Restrictions, rather than protecting through your theme’s template files. These require no external coding and will work just as well.

However, if you would like to do this through your theme’s template file, this is very possible.

In your theme’s template file, you can use the conditionals provided under Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals to decide if a user is allowed access. You can then redirect to the Membership Options Page with c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars().

Posted: Thursday Jan 17th, 2013 at 9:32 pm #37989
Staff Member

Thanks for the heads up on this thread :-)

You might take a look at this WP function that would tell you what the current Page Template is, and then integrate PHP conditionals in your theme functions.php file, or maybe with an MU plugin file.

See: http://codex.wordpress.org/Function_Reference/get_page_template
See also: Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals

Posted: Thursday Jan 24th, 2013 at 4:49 am #39329

Thanks Jason
I’ll take a look at the wp function

Thanks for your support.

Dan

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.