Inventory_Presser_REST::add_hooks()

add_hooks

On This Page


Return Return

(void)


Top ↑

Source Source

File: includes/class-rest.php

	public function add_hooks() {
		/*
			Adds
				/invp/v1/settings
				/invp/v1/feed-complete routes.
		*/
		add_action( 'rest_api_init', array( $this, 'add_routes' ) );

		// 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 );

		// Allow vehicles to be returned in a random order.
		add_filter( 'rest_' . INVP::POST_TYPE . '_collection_params', array( $this, 'allow_orderby_rand' ) );
	}