Changes in trunk/wp-admin/admin-ajax.php [12130:12286]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r12130 r12286 92 92 die; 93 93 } elseif ( 2 == $_GET['test'] ) { 94 if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) 95 die('-1'); 94 96 if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { 95 97 header('Content-Encoding: deflate'); … … 218 220 if ( 'spam' == $status ) 219 221 die( (string) time() ); 220 $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); 222 $r = wp_spam_comment( $comment->comment_ID ); 223 } elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) { 224 if ( 'spam' != $status ) 225 die( (string) time() ); 226 $r = wp_unspam_comment( $comment->comment_ID ); 221 227 } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) { 222 228 $r = wp_delete_comment( $comment->comment_ID ); … … 1207 1213 1208 1214 $searchand = $search = ''; 1209 foreach ( (array) $search_terms as $term) {1215 foreach ( (array) $search_terms as $term ) { 1210 1216 $term = addslashes_gpc($term); 1211 1217 $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))"; … … 1216 1222 $search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')"; 1217 1223 1218 $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND $searchORDER BY post_date_gmt DESC LIMIT 50" );1224 $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" ); 1219 1225 1220 1226 if ( ! $posts ) 1221 1227 exit( __('No posts found.') ); 1222 1228 1223 $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__(' Time').'</th><th>'.__('Status').'</th></tr></thead><tbody>';1229 $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>'; 1224 1230 foreach ( $posts as $post ) { 1225 1231 … … 1236 1242 break; 1237 1243 case 'draft' : 1238 $stat = __(' Unpublished');1244 $stat = __('Draft'); 1239 1245 break; 1240 1246 }
Note: See TracChangeset
for help on using the changeset viewer.