Inventory_Presser_REST::add_hooks()

add_hooks

Contents


Return Return

(void)


Top ↑

Source Source

File: includes/class-rest.php

	public function add_hooks() {
		// Adds a /invp/v1/settings route.
		add_action('rest_api_init', array( $this, 'add_route' ));

		// Allow attachments to be ordered by the inventory_presser_photo_number meta value.
		add_filter( 'rest_attachment_collection_params', array( $this, 'allow_orderby_photo_number' ) );
		add_filter( 'rest_attachment_query', array( $this, 'orderby_photo_number' ), 10, 2 );
	}