Tagged with " s2member"
Nov 21, 2012 - WordPress    Comments Off on Changing post restrictions in the DB.

Changing post restrictions in the DB.

$s2data = get_option('ws_plugin__s2member_options');
if($s2data['level1_posts']==''){
	$recipes = get_posts(array('numberposts' => -1,'post_type' => 'msd_recipe'));
	foreach($recipes AS $r){
		$protected[] = $r->ID;
	}
	$s2data['level1_posts'] = implode(',', $protected);
	update_option('ws_plugin__s2member_options', $s2data);
	print 'recipes protected';
}