Category subscriptions for public subscribers
-
I am attempting to allow public subscribers to choose which categories they would like to subscribe to using Subscribe2. I actually do not wish to have ANY registered users on my site, I will only ever require an email address to subscribe (e.g. all subscribers will be Public). I’d prefer to never have subscribers access the WordPress backend – but I’d like to allow those users to choose categories once, when they subscribe.
I’ve been able to add a radio button list to the shortcode by adding the following code to the shortcode() function within class-s2-frontend.php :
$this->form = "<form method=\"post\"" . $action . "><input type=\"hidden\" name=\"ip\" value=\"" . $_SERVER['REMOTE_ADDR'] . "\" />" . $antispam_text . "<p><label for=\"s2email\">" . __('Your email:', 'subscribe2') . "</label>
<input type=\"text\" name=\"email\" id=\"s2email\" value=\"" . $value . "\" size=\"" . $args['size'] . "\" />" . $wrap_text . "</p><h3>Select Categories</h3>";$categories=get_categories(array( 'taxonomy' => 'themes_cat'));
foreach($categories as $category) {
$this->form .= "<input type='checkbox' name='cats[]' value='$category->term_id' /> ";
$this->form .= $category->cat_name;
$this->form .= '
';
}
$this->form .= "
" . $this->input_form_action . "</form>";
$this->s2form = apply_filters('s2_form', $this->form);However, I have hit a wall in trying to save those selections and only sending posts within those categories to the public subscribers. I am sending a weekly digest. As above, the categories I’d like users to subscribe to are part of a custom taxonomy called “themes_cat”. My subscribe form is currently private but I can link you on request.
Any help would be very much appreciated!
Christopher
- The topic ‘Category subscriptions for public subscribers’ is closed to new replies.