WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Рекомендую всем своим клиентам!
функция не описана

Automattic\WooCommerce\Admin\API

OnboardingTasks::register_routes() public WC 1.0

Register routes.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

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

Хуков нет.

Возвращает

null. Ничего.

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

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

Код OnboardingTasks::register_routes() WC 5.8.0

public function register_routes() {
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/import_sample_products',
		array(
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'import_sample_products' ),
				'permission_callback' => array( $this, 'create_products_permission_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/create_homepage',
		array(
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'create_homepage' ),
				'permission_callback' => array( $this, 'create_pages_permission_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/status',
		array(
			array(
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_status' ),
				'permission_callback' => array( $this, 'get_status_permission_check' ),
			),
			'schema' => array( $this, 'get_status_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/create_product_from_template',
		array(
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'create_product_from_template' ),
				'permission_callback' => array( $this, 'create_products_permission_check' ),
				'args'                => array_merge(
					$this->get_endpoint_args_for_item_schema( \WP_REST_Server::CREATABLE ),
					array(
						'template_name' => array(
							'required'    => true,
							'type'        => 'string',
							'description' => __( 'Product template name.', 'woocommerce' ),
						),
					)
				),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base,
		array(
			array(
				'methods'             => \WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_tasks' ),
				'permission_callback' => array( $this, 'get_tasks_permission_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/(?P<id>[a-z0-9_\-]+)/dismiss',
		array(
			array(
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'dismiss_task' ),
				'permission_callback' => array( $this, 'get_tasks_permission_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/(?P<id>[a-z0-9_\-]+)/undo_dismiss',
		array(
			array(
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'undo_dismiss_task' ),
				'permission_callback' => array( $this, 'get_tasks_permission_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/(?P<id>[a-z0-9_-]+)/snooze',
		array(
			'args'   => array(
				'duration'     => array(
					'description'       => __( 'Time period to snooze the task.', 'woocommerce' ),
					'type'              => 'string',
					'validate_callback' => function( $param, $request, $key ) {
						return in_array( $param, array_keys( $this->duration_to_ms ), true );
					},
				),
				'task_list_id' => array(
					'description' => __( 'Optional parameter to query specific task list.', 'woocommerce' ),
					'type'        => 'string',
				),
			),
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'snooze_task' ),
				'permission_callback' => array( $this, 'snooze_task_permissions_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/(?P<id>[a-z0-9_\-]+)/undo_snooze',
		array(
			array(
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'undo_snooze_task' ),
				'permission_callback' => array( $this, 'snooze_task_permissions_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);
}