Ticket #14424: 14424.diff
File 14424.diff, 3.8 KB (added by , 11 years ago) |
---|
-
wp-admin/import.php
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_importers_by_name' ); 78 78 ?> 79 79 <table class="widefat importers" cellspacing="0"> 80 80 -
wp-admin/includes/media.php
1992 1992 if ( get_user_setting('uploader') ) 1993 1993 $form_class .= ' html-uploader'; 1994 1994 1995 $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0; 1996 if ( $_GET['paged'] < 1 ) 1997 $_GET['paged'] = 1; 1998 $start = ( $_GET['paged'] - 1 ) * 10; 1999 if ( $start < 1 ) 2000 $start = 0; 2001 add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) ); 1995 add_filter( 'post_limits', '_media_upload_pagination_offset' ); 2002 1996 2003 1997 list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); 2004 1998 … … 2140 2134 } 2141 2135 2142 2136 /** 2137 * Returns a LIMIT clause to constrain the number of rows returned. 2138 * 2139 * @since 2.9.0 2140 * @access private 2141 * 2142 * @return string The limit clause 2143 */ 2144 function _media_upload_pagination_offset() { 2145 $_GET['paged'] = isset( $_GET['paged'] ) ? intval( $_GET['paged'] ) : 1; 2146 $_GET['paged'] = max( $_GET['paged'], 1 ); 2147 $start = absint( ( $_GET['paged'] - 1 ) * 10 ); 2148 2149 return "LIMIT $start, 10"; 2150 } 2151 2152 /** 2143 2153 * Creates the form for external url 2144 2154 * 2145 2155 * @since 2.7.0 -
wp-admin/includes/import.php
16 16 function get_importers() { 17 17 global $wp_importers; 18 18 if ( is_array($wp_importers) ) 19 uasort( $wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));19 uasort( $wp_importers, '_uasort_importers_by_name' ); 20 20 return $wp_importers; 21 21 } 22 22 23 23 /** 24 * Sort importers by name. 25 * 26 * Used by uasort() as a callback, should not be used directly. 27 * 28 * @since 2.9.0 29 * @access private 30 * 31 * @param array $a 32 * @param array $b 33 * @return int 34 */ 35 function _uasort_importers_by_name( $a, $b ) { 36 return strnatcasecmp( $a[0], $b[0] ); 37 } 38 39 /** 24 40 * Register importer for WordPress. 25 41 * 26 42 * @since 2.0.0 -
wp-includes/category-template.php
614 614 ); 615 615 616 616 if ( !isset( $args['topic_count_text_callback'] ) && isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) { 617 $body = 'return sprintf ( 618 _n(' . var_export($args['single_text'], true) . ', ' . var_export($args['multiple_text'], true) . ', $count), 619 number_format_i18n( $count ));'; 620 $args['topic_count_text_callback'] = create_function('$count', $body); 617 $args['topic_count_text_callback'] = '_plugin_topic_count'; 621 618 } 622 619 623 620 $args = wp_parse_args( $args, $defaults ); … … 717 714 return ( $a->count > $b->count ); 718 715 } 719 716 717 /** 718 * Default text for tooltip for tag links 719 * 720 * @since 3.9.0 721 * @access private 722 * 723 * @param integer $count Number of posts with that tag. 724 * @param object $tag Tag object. 725 * @param array $args Arguments for the tag cloud. 726 * @return string Text for the tooltip of a tag link. 727 */ 728 function _plugin_topic_count( $count, $tag, $args ) { 729 return sprintf( 1 == $count? $args['single_text'] : $args['multiple_text'], number_format_i18n( $count ) ); 730 } 731 720 732 // 721 733 // Helper functions 722 734 //