$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'; }