Automattic\WooCommerce\Admin\API

OnboardingThemes::register_routes()publicWC 1.0

Register routes.

Method of the class: OnboardingThemes{}

No Hooks.

Return

null. Nothing.

Usage

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

OnboardingThemes::register_routes() code WC 7.3.0

public function register_routes() {
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/install',
		array(
			array(
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'install_theme' ),
				'permission_callback' => array( $this, 'update_item_permissions_check' ),
			),
			'schema' => array( $this, 'get_item_schema' ),
		)
	);

	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/activate',
		array(
			array(
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'activate_theme' ),
				'permission_callback' => array( $this, 'update_item_permissions_check' ),
			),
			'schema' => array( $this, 'get_item_schema' ),
		)
	);
}