From the course: WordPress: WP-CLI

Unlock the full course today

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

Getting post type information

Getting post type information - WordPress Tutorial

From the course: WordPress: WP-CLI

Start my 1-month free trial

Getting post type information

- [Instructor] WP-CLI has a wide range of post based functionality that we can dive into. And an important note is that all content types, pages, posts, media, custom post types are considered posts. So, first, we should look at how to retrieve what post types are available to us. You can see with WP help post type that we have two commands here. One is get, which will get the details about a specific registered post type. And one is list, which will list all registered post types. So, if we type wp post-type list we'll get a list of all of the post types available to us. You can see, we have the standard WordPress post types, post, page, attachment, revision and nav_menu_item. But then, we also have some different ones like custom_css, oembed_cache, user_request, wp_block and two for give, which is give_forms and give_payment. It's also worth noting, here, that not all post types are public. You could see that we've got four…

Contents