From 18a088a4e1ac31134cd3e1e013c5aca518b1ced1 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 22 Nov 2013 17:38:34 +0000 Subject: [PATCH] In `get_posts()`, alter the doc block and default args to make `orderby` equal to `date`, not `post_date`. Props ounziw. Fixes #26128. git-svn-id: https://develop.svn.wordpress.org/trunk@26329 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 8770b0dc4f..2546ac2dc8 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -1652,7 +1652,7 @@ function set_post_type( $post_id = 0, $post_type = 'post' ) { * 'numberposts' - Default is 5. Total number of posts to retrieve. * 'offset' - Default is 0. See {@link WP_Query::query()} for more. * 'category' - What category to pull the posts from. - * 'orderby' - Default is 'post_date'. How to order the posts. + * 'orderby' - Default is 'date', which orders based on post_date. How to order the posts. * 'order' - Default is 'DESC'. The order to retrieve the posts. * 'include' - See {@link WP_Query::query()} for more. * 'exclude' - See {@link WP_Query::query()} for more. @@ -1672,7 +1672,7 @@ function set_post_type( $post_id = 0, $post_type = 'post' ) { function get_posts($args = null) { $defaults = array( 'numberposts' => 5, 'offset' => 0, - 'category' => 0, 'orderby' => 'post_date', + 'category' => 0, 'orderby' => 'date', 'order' => 'DESC', 'include' => array(), 'exclude' => array(), 'meta_key' => '', 'meta_value' =>'', 'post_type' => 'post',