Ticket #14424: 14424.6.diff
File 14424.6.diff, 4.7 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) { 2255 2255 if ( get_user_setting('uploader') ) 2256 2256 $form_class .= ' html-uploader'; 2257 2257 2258 $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0; 2259 if ( $_GET['paged'] < 1 ) 2260 $_GET['paged'] = 1; 2261 $start = ( $_GET['paged'] - 1 ) * 10; 2262 if ( $start < 1 ) 2263 $start = 0; 2264 add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) ); 2258 $q = $_GET; 2259 $q['posts_per_page'] = 10; 2260 $q = isset( $q['paged'] ) ? intval( $q['paged'] ) : 0; 2261 if ( $q['paged'] < 1 ) { 2262 $q['paged'] = 1; 2263 } 2264 $q['offset'] = ( $q['paged'] - 1 ) * 10; 2265 if ( $q['offset'] < 1 ) { 2266 $q['offset'] = 0; 2267 } 2265 2268 2266 list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query( );2269 list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query( $q ); 2267 2270 2268 2271 ?> 2269 2272 -
src/wp-admin/includes/post.php
function wp_edit_attachments_query( $q = false ) { 934 934 unset($q['post_mime_type']); 935 935 936 936 if ( isset($q['detached']) ) 937 add_filter('posts_where', '_edit_attachments_query_helper');937 $q['post_parent'] = 0; 938 938 939 939 wp( $q ); 940 940 941 if ( isset($q['detached']) )942 remove_filter('posts_where', '_edit_attachments_query_helper');943 944 941 return array($post_mime_types, $avail_post_mime_types); 945 942 } 946 943 947 function _edit_attachments_query_helper($where) {948 global $wpdb;949 return $where .= " AND {$wpdb->posts}.post_parent < 1";950 }951 952 944 /** 953 945 * Returns the list of classes to be used by a metabox 954 946 * -
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 //