WP_Term::__get() WordPress Method
The WP_Term::__get() method is used to get a property of a term object.
WP_Term::__get( string $key ) #
Getter.
Parameters
- $key
(string)(Required)Property to get.
Return
(mixed) Property value.
Source
File: wp-includes/class-wp-term.php
public function __get( $key ) { switch ( $key ) { case 'data': $data = new stdClass(); $columns = array( 'term_id', 'name', 'slug', 'term_group', 'term_taxonomy_id', 'taxonomy', 'description', 'parent', 'count' ); foreach ( $columns as $column ) { $data->{$column} = isset( $this->{$column} ) ? $this->{$column} : null; } return sanitize_term( $data, $data->taxonomy, 'raw' ); } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |