From the course: WordPress: Custom Post Types and Taxonomies

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Customizing your post type settings

Customizing your post type settings - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

Customizing your post type settings

- [Instructor] With our labels set, let's turn our attention to the settings, which we're going to pass through the argument array. The codex makes it clear which of these arguments are true by default, and which are not, making it easier for us to know what we need to pass through code. There are a few things we do want to set, though, such as have archives, the rewrite rule, we want to set the menu icon, and we want to make sure to add those supports. If we look at the current state of our Add New Business screen, you'll see that while we have the title and editor, we don't have the featured image, and the block editor is not enabled, but we'll touch on that later. So let's go back to our code and in the arguments array, we'll start adding some key value pairs. The first is has_archive. We're going to set this explicitly to businesses. Remember our slug is business, but we want this to represent the fact that there are multiple businesses. Next is rewrite. We want to make sure that…

Contents