Bsf_Core_Rest::register_routes()

Register the routes for the objects of the controller.


Description


Source

File: admin/bsf-core/classes/class-bsf-core-rest.php

	public function register_routes() {
		register_rest_route(
			$this->namespace,
			$this->rest_base . '/activate',
			array(
				'methods' => WP_REST_Server::CREATABLE,
				'callback' => array( $this, 'activate_license' ),
				'permission_callback' => array( $this, 'get_items_permissions_check' ),
				'args' => array(
					'product-id' => array(
						'type'     => 'string',
						'required' => true,
						'sanitize_callback' => 'sanitize_text_field',
					),
					'license-key' => array(
						'type'     => 'string',
						'required' => true,
						'sanitize_callback' => 'sanitize_text_field',
					),
				),
			)
		);
	}

User Contributed Notes

You must log in before being able to contribute a note or feedback.