PHP Class The_SEO_Framework\Term_Data

Holds Term and Taxonomy data.
Since: 2.7.1
Inheritance: extends Post_Data
Show file Open project: sybrew/the-seo-framework

Public Methods

Method Description
delete_term_meta ( integer $term_id, integer $tt_id ) Delete term meta data when a term is deleted.
fetch_the_term ( integer $id = '' ) : null | object Try to fetch a term if none can be found.
get_tax_labels ( string $tax_type ) : object | null Fetch Tax labels
get_term_data ( object | null $term = null, object | null $term_id ) : array Fetch set Term data.
get_term_meta ( integer $term_id, boolean $use_cache = true ) : array Returns term meta data from ID.
get_term_meta_defaults ( ) : array Returns an array of default term options.
initialize_term_meta ( ) Initializes term meta data filters and functions.
update_term_meta ( integer $term_id, integer $tt_id, string $taxonomy = '' ) : void Sanitizes and saves term meta data when a term is altered.

Protected Methods

Method Description
__construct ( ) Constructor, load parent constructor.
get_old_term_data ( object $term ) : array Fetches term metadata array for the inpost term metabox.
get_the_term_name ( object $term, boolean $singular = true, boolean $fallback = true, boolean $use_cache = true ) : string Get the current screen term labels.

Method Details

__construct() protected method

Constructor, load parent constructor.
protected __construct ( )

delete_term_meta() public method

Delete only the default data keys.
Since: 2.7.0
public delete_term_meta ( integer $term_id, integer $tt_id )
$term_id integer Term ID.
$tt_id integer Term Taxonomy ID.

fetch_the_term() public method

Try to fetch a term if none can be found.
Since: 2.6.0
public fetch_the_term ( integer $id = '' ) : null | object
$id integer The possible taxonomy Term ID.
return null | object The Term object.

get_old_term_data() protected method

Fetches term metadata array for the inpost term metabox.
Since: 2.7.0
protected get_old_term_data ( object $term ) : array
$term object The TT object. Must be assigned.
return array The SEO Framework TT data.

get_tax_labels() public method

Fetch Tax labels
Since: 2.3.1
public get_tax_labels ( string $tax_type ) : object | null
$tax_type string the Taxonomy type.
return object | null with all the labels as member variables

get_term_data() public method

Fetch set Term data.
Since: 2.6.0
Since: 2.7.0 Handles term object differently for upgraded database.
public get_term_data ( object | null $term = null, object | null $term_id ) : array
$term object | null The TT object, if it isn't set, one is fetched.
$term_id object | null The term object.
return array The SEO Framework TT data.

get_term_meta() public method

Returns Genesis 2.3.0+ data if no term meta data is set.
Since: 2.7.0
public get_term_meta ( integer $term_id, boolean $use_cache = true ) : array
$term_id integer The Term ID.
$use_cache boolean Whether to use caching.
return array The term meta data.

get_term_meta_defaults() public method

Returns an array of default term options.
Since: 2.7.0
Since: 2.1.8: Applies filters array the_seo_framework_term_meta_defaults : Array of default term SEO options
public get_term_meta_defaults ( ) : array
return array The Term Metadata default options.

get_the_term_name() protected method

Get the current screen term labels.
Since: 2.6.0
protected get_the_term_name ( object $term, boolean $singular = true, boolean $fallback = true, boolean $use_cache = true ) : string
$term object The Taxonomy Term object.
$singular boolean Whether to fetch a singular or plural name.
$fallback boolean Whether to fallback on a generic name.
$use_cache boolean Whether to read from cache.
return string the Term name.

initialize_term_meta() public method

Initializes term meta data filters and functions.
Since: 2.7.0

update_term_meta() public method

Sanitizes and saves term meta data when a term is altered.
Since: 2.7.0
public update_term_meta ( integer $term_id, integer $tt_id, string $taxonomy = '' ) : void
$term_id integer Term ID.
$tt_id integer Term Taxonomy ID.
$taxonomy string Taxonomy Slug
return void Early on AJAX call.