Ticket #14424: 14424.3.diff
File 14424.3.diff, 4.2 KB (added by , 11 years ago) |
---|
-
src/wp-admin/import.php
foreach ( $popular_importers as $pop_importer => $pop_data ) { 74 74 if ( empty( $importers ) ) { 75 75 echo '<p>' . __('No importers are available.') . '</p>'; // TODO: make more helpful 76 76 } else { 77 uasort( $importers, create_function('$a, $b', 'return strnatcasecmp($a[0], $b[0]);'));77 uasort( $importers, '_uasort_by_first_member' ); 78 78 ?> 79 79 <table class="widefat importers"> 80 80 -
src/wp-admin/includes/import.php
15 15 */ 16 16 function get_importers() { 17 17 global $wp_importers; 18 if ( is_array($wp_importers) ) 19 uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);')); 18 if ( is_array( $wp_importers ) ) { 19 uasort( $wp_importers, '_uasort_by_first_member' ); 20 } 20 21 return $wp_importers; 21 22 } 22 23 23 24 /** 25 * Sorts a multidimensional array by first member of each top level member 26 * 27 * Used by uasort() as a callback, should not be used directly. 28 * 29 * @since 2.9.0 30 * @access private 31 * 32 * @param array $a 33 * @param array $b 34 * @return int 35 */ 36 function _uasort_by_first_member( $a, $b ) { 37 return strnatcasecmp( $a[0], $b[0] ); 38 } 39 40 /** 24 41 * Register importer for WordPress. 25 42 * 26 43 * @since 2.0.0 -
src/wp-admin/includes/media.php
function media_upload_library_form($errors) { 2260 2260 if ( get_user_setting('uploader') ) 2261 2261 $form_class .= ' html-uploader'; 2262 2262 2263 $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0; 2264 if ( $_GET['paged'] < 1 ) 2265 $_GET['paged'] = 1; 2266 $start = ( $_GET['paged'] - 1 ) * 10; 2267 if ( $start < 1 ) 2268 $start = 0; 2269 add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) ); 2263 add_filter( 'post_limits', '_media_upload_pagination_offset' ); 2270 2264 2271 2265 list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); 2272 2266 … … jQuery(function($){ 2417 2411 } 2418 2412 2419 2413 /** 2414 * Returns a LIMIT clause to constrain the number of rows returned. 2415 * 2416 * @since 2.9.0 2417 * @access private 2418 * 2419 * @return string The limit clause 2420 */ 2421 function _media_upload_pagination_offset() { 2422 $_GET['paged'] = isset( $_GET['paged'] ) ? intval( $_GET['paged'] ) : 1; 2423 $_GET['paged'] = max( $_GET['paged'], 1 ); 2424 $start = absint( ( $_GET['paged'] - 1 ) * 10 ); 2425 2426 return "LIMIT $start, 10"; 2427 } 2428 2429 /** 2420 2430 * Creates the form for external url 2421 2431 * 2422 2432 * @since 2.7.0 -
src/wp-includes/category-template.php
function wp_generate_tag_cloud( $tags, $args = '' ) { 622 622 ); 623 623 624 624 if ( !isset( $args['topic_count_text_callback'] ) && isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) { 625 $body = 'return sprintf ( 626 _n(' . var_export($args['single_text'], true) . ', ' . var_export($args['multiple_text'], true) . ', $count), 627 number_format_i18n( $count ));'; 628 $args['topic_count_text_callback'] = create_function('$count', $body); 625 $args['topic_count_text_callback'] = '_plugin_topic_count'; 629 626 } 630 627 631 628 $args = wp_parse_args( $args, $defaults ); … … function _wp_object_count_sort_cb( $a, $b ) { 725 722 return ( $a->count > $b->count ); 726 723 } 727 724 725 /** 726 * Default text for tooltip for tag links 727 * 728 * @since 3.9.0 729 * @access private 730 * 731 * @param integer $count Number of posts with that tag. 732 * @param object $tag Tag object. 733 * @param array $args Arguments for the tag cloud. 734 * @return string Text for the tooltip of a tag link. 735 */ 736 function _plugin_topic_count( $count, $tag, $args ) { 737 return sprintf( 1 == $count? $args['single_text'] : $args['multiple_text'], number_format_i18n( $count ) ); 738 } 739 728 740 // 729 741 // Helper functions 730 742 //