Bird
0
0

Which of the following is the correct syntax to update a WordPress option named 'homepage_title' to 'Welcome Home'?

easy📝 Syntax Q3 of 15
Wordpress - WordPress Settings and Configuration
Which of the following is the correct syntax to update a WordPress option named 'homepage_title' to 'Welcome Home'?
Aupdate_option('homepage_title', 'Welcome Home');
Bupdate_option('homepage_title' => 'Welcome Home');
Cset_option('homepage_title', 'Welcome Home');
Dadd_option('homepage_title', 'Welcome Home');
Step-by-Step Solution
Solution:
  1. Step 1: Recall update_option() syntax

    update_option() takes two parameters: option name as string, and new value.
  2. Step 2: Check each option

    update_option('homepage_title', 'Welcome Home'); uses correct syntax. update_option('homepage_title' => 'Welcome Home'); uses wrong array syntax. set_option('homepage_title', 'Welcome Home'); uses non-existent function. add_option('homepage_title', 'Welcome Home'); adds but does not update.
  3. Final Answer:

    update_option('homepage_title', 'Welcome Home'); -> Option A
  4. Quick Check:

    Correct update_option() syntax = update_option(name, value) [OK]
Quick Trick: update_option() needs two parameters: name and value [OK]
Common Mistakes:
  • Using array syntax instead of parameters
  • Using set_option() which does not exist
  • Using add_option() to update existing option

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes