Include modified in orderby filter
This commit is contained in:
parent
fdcb116b4f
commit
a37628e94b
|
@ -584,6 +584,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
|||
'include',
|
||||
'title',
|
||||
'slug',
|
||||
'modified',
|
||||
),
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
|
|
|
@ -304,4 +304,16 @@ class WC_REST_Customers_Controller extends WC_REST_Customers_V2_Controller {
|
|||
|
||||
return $this->add_additional_fields_schema( $schema );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new options for 'orderby' to the collection params.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_collection_params() {
|
||||
$params = parent::get_collection_params();
|
||||
$params['orderby']['enum'] = array_merge( $params['orderby']['enum'], array( 'modified' ) );
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -673,6 +673,7 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller {
|
|||
'include',
|
||||
'title',
|
||||
'slug',
|
||||
'modified',
|
||||
),
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue