Ticket #13229: 13229-3.diff
File 13229-3.diff, 3.7 KB (added by , 14 years ago) |
---|
-
wp-includes/ms-functions.php
839 839 update_user_meta( $user_id, 'primary_blog', $blog_id ); 840 840 841 841 restore_current_blog(); 842 do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id );842 do_action( 'wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta ); 843 843 844 844 return $blog_id; 845 845 } -
wp-admin/admin-ajax.php
1265 1265 if ( empty($_POST['ps']) ) 1266 1266 exit; 1267 1267 1268 $what = isset($_POST['pages']) ? 'page' : 'post'; 1268 if(!empty($_POST['post_type']) && in_array($_POST['post_type'], get_post_types(array() ))) { 1269 $what = $_POST['post_type']; 1270 } else { 1271 $what = 'post'; 1272 } 1273 1269 1274 $s = stripslashes($_POST['ps']); 1270 1275 preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); 1271 1276 $search_terms = array_map('_search_terms_tidy', $matches[0]); … … 1282 1287 1283 1288 $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" ); 1284 1289 1285 if ( ! $posts ) 1286 exit( __('No posts found.') ); 1290 if ( ! $posts ) { 1291 $posttype = get_post_type_object($what); 1292 exit($posttype->labels->not_found); 1293 } 1287 1294 1288 1295 $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>'; 1289 1296 foreach ( $posts as $post ) { -
wp-admin/includes/template.php
3278 3278 <input type="text" id="find-posts-input" name="ps" value="" /> 3279 3279 <input type="button" onclick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br /> 3280 3280 3281 <input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="post s" />3281 <input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="post" /> 3282 3282 <label for="find-posts-posts"><?php _e( 'Posts' ); ?></label> 3283 <input type="radio" name="find-posts-what" id="find-posts-pages" value="page s" />3283 <input type="radio" name="find-posts-what" id="find-posts-pages" value="page" /> 3284 3284 <label for="find-posts-pages"><?php _e( 'Pages' ); ?></label> 3285 3286 <?php 3287 $post_types = get_post_types(array('public' => true, '_builtin' => false), 'objects'); 3288 foreach ($post_types AS $post) { 3289 ?> 3290 <input type="radio" name="find-posts-what" id="find-posts-<?php echo esc_attr($post->name); ?>" value="<?php echo $post->name; ?>" /> 3291 <label for="find-posts-<?php echo esc_attr($post->name); ?>"><?php echo $post->label; ?></label> 3292 <?php 3293 } ?> 3285 3294 </div> 3286 3295 <div id="find-posts-response"></div> 3287 3296 </div> -
wp-admin/js/media.dev.js
31 31 _ajax_nonce: $('#_ajax_nonce').val() 32 32 }; 33 33 34 if ( $('#find-posts-pages').is(':checked') ) { 35 post['pages'] = 1; 36 } else { 37 post['posts'] = 1; 38 } 34 var selectedItem; 35 $("input[@name='itemSelect[]']:checked").each(function() { selectedItem = $(this).val() }); 36 post['post_type'] = selectedItem; 37 39 38 $.ajax({ 40 39 type : 'POST', 41 40 url : ajaxurl,