Changeset 14869 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 05/25/2010 02:18:07 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r14852 r14869 1255 1255 exit; 1256 1256 1257 $what = isset($_POST['pages']) ? 'page' : 'post'; 1257 if ( !empty($_POST['post_type']) && in_array( $_POST['post_type'], get_post_types() ) ) 1258 $what = $_POST['post_type']; 1259 else 1260 $what = 'post'; 1261 1258 1262 $s = stripslashes($_POST['ps']); 1259 1263 preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); … … 1272 1276 $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" ); 1273 1277 1274 if ( ! $posts ) 1275 exit( __('No posts found.') ); 1278 if ( ! $posts ) { 1279 $posttype = get_post_type_object($what); 1280 exit($posttype->labels->not_found); 1281 } 1276 1282 1277 1283 $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>';
Note: See TracChangeset
for help on using the changeset viewer.