WC_REST_Layout_Templates_Controller::register_routes()
Register the routes for template layouts.
Метод класса: WC_REST_Layout_Templates_Controller{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WC_REST_Layout_Templates_Controller = new WC_REST_Layout_Templates_Controller(); $WC_REST_Layout_Templates_Controller->register_routes();
Код WC_REST_Layout_Templates_Controller::register_routes() WC REST Layout Templates Controller::register routes WC 9.5.1
public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => array( 'area' => array( 'description' => __( 'Area to get templates for.', 'woocommerce' ), 'type' => 'string', 'default' => '', ), ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>\w[\w\s\-]*)', array( 'args' => array( 'id' => array( 'description' => __( 'Unique identifier for the resource.', 'woocommerce' ), 'type' => 'string', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array(), ), ) ); }