Ticket #7723: 7723-01.diff
| File 7723-01.diff, 4.4 KB (added by , 12 years ago) |
|---|
-
wp-admin/includes/ajax-actions.php
87 87 wp_die(); 88 88 } 89 89 90 function wp_ajax_ajax_author_search() { 91 if ( isset( $_GET[ 'term' ] ) ) { 92 $sanitized_term = sanitize_key( $_GET[ 'term' ] ); 93 94 if ( strlen( $sanitized_term ) < 2 ) 95 wp_die( 0 ); 96 97 $users = get_users( 98 array( 99 'order_by' => 'display_name', 100 'search' => '*' . $sanitized_term . '*', 101 'who' => 'authors' 102 ) 103 ); 104 105 $json = array(); 106 107 foreach ( $users as $user ) { 108 $json[] = (object) array( 109 'label' => $user->data->display_name, 110 'value' => $user->data->ID 111 ); 112 } 113 114 wp_send_json( $json ); 115 } else { 116 wp_die( 0 ); 117 } 118 } 119 90 120 function wp_ajax_wp_compression_test() { 91 121 if ( !current_user_can( 'manage_options' ) ) 92 122 wp_die( -1 ); -
wp-admin/includes/class-wp-posts-list-table.php
214 214 ); 215 215 wp_dropdown_categories( $dropdown_options ); 216 216 } 217 218 if ( is_multi_author() ) 219 $this->authors_dropdown(); 220 217 221 do_action( 'restrict_manage_posts' ); 218 222 submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) ); 219 223 } … … 225 229 </div> 226 230 <?php 227 231 } 232 233 function authors_dropdown() { 234 $author = 235 isset( $_GET[ 'author' ] ) 236 ? absint( $_GET[ 'author' ] ) 237 : 0; 238 239 $author_user = get_user_by( 'id', $author ); 240 241 $count_users = count_users(); 242 243 if ( $count_users[ 'total_users' ] >= apply_filters( 'authors_dropdown_max', 20 ) ) { 244 ?> 245 <input type="hidden" name="author" id="author-filter" value="<?php echo false !== $author_user ? esc_attr( $author ) : '0'; ?>" /> 246 <input type="text" name="" id="author-filter-autocomplete" value="<?php echo false !== $author_user ? esc_attr( $author_user->data->display_name ) : ''; ?>" placeholder="<?php esc_attr( _e( 'Show all authors' ) ); ?>" size="20" class="hide-if-no-js" /> 247 <?php 248 } else { 249 $users = get_users( 250 array( 251 'orderby' => 'display_name', 252 'who' => 'authors' 253 ) 254 ); 255 ?> 256 <select name="author" id="author-filter"> 257 <option value="0"><?php esc_html( _e( 'Show all authors' ) ); ?></option> 258 <?php foreach( $users as $user ) { ?> 259 <option value="<?php echo esc_attr( $user->data->ID ); ?>"<?php selected( $author, $user->data->ID ); ?>> 260 <?php echo esc_html( $user->data->display_name ); ?> 261 </option> 262 <?php } ?> 263 </select> 264 <?php 265 } 266 } 228 267 229 268 function current_action() { 230 269 if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) -
wp-admin/admin-ajax.php
41 41 do_action( 'admin_init' ); 42 42 43 43 $core_actions_get = array( 44 'fetch-list', 'ajax-tag-search', ' wp-compression-test', 'imgedit-preview', 'oembed-cache',44 'fetch-list', 'ajax-tag-search', 'ajax-author-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', 45 45 'autocomplete-user', 'dashboard-widgets', 'logged-in', 46 46 ); 47 47 -
wp-admin/edit.php
152 152 $wp_list_table->prepare_items(); 153 153 154 154 wp_enqueue_script('inline-edit-post'); 155 wp_enqueue_script( 'post-filters' ); 155 156 156 157 $title = $post_type_object->labels->name; 157 158 -
wp-includes/script-loader.php
437 437 did_action( 'init' ) && $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array( 438 438 'error' => __('Error while saving the changes.') 439 439 ) ); 440 441 $scripts->add( 'post-filters', "/wp-admin/js/post-filters$suffix.js", array( 'jquery', 'jquery-ui-autocomplete' ), false, 1 ); 440 442 441 443 $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), false, 1 ); 442 444 did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array(