Przeglądaj źródła

refac: changing the wording of the sort endpoints

tags/0.9.0
J 6 lat temu
rodzic
commit
ba66a8845e

+ 2
- 2
plugins/cia-endpoints/cia-end-points.php Wyświetl plik

@@ -52,7 +52,7 @@ add_action( 'rest_api_init', function () {
52 52
  */
53 53
 add_action( 'rest_api_init', function () {
54 54
     $media_controller = new Make_Sort_By('artist', 'by_alpha');
55
-    $media_controller->register_custom_route('by-alpha');
55
+    $media_controller->register_custom_route('artists/by-alpha');
56 56
     $media_controller = new Make_Sort_By('artist', 'by_material');
57
-    $media_controller->register_custom_route('by-material');
57
+    $media_controller->register_custom_route('artists/by-material');
58 58
 });

+ 1
- 1
plugins/cia-endpoints/includes/class.make-sortby.php Wyświetl plik

@@ -12,7 +12,7 @@ class Make_Sort_By extends WP_REST_Controller {
12 12
     public function register_custom_route($route) {
13 13
         $version = '2';
14 14
         $namespace = 'craft/v' . $version;
15
-        register_rest_route( $namespace, '/sort' . '/' . $this->post_type . 's/' . $route, [
15
+        register_rest_route( $namespace, '/sort/' . $route, [
16 16
             array(
17 17
                 'methods'  => WP_REST_Server::READABLE,
18 18
                 'callback' => array( $this, $this->sort_type )

Ładowanie…
Anuluj
Zapisz