Bird
0
0

Which of the following is the correct syntax to delete a taxonomy term by its ID?

easy📝 Syntax Q3 of 15
Wordpress - Custom Post Types and Taxonomies
Which of the following is the correct syntax to delete a taxonomy term by its ID?
Adelete_term( $taxonomy, $term_id )
Bwp_remove_term( $term_id, $taxonomy )
Cremove_term( $term_id )
Dwp_delete_term( $term_id, $taxonomy )
Step-by-Step Solution
Solution:
  1. Step 1: Recall the function to delete terms

    WordPress uses wp_delete_term() to delete a term by ID and taxonomy.
  2. Step 2: Confirm parameter order

    The correct order is term ID first, then taxonomy name.
  3. Final Answer:

    wp_delete_term( $term_id, $taxonomy ) -> Option D
  4. Quick Check:

    Delete term syntax = wp_delete_term(term_id, taxonomy) [OK]
Quick Trick: Use wp_delete_term(term_id, taxonomy) to delete terms [OK]
Common Mistakes:
  • Swapping parameters order
  • Using non-existent delete_term() function

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes