lib/endpoints/class-wp-rest-terms-controller.php 1 location
|
@@ 13-18 (lines=6) @@
|
10 |
|
/** |
11 |
|
* @param string $taxonomy |
12 |
|
*/ |
13 |
|
public function __construct( $taxonomy ) { |
14 |
|
$this->taxonomy = $taxonomy; |
15 |
|
$this->namespace = 'wp/v2'; |
16 |
|
$tax_obj = get_taxonomy( $taxonomy ); |
17 |
|
$this->rest_base = ! empty( $tax_obj->rest_base ) ? $tax_obj->rest_base : $tax_obj->name; |
18 |
|
} |
19 |
|
|
20 |
|
/** |
21 |
|
* Register the routes for the objects of the controller. |
lib/endpoints/class-wp-rest-posts-controller.php 1 location
|
@@ 7-12 (lines=6) @@
|
4 |
|
|
5 |
|
protected $post_type; |
6 |
|
|
7 |
|
public function __construct( $post_type ) { |
8 |
|
$this->post_type = $post_type; |
9 |
|
$this->namespace = 'wp/v2'; |
10 |
|
$obj = get_post_type_object( $post_type ); |
11 |
|
$this->rest_base = ! empty( $obj->rest_base ) ? $obj->rest_base : $obj->name; |
12 |
|
} |
13 |
|
|
14 |
|
/** |
15 |
|
* Register the routes for the objects of the controller. |