Multiple Post Types, Taxonomies, and Roles
The MasterPress API has a number of ways to access collections of object types within your WordPress site, that is – post types, taxonomies, and roles. Note that these methods are likely to be rarely used in theme development, but they could be very useful in building custom dashboard metaboxes or plugin screens.
Retrieving Post Types
To access a collection of all post types in your WordPress site, you can use either of the WOOF::types or WOOF::post_types methods, both of which should be provided with no arguments.
Example 1: Retrieving all post types
You can also access post types attached to a WOOF_Taxonomy by calling either of its WOOF_Taxonomy::types or WOOF_Taxonomy::post_types methods:
Example 2: Retrieving post types for a specific taxonomy
Retrieving Taxonomies
To access a collection of all taxonomies in your WordPress site you can use the WOOF::taxonomies method:
Example 3: Retrieving all taxonomies
Note that this method uses WordPress’ get_taxonomies method to find taxonomies, so you can also specify an arguments string or array as in the examples on the get_taxonomies manual page.
You can also access taxonomies attached to a WOOF_PostType by calling its WOOF_PostType::taxonomies method:
Example 4: Retrieving taxonomies for a specific post type
Retrieving User Roles
To access a collection of all user roles in your WordPress site, you can use the method WOOF::roles method: