Meta filter category ID - keeps in each post with the same name key 'meta_data_filter_cat'.
So if you want to allow your user create new posts with already predefined or selected 'Meta filter category ID' you are need in your wp theme functions.php add next code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | add_action('save_post', 'my_save_post', 1); function my_save_post() { if (!empty($_POST)) { global $post; if (is_object($post)) { $meta_data_filter_cat_id = 777; //$meta_data_filter_cat_id=$_POST['meta_data_filter_cat_id']; if ($post->post_type == '__your_post_type_slug_here__') { update_post_meta('meta_data_filter_cat', $meta_data_filter_cat_id); } } } } |
Where $meta_data_filter_cat_id is predefined meta_data_filter_cat ID which of course you can get using array $_POST if you are allowing your user to select filter category filter ID on the front ...