Reply To: Redirect if user does not have the correct ccap

Forums General Redirect if user does not have the correct ccap Reply To: Redirect if user does not have the correct ccap

#375

Well, you could customize the behavior in different ways…

You can change the Membership Options Page’s content with conditionals, using the MOP Vars. WP Admin -> s2Member -> Scripting -> Membership Options Page Variables

Or, you could try a must-use plugin that checks if the required access is the ccap you’re talking about, and redirect the person to another page instead. Or do the redirection in the page with a conditional and a JavaScript redirection.

Maybe somthing like this: In /wp-content/mu-plugins/s2mop-redir.php

<?php
if (!empty($_REQUEST['_s2member_vars']))
   @list($restriction_type, $requirement_type, $requirement_type_value, $seeking_type, $seeking_type_value, $seeking_uri)
        = explode("..", stripslashes((string)$_REQUEST["_s2member_vars"]));

if (!empty($seeking_value) && $seeking_value == 'yourccaphere' ) {
   header('Location: http://www.yoursite.com/yourccapsalespage');
   exit;
}

Not tested, but I hope it helps. 🙂