Only display top level taxonomy on the edit post page with option to expand sub-categories

This is a VERY untested approach, but the recent addition of CSS’s :has selector has been top-of-mind for me lately, and I wondered if a simple solution could be built using purely CSS.. As a proof of concept, add the following to your site’s admin CSS: #categorychecklist > li .children{display:none;} #categorychecklist > li:has(input:checked ) .children{display:block;} … Read more

Auto Generate Post Title from 2 ACF Taxonomies [closed]

Try this in your functions.php file: add_action(‘save_post’, ‘wpb_autogenerate_events_title’, 10, 3); function wpb_autogenerate_events_title($post_id, $post, $update) { // Check if it’s the ‘events’ CPT and if the title is empty. if (‘events’ !== $post->post_type || !empty($post->post_title)) { return; } // Fetch terms from ‘category’ and ‘nameselection’ taxonomies. $category_term = wp_get_post_terms($post_id, ‘category’, [‘fields’ => ‘names’]); $nameselection_term = wp_get_post_terms($post_id, … Read more