WOOF_PostType

Extends WOOF_Wrap

Methods

Represents a WordPress post type (custom or built-in), containing many powerful methods for querying, and working with posts of each type.

Example: Ways to obtain a WOOF_PostType

List of Methods

Property Methods

  • archive_url( Boolean $root_relative = true )String

    An alias of the WOOF_PostType::url method to retrieve the url for the post type archive page, based on the settings for this post type.

  • feed_url( Boolean $root_relative = true )String

    Returns a feed URL for this post type.

  • item()Object

    Returns the stdClass object representing this post type.

  • label()String

    An alias for the WOOF_PostType::plural_label method, to retrieve the plural-form of the post type label.

  • plural_label()String

    Retrieve the plural-form of the post type label.

  • singular_label()String

    Retrieve the singular form of the post type label.

  • slug()String

    Retrieves the rewrite slug (as per settings) for this post type.

  • supports()Boolean

    Checks if this post type supports a specific feature.The feature key can be any one of:‘title’‘editor’ (content)‘author’‘thumbnail’ (featured image)‘excerpt’‘trackbacks’‘custom-fields’‘comments’ ‘revisions’‘page-attributes’ (template and menu order) .

  • supports_keys()Array

    Retrieve the keys of all of the features that this post type supports.

  • title()String

    An alias for the WOOF_PostType::plural_label method, to retrieve the plural-form label for this post type.

  • url( Boolean $root_relative = true )String

    Retrieves the url for the post type archive page, based on the settings for this post type.

Manipulation

  • create( Arguments $args = array(), Boolean $update = false, Boolean $strip = true )WOOF_Post

    Creates a new WOOF_Post object of this post type, which can either have properties set by passing properties in the args parameter, or setting them manually later in code (via the use of the magic method ---set).

  • find_or_create( String $slug )WOOF_Post

    Retrieves a post object of this post type by first trying to find a post with the specified $slug, or creating a new post with the specified slug if not found.This method could be very useful in some kind of import process, where you might want to create or update posts from another data source (such as a JSON API) without needing to worry about checking for existence first (see example).

  • insert( Arguments $args, Boolean $strip = true )WOOF_Post

    A more readable synonym for the WOOF_PostType::insert to create a post of this type and immediately update the database.

Theming

Posts

Taxonomy Terms

Capabilities

  • cap( String $key, String $fallback )String

    Returns the custom capability key in use for a given standard capability key.

Taxonomies

Transients API

Base Class Methods

View method list from the base class WOOF_Wrap.

Latest From the Blog

MasterPress 1.1.4 now available

MasterPress 1.1.4 is now available. This release contains an important compatibility fix for WordPress 4.5 to allow correct detection of the taxonomy term editing screen. Without this fix, any custom fields you have attached to custom taxonomies will not be shown at all in the editing form. Note also that MasterPress will still detect the edit screen correctly in… 

Plugin Requirements

MasterPress requires a minimum of WordPress version 3.4, MySQL 5, and PHP version 5.2.4.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Traversal