Automattic\WooCommerce\Admin\API

NoteActions::register_routes()publicWC 1.0

Register the routes for admin notes.

Метод класса: NoteActions{}

Хуков нет.

Возвращает

null. Ничего (null).

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

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

Код NoteActions::register_routes() WC 8.7.0

public function register_routes() {
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base . '/(?P<note_id>[\d-]+)/action/(?P<action_id>[\d-]+)',
		array(
			'args'   => array(
				'note_id'   => array(
					'description' => __( 'Unique ID for the Note.', 'woocommerce' ),
					'type'        => 'integer',
				),
				'action_id' => array(
					'description' => __( 'Unique ID for the Note Action.', 'woocommerce' ),
					'type'        => 'integer',
				),
			),
			array(
				'methods'             => \WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'trigger_note_action' ),
				// @todo - double check these permissions for taking note actions.
				'permission_callback' => array( $this, 'get_item_permissions_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);
}