Show
Ignore:
Timestamp:
10/30/07 16:49:38 (1 year ago)
Author:
donncha
Message:

Merge with WordPress? 2.3.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/includes/post.php

    r1130 r1139  
    349349                        return false; 
    350350 
    351                 wp_cache_delete($post_ID, 'post_meta'); 
    352  
    353351                $result = $wpdb->query( " 
    354352                                                INSERT INTO $wpdb->postmeta 
     
    365363        $mid = (int) $mid; 
    366364 
    367         $post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 
    368         wp_cache_delete($post_id, 'post_meta'); 
    369  
    370365        return $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_id = '$mid'" ); 
    371366} 
     
    413408        if ( in_array($mkey, $protected) ) 
    414409                return false; 
    415  
    416         $post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = '$mid'"); 
    417         wp_cache_delete($post_id, 'post_meta'); 
    418410 
    419411        $mvalue = maybe_serialize( stripslashes( $mvalue )); 
     
    477469} 
    478470 
    479 function wp_edit_posts_query( $q = false ) { 
    480         global $wpdb; 
    481         if ( false === $q ) 
    482                 $q = $_GET; 
    483         $q['m']   = (int) $q['m']; 
    484         $q['cat'] = (int) $q['cat']; 
    485         $post_stati  = array(   //      array( adj, noun ) 
    486                                 'draft' => array(__('Draft'), _c('Drafts|manage posts header')), 
    487                                 'future' => array(__('Scheduled'), __('Scheduled posts')), 
    488                                 'pending' => array(__('Pending Review'), __('Pending posts')), 
    489                                 'private' => array(__('Private'), __('Private posts')), 
    490                                 'publish' => array(__('Published'), __('Published posts')) 
    491                         ); 
    492  
    493         $avail_post_stati = $wpdb->get_col("SELECT DISTINCT post_status FROM $wpdb->posts WHERE post_type = 'post'"); 
    494  
    495         $post_status_q = ''; 
    496         $post_status_label = _c('Posts|manage posts header'); 
    497         if ( isset($q['post_status']) && in_array( $q['post_status'], array_keys($post_stati) ) ) { 
    498                 $post_status_label = $post_stati[$q['post_status']][1]; 
    499                 $post_status_q = '&post_status=' . $q['post_status']; 
    500         } 
    501  
    502         if ( 'pending' === $q['post_status'] ) { 
    503                 $order = 'ASC'; 
    504                 $orderby = 'modified'; 
    505         } elseif ( 'draft' === $q['post_status'] ) { 
    506                 $order = 'DESC'; 
    507                 $orderby = 'modified'; 
    508         } else { 
    509                 $order = 'DESC'; 
    510                 $orderby = 'date'; 
    511         } 
    512  
    513         wp("what_to_show=posts$post_status_q&posts_per_page=20&order=$order&orderby=$orderby"); 
    514  
    515         return array($post_stati, $avail_post_stati); 
    516 } 
    517  
    518471?>