From 7d337c1327edf252ad1603339823eaac8cf07d6f Mon Sep 17 00:00:00 2001 From: James Nylen Date: Wed, 10 May 2017 18:52:44 +0000 Subject: [PATCH] REST API: Add `author`, `modified`, and `parent` sort order options for posts. These (and a few others that can be revisited later if needed) were present in beta versions of the WP REST API but were removed during the merge to WP 4.7. Props ChopinBach, jnylen0. Fixes #38693. Built from https://develop.svn.wordpress.org/trunk@40605 git-svn-id: http://core.svn.wordpress.org/trunk@40475 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 7 +++++-- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 23017d7c29..4862fae564 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -2130,12 +2130,15 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { 'type' => 'string', 'default' => 'date', 'enum' => array( + 'author', 'date', - 'relevance', 'id', 'include', - 'title', + 'modified', + 'parent', + 'relevance', 'slug', + 'title', ), ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 08f32cb1f4..4fcd916b24 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40604'; +$wp_version = '4.8-alpha-40605'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.