WOOF_Term

Extends WOOF_Wrap

Methods

Represents a single term within a WordPress taxonomy, containing many powerful methods for working with them.

Example: Ways to obtain a WOOF_Term

List of Methods

Magic Methods

  • __call( String $name, Array $arguments )Mixed OR WOOF_Silent

    Implements PHP’s __call magic method to provide a number of clever handlers for the unknown method call.

  • __set( String $name, Mixed $value )

    Implements PHP’s __set magic method allowing properties of the term to be set via direct property assignment.

  • __toString()String

    Implements the __toString PHP magic method to output the (descriptive) term name when it is echoed.Note: this method is not intended to be called directly.

Property Methods

  • __get( String $name )Mixed OR WOOF_Silent

    Implements PHP’s __get magic method to provide a number of clever handlers for the unknown property access.

  • count()Integer

    Returns the number of times this term has been assigned to posts, which is calculated by WordPress.

  • has_children()WOOF_Collection of WOOF_Term OR Boolean

    Checks if the this term has any children.Note: this will only return meaningful results if this term is based on a taxonomy which is hierarchical.

  • has_parent()WOOF_Term OR Boolean

    Checks if this term has a parent.Note: this will only return meaningful results if this term is based on a hierarchical taxonomy.

  • id()Integer

    Retrieves the database ID of this term (internally referred to as “term_id” in WordPress).

  • is( Mixed $id, String $taxonomy = null ) OR WOOF_Silent

    Checks if this term matches the $id specified.

  • is_a( String $tax )Boolean

    Checks if this term has the given taxonomy name.

  • is_an( String $tax )Boolean

    An alias for the WOOF_Term::is_a method, to check if this term has the given taxonomy name.

  • is_child_of( Mixed $id )Boolean

    Checks to see if this term is a child of another term (at any level in the hierarchy).

  • is_current()Boolean

    Checks if this term is the current active term being displayed.

  • name()String

    Retrieves the (descriptive) name of the taxonomy term.

  • parent()

    Retrieves the immediate parent term for this term.Note: this will only return meaningful results if the term is based on a hierarchical taxonomy.

  • slug()String

    Retrieves the slug of this term.

  • taxonomy()WOOF_Taxonomy

    Retrieves a WOOF_Taxonomy object representing the taxonomy for this term.

  • taxonomy_and_id()String

    Retrieves a tuple of taxonomy name and term ID for this term.

  • taxonomy_name()String

    Retrieves the taxonomy name for this term.

  • title()String

    An alias of the WOOF_Term::name method to retrieve the (descriptive) name of the taxonomy term.

  • top()MEOW_Post

    Retrieves the top level ancestor of this term.Note: this will only return a meaningful result if this term is based on a hierarchical taxonomy.

  • url()String

    Retrieves the root_relative URL (domain and protocol removed) of the archive page for this term.

Manipulation

  • __set( String $name, Mixed $value )

    Implements PHP’s __set magic method allowing properties of the term to be set via direct property assignment.

  • assign( Array $args )

    Bulk assign a number of properties of this term at the one time.Note: this method does not update the database, you will need to call the method WOOF_Term::update after using this method.

  • delete()

    Deletes the term behind this object in the database, via the WordPress function wp_delete_term.

  • relate_to( Mixed $id, String $type )

    Links this term with a post, via the WordPress function wp_set_object_terms.

  • update( Boolean $strip = true )WOOF_Term

    Updates the database with any changes made to this term.

Theming

Posts

Traversal

  • children( Arguments $args = array() )WOOF_Collection of WOOF_Term

    Retrieves the immediate child objects of this term.This method uses get_terms to retrieve the children, and you can further clarify this query with the args parameter (the parent parameter will be enforced to actually retrieve the children).

  • depth( Boolean $nocache = false )Integer

    Returns the depth of this term in the hierarchy, where 1 is the top level, 2 is the 2nd level, and so on.

  • has_children()WOOF_Collection of WOOF_Term OR Boolean

    Checks if the this term has any children.Note: this will only return meaningful results if this term is based on a taxonomy which is hierarchical.

  • has_parent()WOOF_Term OR Boolean

    Checks if this term has a parent.Note: this will only return meaningful results if this term is based on a hierarchical taxonomy.

  • next( Arguments $args = array() )WOOF_Term OR WOOF_Silent

    Gets the next term in the set of siblings for this term as defined by the query in the $args parameter.

  • parent()

    Retrieves the immediate parent term for this term.Note: this will only return meaningful results if the term is based on a hierarchical taxonomy.

  • prev( Arguments $args = array() )WOOF_Term OR WOOF_Silent

    Gets the previous term in the set of siblings for this term as defined by the query in the $args parameter.

Taxonomy Terms

  • ancestors()WOOF_Collection of WOOF_Term

    Retrieves a collection of ancestors for this term from lowest to highest in the hierarchyThis will only return meaningful results when the term is based on a hierarchical taxonomy.

  • children( Arguments $args = array() )WOOF_Collection of WOOF_Term

    Retrieves the immediate child objects of this term.This method uses get_terms to retrieve the children, and you can further clarify this query with the args parameter (the parent parameter will be enforced to actually retrieve the children).

  • depth( Boolean $nocache = false )Integer

    Returns the depth of this term in the hierarchy, where 1 is the top level, 2 is the 2nd level, and so on.

  • is( Mixed $id, String $taxonomy = null ) OR WOOF_Silent

    Checks if this term matches the $id specified.

  • next( Arguments $args = array() )WOOF_Term OR WOOF_Silent

    Gets the next term in the set of siblings for this term as defined by the query in the $args parameter.

  • parent()

    Retrieves the immediate parent term for this term.Note: this will only return meaningful results if the term is based on a hierarchical taxonomy.

  • prev( Arguments $args = array() )WOOF_Term OR WOOF_Silent

    Gets the previous term in the set of siblings for this term as defined by the query in the $args parameter.

  • relate_to( Mixed $id, String $type )

    Links this term with a post, via the WordPress function wp_set_object_terms.

  • siblings( Boolean $include_this = false )WOOF_Collection of

    Retrieves the sibling objects of this term, that is, terms that exist at the same level in the hierarchy as the current term (or terms that have the same parent as this term).Note: this will only return results if the term is based on a hierarchical taxonomy.

  • top()MEOW_Post

    Retrieves the top level ancestor of this term.Note: this will only return a meaningful result if this term is based on a hierarchical taxonomy.

Taxonomies

  • __call( String $name, Array $arguments )Mixed OR WOOF_Silent

    Implements PHP’s __call magic method to provide a number of clever handlers for the unknown method call.

  • __get( String $name )Mixed OR WOOF_Silent

    Implements PHP’s __get magic method to provide a number of clever handlers for the unknown property access.

  • __set( String $name, Mixed $value )

    Implements PHP’s __set magic method allowing properties of the term to be set via direct property assignment.

  • __toString()String

    Implements the __toString PHP magic method to output the (descriptive) term name when it is echoed.Note: this method is not intended to be called directly.

  • ancestors()WOOF_Collection of WOOF_Term

    Retrieves a collection of ancestors for this term from lowest to highest in the hierarchyThis will only return meaningful results when the term is based on a hierarchical taxonomy.

  • assign( Array $args )

    Bulk assign a number of properties of this term at the one time.Note: this method does not update the database, you will need to call the method WOOF_Term::update after using this method.

  • children( Arguments $args = array() )WOOF_Collection of WOOF_Term

    Retrieves the immediate child objects of this term.This method uses get_terms to retrieve the children, and you can further clarify this query with the args parameter (the parent parameter will be enforced to actually retrieve the children).

  • count()Integer

    Returns the number of times this term has been assigned to posts, which is calculated by WordPress.

  • delete()

    Deletes the term behind this object in the database, via the WordPress function wp_delete_term.

  • depth( Boolean $nocache = false )Integer

    Returns the depth of this term in the hierarchy, where 1 is the top level, 2 is the 2nd level, and so on.

  • has_children()WOOF_Collection of WOOF_Term OR Boolean

    Checks if the this term has any children.Note: this will only return meaningful results if this term is based on a taxonomy which is hierarchical.

  • has_parent()WOOF_Term OR Boolean

    Checks if this term has a parent.Note: this will only return meaningful results if this term is based on a hierarchical taxonomy.

  • id()Integer

    Retrieves the database ID of this term (internally referred to as “term_id” in WordPress).

  • is( Mixed $id, String $taxonomy = null ) OR WOOF_Silent

    Checks if this term matches the $id specified.

  • is_a( String $tax )Boolean

    Checks if this term has the given taxonomy name.

  • is_an( String $tax )Boolean

    An alias for the WOOF_Term::is_a method, to check if this term has the given taxonomy name.

  • is_child_of( Mixed $id )Boolean

    Checks to see if this term is a child of another term (at any level in the hierarchy).

  • is_current()Boolean

    Checks if this term is the current active term being displayed.

  • name()String

    Retrieves the (descriptive) name of the taxonomy term.

  • next( Arguments $args = array() )WOOF_Term OR WOOF_Silent

    Gets the next term in the set of siblings for this term as defined by the query in the $args parameter.

  • parent()

    Retrieves the immediate parent term for this term.Note: this will only return meaningful results if the term is based on a hierarchical taxonomy.

  • posts( Arguments $args = array() )WOOF_Collection of MEOW_Post

    A powerful method to retrieve a list of posts that are attached to this term, in a very concise and easy-to-use way.This method uses get_posts to retrieve the posts, so you can further clarify this query with the args parameter.

  • posts_by_menu_order( Arguments $args = array() )WOOF_Collection of MEOW_Post

    A powerful method to retrieve a list of posts that are attached to this term, ordered by menu order (user-defined) in a very concise and easy-to-use way.This method uses get_posts to retrieve the posts, so you can further clarify this query with the args parameter.

  • posts_by_title( Arguments $args = array() )WOOF_Collection of MEOW_Post

    A powerful method to retrieve a list of posts that are attached to this term, ordered by title in a very concise and easy-to-use way.This method uses get_posts to retrieve the posts, so you can further clarify this query with the args parameter.

  • posts_of_type( String $type, Arguments $args = array() )WOOF_Collection of MEOW_Post

    A powerful method to retrieve a list of posts that are attached to this term, of a specific type, in a very concise and easy-to-use way.This method uses get_posts to retrieve the posts, so you can further clarify this query with the args parameter.

  • prev( Arguments $args = array() )WOOF_Term OR WOOF_Silent

    Gets the previous term in the set of siblings for this term as defined by the query in the $args parameter.

  • query_posts( Arguments $args = array() )WOOF_Collection of MEOW_Post

    A preset on the WOOF::query_posts method, to retrieve the posts for this term, while also affecting the main query loop.

  • relate_to( Mixed $id, String $type )

    Links this term with a post, via the WordPress function wp_set_object_terms.

  • siblings( Boolean $include_this = false )WOOF_Collection of

    Retrieves the sibling objects of this term, that is, terms that exist at the same level in the hierarchy as the current term (or terms that have the same parent as this term).Note: this will only return results if the term is based on a hierarchical taxonomy.

  • slug()String

    Retrieves the slug of this term.

  • taxonomy()WOOF_Taxonomy

    Retrieves a WOOF_Taxonomy object representing the taxonomy for this term.

  • taxonomy_and_id()String

    Retrieves a tuple of taxonomy name and term ID for this term.

  • taxonomy_name()String

    Retrieves the taxonomy name for this term.

  • title()String

    An alias of the WOOF_Term::name method to retrieve the (descriptive) name of the taxonomy term.

  • top()MEOW_Post

    Retrieves the top level ancestor of this term.Note: this will only return a meaningful result if this term is based on a hierarchical taxonomy.

  • update( Boolean $strip = true )WOOF_Term

    Updates the database with any changes made to this term.

  • url()String

    Retrieves the root_relative URL (domain and protocol removed) of the archive page for this term.

Base Class Methods

View method list from the base class WOOF_Wrap.

Latest From the Blog

MasterPress 1.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

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.

Three AM