Changeset 16313
- Timestamp:
- 11/11/2010 10:50:36 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/plugin.php
r16312 r16313 261 261 } 262 262 263 uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));263 uasort( $wp_plugins, '_sort_uname_callback' ); 264 264 265 265 $cache_plugins[ $plugin_folder ] = $wp_plugins; … … 313 313 unset( $wp_plugins['index.php'] ); 314 314 315 uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));315 uasort( $wp_plugins, '_sort_uname_callback' ); 316 316 317 317 return $wp_plugins; 318 } 319 320 /** 321 * Callback to sort array by a 'Name' key. 322 * 323 * @since 3.1.0 324 * @access private 325 */ 326 function _sort_uname_callback( $a, $b ) { 327 return strnatcasecmp( $a['Name'], $b['Name'] ); 318 328 } 319 329 … … 354 364 } 355 365 356 uksort( $dropins, create_function( '$a, $b', 'return strnatcasecmp( $a, $b );' ));366 uksort( $dropins, 'strnatcasecmp' ); 357 367 358 368 return $dropins; -
trunk/wp-admin/includes/widgets.php
r16269 r16313 16 16 17 17 $sort = $wp_registered_widgets; 18 usort( $sort, create_function( '$a, $b', 'return strnatcasecmp( $a["name"], $b["name"] );' ));18 usort( $sort, '_sort_name_callback' ); 19 19 $done = array(); 20 20 … … 48 48 49 49 /** 50 * Callback to sort array by a 'name' key. 51 * 52 * @since 3.1.0 53 * @access private 54 */ 55 function _sort_name_callback( $a, $b ) { 56 return strnatcasecmp( $a['name'], $b['name'] ); 57 } 58 59 /** 50 60 * Show the widgets and their settings for a sidebar. 51 61 * Used in the the admin widget config screen. -
trunk/wp-includes/category-template.php
r16307 r16313 678 678 $tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key; 679 679 $tag_name = $tags[ $key ]->name; 680 $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $topic_count_text_callback($real_count ) ) . "' style='font-size: " .680 $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( call_user_func( 'topic_count_text_callback', $real_count ) ) . "' style='font-size: " . 681 681 ( $smallest + ( ( $count - $min_count ) * $font_step ) ) 682 682 . "$unit;'>$tag_name</a>"; … … 701 701 else 702 702 return $return; 703 } 704 705 /** 706 * Callback for comparing tags based on name 707 * 708 * @since 3.1.0 709 * @access private 710 */ 711 function _wp_tag_cloud_name_sort_cb( $a, $b ) { 712 return strnatcasecmp( $a->name, $b->name ); 713 } 714 715 /** 716 * Callback for comparing tags based on count 717 * 718 * @since 3.1.0 719 * @access private 720 */ 721 function _wp_tag_cloud_count_sort_cb( $a, $b ) { 722 return ( $a->count > $b->count ); 703 723 } 704 724 -
trunk/wp-includes/formatting.php
r16280 r16313 237 237 $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 238 238 if ($br) { 239 $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_ _autop_newline_preservation_helper', $pee);239 $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee); 240 240 $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 241 241 $pee = str_replace('<WPPreserveNewline />', "\n", $pee); … … 258 258 * @returns string 259 259 */ 260 function _ _autop_newline_preservation_helper( $matches ) {260 function _autop_newline_preservation_helper( $matches ) { 261 261 return str_replace("\n", "<WPPreserveNewline />", $matches[0]); 262 262 } … … 1596 1596 } else { 1597 1597 $subject = str_replace('_', ' ', $matches[2]); 1598 $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', '_ _wp_iso_convert', $subject);1598 $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject); 1599 1599 return $subject; 1600 1600 } … … 1608 1608 * @param $match the preg_replace_callback matches array 1609 1609 */ 1610 function _ _wp_iso_convert( $match ) {1610 function _wp_iso_convert( $match ) { 1611 1611 return chr( hexdec( strtolower( $match[1] ) ) ); 1612 1612 } -
trunk/wp-includes/kses.php
r15383 r16313 547 547 $pass_allowed_html = $allowed_html; 548 548 $pass_allowed_protocols = $allowed_protocols; 549 return preg_replace_callback('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', 550 create_function('$match', 'global $pass_allowed_html, $pass_allowed_protocols; return wp_kses_split2($match[1], $pass_allowed_html, $pass_allowed_protocols);'), $string); 549 return preg_replace_callback( '%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', '_wp_kses_split_callback', $string ); 550 } 551 552 /** 553 * Callback for wp_kses_split. 554 * 555 * @since 3.1.0 556 * @access private 557 */ 558 function _wp_kses_split_callback( $match ) { 559 global $pass_allowed_html, $pass_allowed_protocols; 560 return wp_kses_split2( $match[1], $pass_allowed_html, $pass_allowed_protocols ); 551 561 } 552 562 -
trunk/wp-includes/post-template.php
r16283 r16313 224 224 } 225 225 if ( $preview ) // preview fix for javascript bug with foreign languages 226 $output = preg_replace_callback('/\%u([0-9A-F]{4})/', '_ _convert_urlencoded_to_entities', $output);226 $output = preg_replace_callback('/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output); 227 227 228 228 return $output; … … 237 237 * @returns string 238 238 */ 239 function _ _convert_urlencoded_to_entities($match) {240 return '&#' . base_convert( $match[1], 16, 10) . ';';239 function _convert_urlencoded_to_entities( $match ) { 240 return '&#' . base_convert( $match[1], 16, 10 ) . ';'; 241 241 } 242 242 -
trunk/wp-includes/post.php
r16275 r16313 1163 1163 $object->labels['menu_name'] = $object->labels['name']; 1164 1164 1165 $defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults ); 1165 foreach ( $nohier_vs_hier_defaults as $key => $value ) 1166 $defaults[$key] = $object->hierarchical ? $value[1] : $value[0]; 1167 1166 1168 $labels = array_merge( $defaults, $object->labels ); 1167 1169 return (object)$labels;
Note: See TracChangeset
for help on using the changeset viewer.