WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/10/2017 06:51:28 PM (3 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/includes/testcase.php

    r40564 r40605  
    869869        return $id;
    870870    }
     871
     872    /**
     873     * There's no way to change post_modified through WP functions.
     874     */
     875    protected function update_post_modified( $post_id, $date ) {
     876        global $wpdb;
     877        return $wpdb->update(
     878            $wpdb->posts,
     879            array(
     880                'post_modified' => $date,
     881                'post_modified_gmt' => $date,
     882            ),
     883            array(
     884                'ID' => $post_id,
     885            ),
     886            array(
     887                '%s',
     888                '%s',
     889            ),
     890            array(
     891                '%d',
     892            )
     893        );
     894    }
    871895}
Note: See TracChangeset for help on using the changeset viewer.