ACF_Rest_Request::get_taxonomy_by_rest_base()
Find the REST enabled taxonomy object that matches the given REST base.
Метод класса: ACF_Rest_Request{}
Хуков нет.
Возвращает
WP_Taxonomy|null
.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_taxonomy_by_rest_base( $rest_base );
- $rest_base (обязательный)
- -
Код ACF_Rest_Request::get_taxonomy_by_rest_base() ACF Rest Request::get taxonomy by rest base ACF 6.0.4
private function get_taxonomy_by_rest_base( $rest_base ) { $taxonomies = get_taxonomies( array( 'show_in_rest' => true ), 'objects' ); foreach ( $taxonomies as $taxonomy ) { if ( acf_get_object_type_rest_base( $taxonomy ) === $rest_base ) { return $taxonomy; } } return null; }