0
0
Wordpressframework~10 mins

Why custom content types serve business needs in Wordpress - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to register a custom post type in WordPress.

Wordpress
register_post_type('product', array('label' => 'Products', 'public' => [1]));
Drag options to blanks, or click blank then click option'
Atrue
Bnull
Cfalse
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using false hides the content type from visitors.
2fill in blank
medium

Complete the code to add support for the editor in a custom post type.

Wordpress
register_post_type('event', array('supports' => array([1])));
Drag options to blanks, or click blank then click option'
A'thumbnail'
B'editor'
C'comments'
D'excerpt'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'thumbnail' adds image support but not content editing.
3fill in blank
hard

Fix the error in the code to properly register a custom post type with REST API support.

Wordpress
register_post_type('portfolio', array('show_in_rest' => [1]));
Drag options to blanks, or click blank then click option'
A'yes'
B1
Ctrue
D'true'
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings like 'true' instead of boolean true.
4fill in blank
hard

Fill both blanks to create a custom post type that is hierarchical and has an archive page.

Wordpress
register_post_type('book', array('hierarchical' => [1], 'has_archive' => [2]));
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C'true'
D'false'
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values instead of booleans.
5fill in blank
hard

Fill all three blanks to register a custom post type with a custom menu icon, label, and public visibility.

Wordpress
register_post_type('movie', array('menu_icon' => [1], 'label' => [2], 'public' => [3]));
Drag options to blanks, or click blank then click option'
A'dashicons-video-alt2'
B'Movies'
Ctrue
D'dashicons-admin-post'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong icon strings or wrong data types for public.