Hi,
I'm not sure if this is possible, but I'm giving it a try.
I want to be able to let readers sign up for email updates (connected with MailChimp) for the categories of an individual post.
So for example, a post is categorized "red" and "blue."
A user reading that post would be able to write in their email address, and a hidden checkbox would select categories "red" and "blue."
Right now trying to use a shortcode to dynamically populate a checkbox. When there are multiple categories, however, I can't get it to work. Is there any way to insert multiple parameters into one checkbox?
I'm sure I'm not doing this correctly, but would appreciate if there is a way to multi-select checkboxes. This is what I'm trying right now, listed the terms seperated by &. Not suprisingly, its not working.
if ( $terms && ! is_wp_error( $terms ) ) :
$ppr_categories = array();
foreach ( $terms as $term ) {
$ppr_categories[] = $term->name;
}
$on_ppr = join( "&", $ppr_categories );
echo do_shortcode('[gravityforms id=11 field_values="categories=' . $on_ppr . '"]');
endif;