Bird
0
0

Which of the following is the correct way to add a simple plugin hook in WordPress to change the site title?

easy📝 Syntax Q12 of 15
Wordpress - Plugins and Extensibility
Which of the following is the correct way to add a simple plugin hook in WordPress to change the site title?
Aadd_action('wp_title', 'my_custom_title');
Badd_plugin('wp_title', 'my_custom_title');
Cadd_filter('wp_title', 'my_custom_title');
Dadd_hook('wp_title', 'my_custom_title');
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct hook function

    WordPress uses add_filter to modify data like titles, not add_action.
  2. Step 2: Check function names

    add_hook and add_plugin are not valid WordPress functions.
  3. Final Answer:

    add_filter('wp_title', 'my_custom_title'); -> Option C
  4. Quick Check:

    Use add_filter for modifying data [OK]
Quick Trick: Use add_filter to change data like titles [OK]
Common Mistakes:
  • Using add_action instead of add_filter
  • Using non-existent functions like add_hook
  • Confusing hook names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes