Automattic\WooCommerce\Admin\API

NavigationFavorites::register_routes()publicWC 1.0

Register the routes

Method of the class: NavigationFavorites{}

No Hooks.

Return

null. Nothing (null).

Usage

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

NavigationFavorites::register_routes() code WC 8.7.0

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' ),
		)
	);

}