WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Admin\API

NavigationFavorites::register_routes() public WC 1.0

Register the routes

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

Хуков нет.

Возвращает

null. Ничего.

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

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

Код NavigationFavorites::register_routes() WC 5.8.0

public function register_routes() {
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base,
		array(
			array(
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_items' ),
				'permission_callback' => array( $this, 'get_items_permissions_check' ),
				'args'                => array(
					'user_id' => array(
						'required'          => true,
						'validate_callback' => function( $param, $request, $key ) {
							return is_numeric( $param );
						},
					),
				),
			),
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'add_item' ),
				'permission_callback' => array( $this, 'add_item_permissions_check' ),
				'args'                => array(
					'item_id' => array(
						'required' => true,
					),
					'user_id' => array(
						'required'          => true,
						'validate_callback' => function( $param, $request, $key ) {
							return is_numeric( $param );
						},
					),
				),
			),
			array(
				'methods'             => \WP_REST_Server::DELETABLE,
				'callback'            => array( $this, 'delete_item' ),
				'permission_callback' => array( $this, 'delete_item_permissions_check' ),
				'args'                => array(
					'item_id' => array(
						'required' => true,
					),
					'user_id' => array(
						'required'          => true,
						'validate_callback' => function( $param, $request, $key ) {
							return is_numeric( $param );
						},
					),
				),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/me',
		array(
			array(
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_items_by_current_user' ),
				'permission_callback' => array( $this, 'current_user_permissions_check' ),
			),
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'add_item_by_current_user' ),
				'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_by_current_user' ),
				'permission_callback' => array( $this, 'current_user_permissions_check' ),
				'args'                => array(
					'item_id' => array(
						'required' => true,
					),
				),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

}