0
0
Wordpressframework~10 mins

Why content types matter 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('book', [1]);
Drag options to blanks, or click blank then click option'
Atrue
B'Books'
Carray('name' => 'Books')
Darray('label' => 'Books', 'public' => true)
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string instead of an array
Using incorrect keys in the array
2fill in blank
medium

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

Wordpress
register_post_type('movie', array('supports' => array([1])));
Drag options to blanks, or click blank then click option'
A'thumbnail'
B'editor'
C'excerpt'
D'comments'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'thumbnail' which is for images
Choosing 'comments' which is for comments support
3fill in blank
hard

Fix the error in the code to properly register a custom taxonomy.

Wordpress
register_taxonomy('genre', 'book', [1]);
Drag options to blanks, or click blank then click option'
Aarray('label' => 'Genres', 'hierarchical' => true)
Barray('labels' => 'Genres')
C'label' => 'Genres'
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string instead of an array
Using 'labels' as a string instead of an array
4fill in blank
hard

Fill both blanks to create a custom post type with title and editor support.

Wordpress
register_post_type('album', array('supports' => array([1], [2])));
Drag options to blanks, or click blank then click option'
A'title'
B'editor'
C'thumbnail'
D'comments'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'thumbnail' or 'comments' instead of 'title' or 'editor'
5fill in blank
hard

Fill all three blanks to register a custom taxonomy with hierarchical support and a label.

Wordpress
register_taxonomy('topic', 'post', array('hierarchical' => [1], 'label' => [2], 'show_ui' => [3]));
Drag options to blanks, or click blank then click option'
Afalse
B'Topics'
Ctrue
D'topic'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting hierarchical to false
Using label without quotes
Setting show_ui to false