wpseek.com
WordPress开发者和主题制作者的搜索引擎
rest_get_route_for_term › WordPress Function
Since5.5.0
已弃用n/a
› rest_get_route_for_term ( $term )
参数: |
|
返回: |
|
定义在: |
|
文档: |
Gets the REST API route for a term.
源码
function rest_get_route_for_term( $term ) { $term = get_term( $term ); if ( ! $term instanceof WP_Term ) { return ''; } $taxonomy_route = rest_get_route_for_taxonomy_items( $term->taxonomy ); if ( ! $taxonomy_route ) { return ''; } $route = sprintf( '%s/%d', $taxonomy_route, $term->term_id ); /** * Filters the REST API route for a term. * * @since 5.5.0 * * @param string $route The route path. * @param WP_Term $term The term object. */ return apply_filters( 'rest_route_for_term', $route, $term ); }