WordPress default taxonomy (Categories) has the item Uncategorized by default. How to add a default item to a new custom taxonomy?
functions.php:
// === CUSTOM TAXONOMIES === //
function my_custom_taxonomies() {
register_taxonomy(
'block', // internal name = machine-readable taxonomy name
'static_content', // object type = post, page, link, or custom post-type
array(
'hierarchical' => true,
'labels' => array(
'name' => __( 'Blocks' ),
'singular_name' => __( 'Block' ),
'add_new_item' => 'Add New Block',
'edit_item' => 'Edit Block',
'new_item' => 'New Block',
'search_items' => 'Search Block',
'not_found' => 'No Block found',
'not_found_in_trash' => 'No Block found in trash',
),
'query_var' => true, // enable taxonomy-specific querying
'rewrite' => array( 'slug' => 'block' ), // pretty permalinks for your taxonomy?
)
);
}
add_action('init', 'my_custom_taxonomies', 0);
EDIT: I just want to have the taxonomy item there when the theme is installed. It doesn’t have to automatically be added to any empty term.