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.

Custom Capabilities – Broke Theme

Home Forums Community Forum Custom Capabilities – Broke Theme

This topic contains 0 replies, has 1 voice. Last updated by  Alan VanNice 4 years, 10 months ago.

Topic Author Topic
Posted: Saturday Feb 25th, 2012 at 12:05 pm #6406

I watched Jason’s Video about Custom Capabilities and tried to mimik his “Custom Tag” solution. I added the following code to my functions.php file (I am not a php programmer and probably have not added this correctly).

add_action ("template_redirect", "my_custom_capabilities");

function my_custom_capabilities ()
	{
	if(has_tag("com") && !current_user_can ("access_s2member_ccap_com"))
		{
		header ("Location: ".S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
		exit();
		}
	}

After I saved the file the plugin lost all of it’s helpful formatting and looks like this:

http://www.asandbox.org/wp-content/uploads/2012/02/s2member.png

I removed the plugin and reinstalled it – but this did not help. I also removed the code I added to the functions.php file – this did not help.

I tried the plugin with a different theme, but the same wordpress install – it worked fine. Some how the code I added broke the plugin and the theme, but even if it is incorrect code, I would assume that removing the code, would fix the problem. But that did not help.

Any ideas?

  • This topic was modified 4 years, 10 months ago by  Alan VanNice.
  • This topic was modified 4 years, 10 months ago by  Alan VanNice.
  • This topic was modified 4 years, 10 months ago by  Alan VanNice.
  • This topic was modified 4 years, 10 months ago by  Alan VanNice.
  • This topic was modified 3 years, 4 months ago by  Alan VanNice.

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.