New answers tagged

0

Try this code after the $bio = wp_insert_post( $my_bio_post ); line: $terms = isset($_POST['my_pet']) ? array_filter($_POST['my_pet']) : 0; if ($terms && $bio) wp_set_object_terms($bio, $terms, 'Cats'); See wp_set_object_terms() for more info and make sure the Cats taxonomy and the terms in your checkboxes is already available.


0

add the following code to active theme. Here I am replacing with [shell] before saving. add_filter( 'content_save_pre' , 'my_sanitize_content' , 10, 1); function my_sanitize_content( $value ) { return str_replace("<shell>", "[shell]", $value ); }



Top 50 recent answers are included