LLMS_REST_Posts_Controller::prepare_items_query_orderby_mappings( array $query_args, WP_REST_Request $request )

Map to proper WP_Query orderby param.


Parameters Parameters

$query_args

(array) (Required) WP_Query arguments.

$request

(WP_REST_Request) (Required) Full details about the request.


Top ↑

Return Return

(array) Query arguments.


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-posts-controller.php

		return $query_args;

	}

	/**
	 * Map to proper WP_Query orderby param.
	 *
	 * @since 1.0.0-beta.1
	 *
	 * @param array           $query_args WP_Query arguments.
	 * @param WP_REST_Request $request    Full details about the request.
	 * @return array Query arguments.
	 */
	protected function prepare_items_query_orderby_mappings( $query_args, $request ) {

		// Map to proper WP_Query orderby param.
		if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {
			$orderby_mappings = array(
				'id'           => 'ID',


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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