What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-11 16:25:08
auto check a category when creating new post
add_filter('wp_terms_checklist_args', 'WPSE_pre_select_categories', 10, 2); function WPSE_pre_select_categories($args, $post_id) { $post = get_post($post_id); // only pre select categories for new posts if ($post->post_status !... Add solution