Recall & Review
beginner
What is a custom post type in WordPress?
A custom post type is a way to create content types other than the default posts and pages, like portfolios, testimonials, or products.
Click to reveal answer
beginner
Which WordPress function is used to register a custom post type?
The function
register_post_type() is used to create a new custom post type.Click to reveal answer
intermediate
What are the two main arguments passed to
register_post_type()?The first is the post type key (a string identifier), and the second is an array of options that define labels, visibility, and features.
Click to reveal answer
intermediate
Why should you hook
register_post_type() into the init action?Because WordPress loads custom post types during initialization, hooking into
init ensures your post type is registered early and available everywhere.Click to reveal answer
beginner
Name two common features you can enable for a custom post type.
You can enable features like
title, editor, thumbnail, excerpt, and comments.Click to reveal answer
Which hook is best to use when registering a custom post type?
✗ Incorrect
The
init hook runs early and is the recommended place to register custom post types.What does the first argument of
register_post_type() represent?✗ Incorrect
The first argument is a string that identifies the custom post type.
Which feature allows a custom post type to have a featured image?
✗ Incorrect
The
thumbnail feature enables featured images for the post type.What is the purpose of the 'labels' array in
register_post_type()?✗ Incorrect
The 'labels' array customizes the names and messages shown in the WordPress admin for the post type.
If you want your custom post type to appear in the WordPress admin menu, which argument should you set?
✗ Incorrect
Setting
show_ui to true makes the post type visible in the admin menu.Explain how to register a custom post type in WordPress and why it is useful.
Think about how WordPress organizes content beyond posts and pages.
You got /5 concepts.
Describe the role of the 'supports' argument when registering a custom post type.
It controls what editing tools the post type has.
You got /3 concepts.