Post filter fixes from mdawaffe. fixes #5249

git-svn-id: https://develop.svn.wordpress.org/trunk@6287 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2007-10-23 23:02:24 +00:00
parent 87fb5e4b49
commit e14f9e0d4d
6 changed files with 22 additions and 15 deletions
+10 -8
View File
@@ -476,10 +476,12 @@ function _relocate_children( $old_ID, $new_ID ) {
return $wpdb->query( "UPDATE $wpdb->posts SET post_parent = $new_ID WHERE post_parent = $old_ID" );
}
function wp_edit_posts_query( $q = '_GET' ) {
function wp_edit_posts_query( $q = false ) {
global $wpdb;
$$q['m'] = (int) $$q['m'];
$$q['cat'] = (int) $$q['cat'];
if ( false === $q )
$q = $_GET;
$q['m'] = (int) $q['m'];
$q['cat'] = (int) $q['cat'];
$post_stati = array( // array( adj, noun )
'draft' => array(__('Draft'), _c('Drafts|manage posts header')),
'future' => array(__('Scheduled'), __('Scheduled posts')),
@@ -492,15 +494,15 @@ function wp_edit_posts_query( $q = '_GET' ) {
$post_status_q = '';
$post_status_label = _c('Posts|manage posts header');
if ( isset($$q['post_status']) && in_array( $$q['post_status'], array_keys($post_stati) ) ) {
$post_status_label = $post_stati[$$q['post_status']][1];
$post_status_q = '&post_status=' . $$q['post_status'];
if ( isset($q['post_status']) && in_array( $q['post_status'], array_keys($post_stati) ) ) {
$post_status_label = $post_stati[$q['post_status']][1];
$post_status_q = '&post_status=' . $q['post_status'];
}
if ( 'pending' === $$q['post_status'] ) {
if ( 'pending' === $q['post_status'] ) {
$order = 'ASC';
$orderby = 'modified';
} elseif ( 'draft' === $$q['post_status'] ) {
} elseif ( 'draft' === $q['post_status'] ) {
$order = 'DESC';
$orderby = 'modified';
} else {