Challenge - 5 Problems
Content Type Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why use custom content types in WordPress?
Which of the following best explains why custom content types are important in WordPress?
Attempts:
2 left
💡 Hint
Think about how different content like blog posts and products are handled.
✗ Incorrect
Custom content types help separate and organize content, so you can manage posts, products, events, and more in their own sections.
❓ component_behavior
intermediate2:00remaining
What happens when you register a new content type?
After registering a new custom content type in WordPress, what is the expected behavior in the admin dashboard?
Attempts:
2 left
💡 Hint
Think about how WordPress shows different content sections in the dashboard.
✗ Incorrect
Registering a new content type adds a new menu in the admin area so you can create and manage that content separately.
📝 Syntax
advanced2:00remaining
Identify the correct code to register a custom content type
Which code snippet correctly registers a custom content type named 'book' in WordPress?
Attempts:
2 left
💡 Hint
Look for correct array syntax and boolean values.
✗ Incorrect
The correct syntax uses an array with commas separating key-value pairs and boolean true for 'public'.
❓ state_output
advanced2:00remaining
What is the output of this code snippet?
Given this code snippet in WordPress functions.php, what will be the output on the admin menu?
function create_movie_cpt() {
register_post_type('movie', [
'label' => 'Movies',
'public' => true,
'show_in_menu' => false
]);
}
add_action('init', 'create_movie_cpt');
Wordpress
function create_movie_cpt() {
register_post_type('movie', [
'label' => 'Movies',
'public' => true,
'show_in_menu' => false
]);
}
add_action('init', 'create_movie_cpt');Attempts:
2 left
💡 Hint
Check the 'show_in_menu' setting and what false means.
✗ Incorrect
Setting 'show_in_menu' to false hides the content type from the admin menu, so no new menu item appears.
🔧 Debug
expert3:00remaining
Why does this custom content type not appear in the admin menu?
A developer wrote this code to register a custom content type but it does not appear in the WordPress admin menu:
function register_event_cpt() {
register_post_type('event', [
'label' => 'Events',
'public' => true,
'show_ui' => false
]);
}
add_action('init', 'register_event_cpt');
What is the reason the 'Events' menu does not show?
Wordpress
function register_event_cpt() {
register_post_type('event', [
'label' => 'Events',
'public' => true,
'show_ui' => false
]);
}
add_action('init', 'register_event_cpt');Attempts:
2 left
💡 Hint
Check the effect of 'show_ui' on admin menus.
✗ Incorrect
Setting 'show_ui' to false disables the admin interface, so no menu item appears for the content type.