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.

Hook to reach demoted user?

Home Forums Community Forum Hook to reach demoted user?

Tagged: ,

This topic contains 0 replies, has 1 voice. Last updated by  eBierek 3 years, 3 months ago.

Topic Author Topic
Posted: Sunday Sep 29th, 2013 at 9:15 am #59987
eBierek
Username: eBierek

Hi,

I have the code below that I want to use to set EOT for users that are demoted but now upgrading to level-1. What hook can I use for this? To check that user is subscriber/level-0 before the upgrade is done? And then set EOT.

(If the check is done after the upgrade, the user will no longer be level-0 but level-1, right? And for level-1 I have another function setting EOT to date(‘Y’)+1 ‘-12-31’) instead of what you see in code below.)

add_action ("#S2MEMBER-HOOK-HERE#", "my_fixed_EOT_time_upd");
function my_fixed_EOT_time_upd ($vars)
{
	if (user_is($vars["user_id"], 'subscriber')) { 
		$expire_on = strtotime ( date('Y') . '-12-31');
		update_user_option ($vars["user_id"], "s2member_auto_eot_time", $expire_on);
}

Any advice how to handle this? Thank you in advance,
Emily

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.