WP_Term::__get()
Getter.
Method of the class: WP_Term{}
No Hooks.
Return
Mixed
. Property value.
Usage
$WP_Term = new WP_Term(); $WP_Term->__get( $key );
- $key(string) (required)
- Property to get.
Changelog
Since 4.4.0 | Introduced. |
WP_Term::__get() WP Term:: get code WP 6.7.1
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' ); } }