Complete the code to get all terms of a taxonomy.
<?php $terms = get_terms(array('taxonomy' => '[1]')); ?>
The get_terms function requires the taxonomy name, such as 'category', to fetch terms.
Complete the code to create a new term in a taxonomy.
<?php wp_insert_term('New Term', '[1]'); ?>
The second argument of wp_insert_term is the taxonomy slug, like 'category'.
Fix the error in the code to get terms with no empty results.
<?php $terms = get_terms(array('taxonomy' => 'category', 'hide_empty' => [1])); ?>
Setting hide_empty to false ensures terms with no posts are included.
Fill both blanks to update a term's name and slug.
<?php wp_update_term([1], 'category', array('name' => 'Updated Name', 'slug' => '[2]')); ?>
The first argument is the term ID (e.g., 15), and the slug is a string like 'updated-name'.
Fill all three blanks to register a custom taxonomy.
<?php register_taxonomy('[1]', '[2]', array('label' => '[3]')); ?>
First is the taxonomy slug ('genre'), second is the post type ('post'), third is the label ('Genres').
