Automattic\WooCommerce\Admin\API

NavigationFavorites::register_routes()publicWC 1.0

Register the routes

{} Это метод класса: NavigationFavorites{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$NavigationFavorites = new NavigationFavorites();
$NavigationFavorites->register_routes();

Код NavigationFavorites::register_routes() WC 6.9.1

public function register_routes() {
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/me',
		array(
			array(
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_items' ),
				'permission_callback' => array( $this, 'current_user_permissions_check' ),
			),
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'add_item' ),
				'permission_callback' => array( $this, 'current_user_permissions_check' ),
				'args'                => array(
					'item_id' => array(
						'required' => true,
					),
				),
			),
			array(
				'methods'             => \WP_REST_Server::DELETABLE,
				'callback'            => array( $this, 'delete_item' ),
				'permission_callback' => array( $this, 'current_user_permissions_check' ),
				'args'                => array(
					'item_id' => array(
						'required' => true,
					),
				),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

}