Automattic\WooCommerce\Internal\Admin\Emails

EmailListingRestController::register_routespublicWC 1.0

Register the REST API endpoints handled by this controller.

Method of the class: EmailListingRestController{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

EmailListingRestController::register_routes() code WC 10.3.3

public function register_routes() {
	$this->initialize_template_generator();

	register_rest_route(
		$this->route_namespace,
		'/' . $this->rest_base . '/recreate-email-post',
		array(
			array(
				'methods'             => \WP_REST_Server::CREATABLE,
				'callback'            => fn( $request ) => $this->recreate_email_post( $request ),
				'permission_callback' => fn( $request ) => $this->check_permissions( $request ),
				'args'                => $this->get_args_for_recreate_email_post(),
				'schema'              => $this->get_schema_with_message(),
			),
		)
	);
}