| @@ 16-24 (lines=9) @@ | ||
| 13 | add_action( 'rest_api_init', array( $this, 'register_routes' ) ); |
|
| 14 | } |
|
| 15 | ||
| 16 | public function register_routes() { |
|
| 17 | // GET /sites/<blog_id>/business-hours/localized-week - Return the localized |
|
| 18 | register_rest_route( $this->namespace, '/' . $this->rest_base . '/localized-week', array( |
|
| 19 | array( |
|
| 20 | 'methods' => WP_REST_Server::READABLE, |
|
| 21 | 'callback' => array( $this, 'get_localized_week' ), |
|
| 22 | ) |
|
| 23 | ) ); |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * Retreives localized business hours |
|
| @@ 22-33 (lines=12) @@ | ||
| 19 | /** |
|
| 20 | * Called automatically on `rest_api_init()`. |
|
| 21 | */ |
|
| 22 | public function register_routes() { |
|
| 23 | register_rest_route( |
|
| 24 | $this->namespace, |
|
| 25 | $this->rest_base, |
|
| 26 | array( |
|
| 27 | array( |
|
| 28 | 'methods' => WP_REST_Server::READABLE, |
|
| 29 | 'callback' => array( $this, 'get_mailchimp_status' ), |
|
| 30 | ), |
|
| 31 | ) |
|
| 32 | ); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Check if MailChimp is set up properly. |
|