Uses
Uses | Description |
---|---|
wp-includes/rest-api/fields/class-wp-rest-term-meta-fields.php: WP_REST_Term_Meta_Fields::__construct() | Constructor. |
wp-includes/taxonomy.php: get_taxonomy() | Retrieves the taxonomy object of $taxonomy. |
Constructor.
(string) (Required) Taxonomy key.
File: wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php
public function __construct( $taxonomy ) { $this->taxonomy = $taxonomy; $this->namespace = 'wp/v2'; $tax_obj = get_taxonomy( $taxonomy ); $this->rest_base = ! empty( $tax_obj->rest_base ) ? $tax_obj->rest_base : $tax_obj->name; $this->meta = new WP_REST_Term_Meta_Fields( $taxonomy ); }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_terms_controller/__construct