don’t publish custom post type post if a meta data field isn’t valid

You can stop the post from saving all together with minor JQuery hacks and validate the fields before saving on the client side or server side with ajax: first we add our JavaScript to capture the submit/publish event and use it to submit our own ajax function before the actual submit: add_action(‘wp_print_scripts’,’my_publish_admin_hook’); function my_publish_admin_hook(){ if … Read more

Custom field values to taxonomy terms

Don’t have a time to test it now but something like this should work: // Change or add your own arguments as needed $args = array( ‘post_type’ => ‘post’, ‘numberposts’ => -1, ‘offset’ => 0 ); $my_posts = get_posts( $args ); if ( $my_posts ) { foreach ( $my_posts as $my_post ) { $meta = … Read more

Permalinks: custom structure for taxonomy – tags?

If you hook into the ‘rewrite_rules_array’ filter, do a print_r on $rules, and you’ll see the huge preg-match key-value pairs. add_filter( ‘rewrite_rules_array’,’mess_with_rewrite_rules’ ); function mess_with_rewrite_rules( $rules ) { print_pre($rules); return $rules; } See where your rule is in the stack. WordPress loops through this list looking for anything that matches the keys, which are regex … Read more