Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the site title in WordPress.
Wordpress
update_option('blogname', [1]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of a string.
Forgetting quotes around the title.
✗ Incorrect
The update_option function updates the site title by passing the new title as a string.
2fill in blank
mediumComplete the code to retrieve the WordPress timezone setting.
Wordpress
$timezone = get_option([1]); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'date_format' or 'time_format' instead of timezone option.
Forgetting quotes around the option name.
✗ Incorrect
The timezone_string option holds the timezone setting in WordPress.
3fill in blank
hardFix the error in the code to update the admin email in WordPress.
Wordpress
update_option('admin_email', [1]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a variable without quotes.
Using a function that does not exist.
✗ Incorrect
The new email must be a string in quotes to update the admin email correctly.
4fill in blank
hardFill both blanks to get and update the WordPress site description.
Wordpress
$desc = get_option([1]); update_option([2], 'New description here');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different option names for get and update.
Using 'description' or 'site_description' which are incorrect.
✗ Incorrect
The option name for the site description is blogdescription. Use it to get and update the description.
5fill in blank
hardFill all three blanks to create a custom option and retrieve it in WordPress.
Wordpress
add_option([1], [2]); $value = get_option([3]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different option names for add and get.
Passing a variable instead of a string value.
✗ Incorrect
Use the same option name custom_setting to add and get the option. The value is a string.