WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/10/2017 06:51:28 PM (2 years ago)
Author:
jnylen0
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/dateQuery.php

    r36789 r40605  
    999999        $this->assertEqualSets( $expected, $q->posts );
    10001000    }
    1001 
    1002     /** Helpers **********************************************************/
    1003 
    1004     /**
    1005      * There's no way to change post_modified through the API.
    1006      */
    1007     protected function update_post_modified( $post_id, $date ) {
    1008         global $wpdb;
    1009         return $wpdb->update(
    1010             $wpdb->posts,
    1011             array(
    1012                 'post_modified' => $date,
    1013                 'post_modified_gmt' => $date,
    1014             ),
    1015             array(
    1016                 'ID' => $post_id,
    1017             ),
    1018             array(
    1019                 '%s',
    1020                 '%s',
    1021             ),
    1022             array(
    1023                 '%d',
    1024             )
    1025         );
    1026     }
    10271001}
Note: See TracChangeset for help on using the changeset viewer.