Index: wp-includes/post.php =================================================================== --- wp-includes/post.php (revision 14447) +++ wp-includes/post.php (working copy) @@ -26,6 +26,7 @@ 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, + 'media_add' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ), ) ); @@ -40,6 +41,7 @@ 'hierarchical' => true, 'rewrite' => false, 'query_var' => false, + 'media_add' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ), ) ); @@ -811,7 +813,7 @@ $wp_post_types = array(); // Args prefixed with an underscore are reserved for internal use. - $defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK, 'can_export' => true ); + $defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 'media_add' => false ); $args = wp_parse_args($args, $defaults); $args = (object) $args; Index: wp-admin/admin-ajax.php =================================================================== --- wp-admin/admin-ajax.php (revision 14447) +++ wp-admin/admin-ajax.php (working copy) @@ -1253,7 +1253,12 @@ if ( empty($_POST['ps']) ) exit; - $what = isset($_POST['pages']) ? 'page' : 'post'; + if($wp_post_types[$_POST['post_type']]->media_add === true ) { + $what = $_POST['post_type']; + } else { + $what = 'post'; + } + $s = stripslashes($_POST['ps']); preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); $search_terms = array_map('_search_terms_tidy', $matches[0]); @@ -1271,7 +1276,7 @@ $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" ); if ( ! $posts ) - exit( __('No posts found.') ); + exit( __('No '. $what .' found.') ); $html = '
'.__('Title').' | '.__('Date').' | '.__('Status').' |
---|