Ticket #21893: 21893.patch
| File 21893.patch, 23.6 KB (added by , 13 years ago) |
|---|
-
wp-includes/general-template.php
31 31 $templates[] = 'header.php'; 32 32 33 33 // Backward compat code will be removed in a future release 34 if ( '' == locate_template($templates, true))34 if ( '' == locate_template( $templates, true ) ) 35 35 load_template( ABSPATH . WPINC . '/theme-compat/header.php'); 36 36 } 37 37 … … 60 60 $templates[] = 'footer.php'; 61 61 62 62 // Backward compat code will be removed in a future release 63 if ( '' == locate_template($templates, true))63 if ( '' == locate_template( $templates, true ) ) 64 64 load_template( ABSPATH . WPINC . '/theme-compat/footer.php'); 65 65 } 66 66 … … 89 89 $templates[] = 'sidebar.php'; 90 90 91 91 // Backward compat code will be removed in a future release 92 if ( '' == locate_template($templates, true))92 if ( '' == locate_template( $templates, true ) ) 93 93 load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php'); 94 94 } 95 95 … … 125 125 126 126 $templates[] = "{$slug}.php"; 127 127 128 locate_template( $templates, true, false);128 locate_template( $templates, true, false ); 129 129 } 130 130 131 131 /** … … 147 147 * 148 148 * @since 2.7.0 149 149 * @param boolean $echo Default to echo and not return the form. 150 * @return mixed, string search form if $echo set to false 150 151 */ 151 function get_search_form( $echo = true) {152 function get_search_form( $echo = true ) { 152 153 do_action( 'get_search_form' ); 153 154 154 155 $search_form_template = locate_template('searchform.php'); 155 156 if ( '' != $search_form_template ) { 156 require( $search_form_template);157 require( $search_form_template ); 157 158 return; 158 159 } 159 160 … … 165 166 </form>'; 166 167 167 168 if ( $echo ) 168 echo apply_filters( 'get_search_form', $form);169 echo apply_filters( 'get_search_form', $form ); 169 170 else 170 return apply_filters( 'get_search_form', $form);171 return apply_filters( 'get_search_form', $form ); 171 172 } 172 173 173 174 /** … … 181 182 * 182 183 * @param string $redirect Optional path to redirect to on login/logout. 183 184 * @param boolean $echo Default to echo and not return the link. 185 * @return mixed, string log In/Out link if echo set to false 184 186 */ 185 function wp_loginout( $redirect = '', $echo = true) {187 function wp_loginout( $redirect = '', $echo = true ) { 186 188 if ( ! is_user_logged_in() ) 187 $link = '<a href="' . esc_url( wp_login_url( $redirect) ) . '">' . __('Log in') . '</a>';189 $link = '<a href="' . esc_url( wp_login_url( $redirect ) ) . '">' . __('Log in') . '</a>'; 188 190 else 189 $link = '<a href="' . esc_url( wp_logout_url( $redirect) ) . '">' . __('Log out') . '</a>';191 $link = '<a href="' . esc_url( wp_logout_url( $redirect ) ) . '">' . __('Log out') . '</a>'; 190 192 191 193 if ( $echo ) 192 echo apply_filters( 'loginout', $link);194 echo apply_filters( 'loginout', $link ); 193 195 else 194 return apply_filters( 'loginout', $link);196 return apply_filters( 'loginout', $link ); 195 197 } 196 198 197 199 /** … … 205 207 * @uses apply_filters() calls 'logout_url' hook on final logout url 206 208 * 207 209 * @param string $redirect Path to redirect to on logout. 210 * @return string The logout url 208 211 */ 209 function wp_logout_url( $redirect = '') {212 function wp_logout_url( $redirect = '' ) { 210 213 $args = array( 'action' => 'logout' ); 211 if ( !empty( $redirect) ) {214 if ( !empty( $redirect ) ) { 212 215 $args['redirect_to'] = urlencode( $redirect ); 213 216 } 214 217 215 $logout_url = add_query_arg( $args, site_url('wp-login.php', 'login'));218 $logout_url = add_query_arg( $args, site_url( 'wp-login.php', 'login' ) ); 216 219 $logout_url = wp_nonce_url( $logout_url, 'log-out' ); 217 220 218 return apply_filters( 'logout_url', $logout_url, $redirect);221 return apply_filters( 'logout_url', $logout_url, $redirect ); 219 222 } 220 223 221 224 /** … … 231 234 * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false. 232 235 * @return string A log in url 233 236 */ 234 function wp_login_url( $redirect = '', $force_reauth = false) {235 $login_url = site_url( 'wp-login.php', 'login');237 function wp_login_url( $redirect = '', $force_reauth = false ) { 238 $login_url = site_url( 'wp-login.php', 'login' ); 236 239 237 if ( !empty( $redirect) )238 $login_url = add_query_arg( 'redirect_to', urlencode($redirect), $login_url);240 if ( !empty( $redirect ) ) 241 $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url ); 239 242 240 243 if ( $force_reauth ) 241 $login_url = add_query_arg( 'reauth', '1', $login_url);244 $login_url = add_query_arg( 'reauth', '1', $login_url ); 242 245 243 return apply_filters( 'login_url', $login_url, $redirect);246 return apply_filters( 'login_url', $login_url, $redirect ); 244 247 } 245 248 246 249 /** … … 249 252 * 250 253 * @since 3.0.0 251 254 * @param array $args Configuration options to modify the form output 252 * @return Void, or string containing the form255 * @return mixed, string containing the form is $echo set to false 253 256 */ 254 257 function wp_login_form( $args = array() ) { 255 258 $defaults = array( 'echo' => true, … … 305 308 * @uses apply_filters() calls 'lostpassword_url' hook on the lostpassword url 306 309 * 307 310 * @param string $redirect Path to redirect to on login. 311 * @return string 308 312 */ 309 313 function wp_lostpassword_url( $redirect = '' ) { 310 314 $args = array( 'action' => 'lostpassword' ); 311 if ( !empty( $redirect) ) {315 if ( !empty( $redirect ) ) { 312 316 $args['redirect_to'] = $redirect; 313 317 } 314 318 315 $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php', 'login') );319 $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php', 'login' ) ); 316 320 return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect ); 317 321 } 318 322 … … 328 332 * @param string $before Text to output before the link (defaults to <li>). 329 333 * @param string $after Text to output after the link (defaults to </li>). 330 334 * @param boolean $echo Default to echo and not return the link. 335 * @return mixed, string if $echo set to false 331 336 */ 332 337 function wp_register( $before = '<li>', $after = '</li>', $echo = true ) { 333 338 334 339 if ( ! is_user_logged_in() ) { 335 if ( get_option( 'users_can_register') )336 $link = $before . '<a href="' . site_url( 'wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;340 if ( get_option( 'users_can_register' ) ) 341 $link = $before . '<a href="' . site_url( 'wp-login.php?action=register', 'login' ) . '">' . __( 'Register' ) . '</a>' . $after; 337 342 else 338 343 $link = ''; 339 344 } else { 340 $link = $before . '<a href="' . admin_url() . '">' . __( 'Site Admin') . '</a>' . $after;345 $link = $before . '<a href="' . admin_url() . '">' . __( 'Site Admin' ) . '</a>' . $after; 341 346 } 342 347 343 348 if ( $echo ) 344 echo apply_filters( 'register', $link);349 echo apply_filters( 'register', $link ); 345 350 else 346 return apply_filters( 'register', $link);351 return apply_filters( 'register', $link ); 347 352 } 348 353 349 354 /** … … 357 362 * @uses do_action() Calls 'wp_meta' hook. 358 363 */ 359 364 function wp_meta() { 360 do_action( 'wp_meta');365 do_action( 'wp_meta' ); 361 366 } 362 367 363 368 /** … … 483 488 484 489 if ( 'display' == $filter ) { 485 490 if ( $url ) 486 $output = apply_filters( 'bloginfo_url', $output, $show);491 $output = apply_filters( 'bloginfo_url', $output, $show ); 487 492 else 488 $output = apply_filters( 'bloginfo', $output, $show);493 $output = apply_filters( 'bloginfo', $output, $show ); 489 494 } 490 495 491 496 return $output; … … 513 518 * @param string $seplocation Optional. Direction to display title, 'right'. 514 519 * @return string|null String on retrieve, null when displaying. 515 520 */ 516 function wp_title( $sep = '»', $display = true, $seplocation = '') {521 function wp_title( $sep = '»', $display = true, $seplocation = '' ) { 517 522 global $wpdb, $wp_locale; 518 523 519 524 $m = get_query_var('m'); … … 555 560 // If there's a month 556 561 if ( is_archive() && !empty($m) ) { 557 562 $my_year = substr($m, 0, 4); 558 $my_month = $wp_locale->get_month( substr($m, 4, 2));559 $my_day = intval( substr($m, 6, 2));563 $my_month = $wp_locale->get_month( substr( $m, 4, 2 ) ); 564 $my_day = intval( substr( $m, 6, 2 ) ); 560 565 $title = $my_year . ( $my_month ? $t_sep . $my_month : '' ) . ( $my_day ? $t_sep . $my_day : '' ); 561 566 } 562 567 563 568 // If there's a year 564 569 if ( is_archive() && !empty($year) ) { 565 570 $title = $year; 566 if ( !empty( $monthnum) )567 $title .= $t_sep . $wp_locale->get_month( $monthnum);568 if ( !empty( $day) )569 $title .= $t_sep . zeroise( $day, 2);571 if ( !empty( $monthnum ) ) 572 $title .= $t_sep . $wp_locale->get_month( $monthnum ); 573 if ( !empty( $day ) ) 574 $title .= $t_sep . zeroise( $day, 2 ); 570 575 } 571 576 572 577 // If it's a search 573 578 if ( is_search() ) { 574 579 /* translators: 1: separator, 2: search phrase */ 575 $title = sprintf(__( 'Search Results %1$s %2$s'), $t_sep, strip_tags($search));580 $title = sprintf(__( 'Search Results %1$s %2$s' ), $t_sep, strip_tags( $search ) ); 576 581 } 577 582 578 583 // If it's a 404 page … … 594 599 $title = $prefix . implode( " $sep ", $title_array ); 595 600 } 596 601 597 $title = apply_filters( 'wp_title', $title, $sep, $seplocation);602 $title = apply_filters( 'wp_title', $title, $sep, $seplocation ); 598 603 599 604 // Send it out 600 605 if ( $display ) … … 620 625 * @param bool $display Optional, default is true. Whether to display or retrieve title. 621 626 * @return string|null Title when retrieving, null when displaying or failure. 622 627 */ 623 function single_post_title( $prefix = '', $display = true) {628 function single_post_title( $prefix = '', $display = true ) { 624 629 $_post = get_queried_object(); 625 630 626 631 if ( !isset($_post->post_title) ) 627 632 return; 628 633 629 $title = apply_filters( 'single_post_title', $_post->post_title, $_post);634 $title = apply_filters( 'single_post_title', $_post->post_title, $_post ); 630 635 if ( $display ) 631 636 echo $prefix . $title; 632 637 else … … 650 655 return; 651 656 652 657 $post_type_obj = get_queried_object(); 653 $title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name );658 $title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name ); 654 659 655 660 if ( $display ) 656 661 echo $prefix . $title; … … 759 764 * @param bool $display Optional, default is true. Whether to display or retrieve title. 760 765 * @return string|null Title when retrieving, null when displaying or failure. 761 766 */ 762 function single_month_title( $prefix = '', $display = true ) {767 function single_month_title( $prefix = '', $display = true ) { 763 768 global $wp_locale; 764 769 765 770 $m = get_query_var('m'); 766 771 $year = get_query_var('year'); 767 772 $monthnum = get_query_var('monthnum'); 768 773 769 if ( !empty( $monthnum) && !empty($year) ) {774 if ( !empty( $monthnum ) && !empty( $year ) ) { 770 775 $my_year = $year; 771 $my_month = $wp_locale->get_month( $monthnum);772 } elseif ( !empty( $m) ) {773 $my_year = substr( $m, 0, 4);774 $my_month = $wp_locale->get_month( substr($m, 4, 2));776 $my_month = $wp_locale->get_month( $monthnum ); 777 } elseif ( !empty( $m ) ) { 778 $my_year = substr( $m, 0, 4 ); 779 $my_month = $wp_locale->get_month( substr( $m, 4, 2 ) ); 775 780 } 776 781 777 if ( empty( $my_month) )782 if ( empty( $my_month ) ) 778 783 return false; 779 784 780 785 $result = $prefix . $my_month . $prefix . $my_year; … … 817 822 * @param string $after Optional. 818 823 * @return string HTML link content for archive. 819 824 */ 820 function get_archives_link( $url, $text, $format = 'html', $before = '', $after = '') {821 $text = wptexturize( $text);822 $title_text = esc_attr( $text);823 $url = esc_url( $url);825 function get_archives_link( $url, $text, $format = 'html', $before = '', $after = '' ) { 826 $text = wptexturize( $text ); 827 $title_text = esc_attr( $text ); 828 $url = esc_url( $url ); 824 829 825 if ( 'link' == $format)830 if ( 'link' == $format ) 826 831 $link_html = "\t<link rel='archives' title='$title_text' href='$url' />\n"; 827 elseif ( 'option' == $format)832 elseif ( 'option' == $format ) 828 833 $link_html = "\t<option value='$url'>$before $text $after</option>\n"; 829 834 elseif ('html' == $format) 830 835 $link_html = "\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n"; … … 861 866 * @since 1.2.0 862 867 * 863 868 * @param string|array $args Optional. Override defaults. 869 * @return mixed, string if $echo set to false 864 870 */ 865 function wp_get_archives( $args = '') {871 function wp_get_archives( $args = '' ) { 866 872 global $wpdb, $wp_locale; 867 873 868 874 $defaults = array( … … 879 885 $type = 'monthly'; 880 886 881 887 if ( '' != $limit ) { 882 $limit = absint( $limit);888 $limit = absint( $limit ); 883 889 $limit = ' LIMIT '.$limit; 884 890 } 885 891 … … 1046 1052 * @param int $num Number of day. 1047 1053 * @return int Days since the start of the week. 1048 1054 */ 1049 function calendar_week_mod( $num) {1055 function calendar_week_mod( $num ) { 1050 1056 $base = 7; 1051 return ( $num - $base*floor($num/$base));1057 return ( $num - $base*floor( $num/$base ) ); 1052 1058 } 1053 1059 1054 1060 /** … … 1062 1068 * 1063 1069 * @param bool $initial Optional, default is true. Use initial calendar names. 1064 1070 * @param bool $echo Optional, default is true. Set to false for return. 1071 * @return mixed, string if $echo set to false 1065 1072 */ 1066 function get_calendar( $initial = true, $echo = true) {1073 function get_calendar( $initial = true, $echo = true ) { 1067 1074 global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; 1068 1075 1069 1076 $cache = array(); 1070 1077 $key = md5( $m . $monthnum . $year ); 1071 1078 if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) { 1072 if ( is_array( $cache) && isset( $cache[ $key] ) ) {1079 if ( is_array( $cache ) && isset( $cache[$key] ) ) { 1073 1080 if ( $echo ) { 1074 1081 echo apply_filters( 'get_calendar', $cache[$key] ); 1075 1082 return; … … 1079 1086 } 1080 1087 } 1081 1088 1082 if ( !is_array( $cache) )1089 if ( !is_array( $cache ) ) 1083 1090 $cache = array(); 1084 1091 1085 1092 // Quick check. If we have no posts at all, abort! … … 1096 1103 $w = ''.intval($_GET['w']); 1097 1104 1098 1105 // week_begins = 0 stands for Sunday 1099 $week_begins = intval( get_option('start_of_week'));1106 $week_begins = intval( get_option('start_of_week')); 1100 1107 1101 1108 // Let's figure out when we are 1102 if ( !empty($monthnum) && !empty( $year) ) {1103 $thismonth = ''.zeroise( intval($monthnum), 2);1104 $thisyear = ''.intval( $year);1105 } elseif ( !empty( $w) ) {1109 if ( !empty($monthnum) && !empty( $year ) ) { 1110 $thismonth = ''.zeroise( intval( $monthnum ), 2 ); 1111 $thisyear = ''.intval( $year ); 1112 } elseif ( !empty( $w ) ) { 1106 1113 // We need to get the month from MySQL 1107 $thisyear = ''.intval( substr($m, 0, 4));1114 $thisyear = ''.intval( substr( $m, 0, 4 ) ); 1108 1115 $d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's 1109 1116 $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')"); 1110 1117 } elseif ( !empty($m) ) { … … 1112 1119 if ( strlen($m) < 6 ) 1113 1120 $thismonth = '01'; 1114 1121 else 1115 $thismonth = ''.zeroise( intval(substr($m, 4, 2)), 2);1122 $thismonth = ''.zeroise( intval( substr( $m, 4, 2 ) ), 2 ); 1116 1123 } else { 1117 $thisyear = gmdate( 'Y', current_time('timestamp'));1118 $thismonth = gmdate( 'm', current_time('timestamp'));1124 $thisyear = gmdate( 'Y', current_time( 'timestamp' ) ); 1125 $thismonth = gmdate( 'm', current_time( 'timestamp' ) ); 1119 1126 } 1120 1127 1121 $unixmonth = mktime( 0, 0 , 0, $thismonth, 1, $thisyear);1122 $last_day = date( 't', $unixmonth);1128 $unixmonth = mktime( 0, 0 , 0, $thismonth, 1, $thisyear ); 1129 $last_day = date( 't', $unixmonth ); 1123 1130 1124 1131 // Get the next and previous month and year with at least one post 1125 1132 $previous = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year … … 1138 1145 /* translators: Calendar caption: 1: month name, 2: 4-digit year */ 1139 1146 $calendar_caption = _x('%1$s %2$s', 'calendar caption'); 1140 1147 $calendar_output = '<table id="wp-calendar"> 1141 <caption>' . sprintf( $calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '</caption>1148 <caption>' . sprintf( $calendar_caption, $wp_locale->get_month( $thismonth ), date( 'Y', $unixmonth ) ) . '</caption> 1142 1149 <thead> 1143 1150 <tr>'; 1144 1151 1145 1152 $myweek = array(); 1146 1153 1147 1154 for ( $wdcount=0; $wdcount<=6; $wdcount++ ) { 1148 $myweek[] = $wp_locale->get_weekday( ($wdcount+$week_begins)%7);1155 $myweek[] = $wp_locale->get_weekday( ( $wdcount+$week_begins ) %7 ); 1149 1156 } 1150 1157 1151 1158 foreach ( $myweek as $wd ) { 1152 $day_name = ( true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);1153 $wd = esc_attr( $wd);1159 $day_name = ( true == $initial ) ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd ); 1160 $wd = esc_attr( $wd ); 1154 1161 $calendar_output .= "\n\t\t<th scope=\"col\" title=\"$wd\">$day_name</th>"; 1155 1162 } 1156 1163 … … 1300 1307 } 1301 1308 $allowed .= '> '; 1302 1309 } 1303 return htmlentities( $allowed);1310 return htmlentities( $allowed ); 1304 1311 } 1305 1312 1306 1313 /***** Date/Time tags *****/ … … 1343 1350 $the_date .= $after; 1344 1351 $previousday = $currentday; 1345 1352 1346 $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after);1353 $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after ); 1347 1354 1348 1355 if ( $echo ) 1349 1356 echo $the_date; … … 1388 1395 * @param bool $echo Optional, default is display. Whether to echo the date or return it. 1389 1396 * @return string|null Null if displaying, string if retrieving. 1390 1397 */ 1391 function the_modified_date( $d = '', $before='', $after='', $echo = true) {1398 function the_modified_date( $d = '', $before='', $after='', $echo = true ) { 1392 1399 1393 $the_modified_date = $before . get_the_modified_date( $d) . $after;1400 $the_modified_date = $before . get_the_modified_date( $d ) . $after; 1394 1401 $the_modified_date = apply_filters('the_modified_date', $the_modified_date, $d, $before, $after); 1395 1402 1396 1403 if ( $echo ) … … 1408 1415 * @param string $d Optional. PHP date format. Defaults to the "date_format" option 1409 1416 * @return string 1410 1417 */ 1411 function get_the_modified_date( $d = '') {1418 function get_the_modified_date( $d = '' ) { 1412 1419 if ( '' == $d ) 1413 $the_time = get_post_modified_time( get_option('date_format'), null, null, true);1420 $the_time = get_post_modified_time( get_option('date_format'), null, null, true); 1414 1421 else 1415 $the_time = get_post_modified_time( $d, null, null, true);1416 return apply_filters( 'get_the_modified_date', $the_time, $d);1422 $the_time = get_post_modified_time( $d, null, null, true ); 1423 return apply_filters( 'get_the_modified_date', $the_time, $d ); 1417 1424 } 1418 1425 1419 1426 /** … … 1424 1431 * @param string $d Either 'G', 'U', or php date format. 1425 1432 */ 1426 1433 function the_time( $d = '' ) { 1427 echo apply_filters( 'the_time', get_the_time( $d ), $d);1434 echo apply_filters( 'the_time', get_the_time( $d ), $d ); 1428 1435 } 1429 1436 1430 1437 /** … … 1437 1444 * @return string 1438 1445 */ 1439 1446 function get_the_time( $d = '', $post = null ) { 1440 $post = get_post( $post);1447 $post = get_post( $post ); 1441 1448 1442 1449 if ( '' == $d ) 1443 $the_time = get_post_time( get_option('time_format'), false, $post, true);1450 $the_time = get_post_time( get_option( 'time_format' ), false, $post, true ); 1444 1451 else 1445 $the_time = get_post_time( $d, false, $post, true);1446 return apply_filters( 'get_the_time', $the_time, $d, $post);1452 $the_time = get_post_time( $d, false, $post, true ); 1453 return apply_filters( 'get_the_time', $the_time, $d, $post ); 1447 1454 } 1448 1455 1449 1456 /** … … 1458 1465 * @return string 1459 1466 */ 1460 1467 function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { // returns timestamp 1461 $post = get_post( $post);1468 $post = get_post( $post ); 1462 1469 1463 1470 if ( $gmt ) 1464 1471 $time = $post->post_date_gmt; 1465 1472 else 1466 1473 $time = $post->post_date; 1467 1474 1468 $time = mysql2date( $d, $time, $translate);1469 return apply_filters( 'get_post_time', $time, $d, $gmt);1475 $time = mysql2date( $d, $time, $translate ); 1476 return apply_filters( 'get_post_time', $time, $d, $gmt ); 1470 1477 } 1471 1478 1472 1479 /** … … 1476 1483 * 1477 1484 * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option. 1478 1485 */ 1479 function the_modified_time( $d = '') {1480 echo apply_filters('the_modified_time', get_the_modified_time( $d), $d);1486 function the_modified_time( $d = '' ) { 1487 echo apply_filters('the_modified_time', get_the_modified_time( $d ), $d ); 1481 1488 } 1482 1489 1483 1490 /** … … 1488 1495 * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option. 1489 1496 * @return string 1490 1497 */ 1491 function get_the_modified_time( $d = '') {1498 function get_the_modified_time( $d = '' ) { 1492 1499 if ( '' == $d ) 1493 $the_time = get_post_modified_time( get_option('time_format'), null, null, true);1500 $the_time = get_post_modified_time( get_option( 'time_format' ), null, null, true ); 1494 1501 else 1495 $the_time = get_post_modified_time( $d, null, null, true);1496 return apply_filters( 'get_the_modified_time', $the_time, $d);1502 $the_time = get_post_modified_time( $d, null, null, true ); 1503 return apply_filters( 'get_the_modified_time', $the_time, $d ); 1497 1504 } 1498 1505 1499 1506 /** … … 1508 1515 * @return string Returns timestamp 1509 1516 */ 1510 1517 function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1511 $post = get_post( $post);1518 $post = get_post( $post ); 1512 1519 1513 1520 if ( $gmt ) 1514 1521 $time = $post->post_modified_gmt; 1515 1522 else 1516 1523 $time = $post->post_modified; 1517 $time = mysql2date( $d, $time, $translate);1524 $time = mysql2date( $d, $time, $translate ); 1518 1525 1519 return apply_filters( 'get_post_modified_time', $time, $d, $gmt);1526 return apply_filters( 'get_post_modified_time', $time, $d, $gmt ); 1520 1527 } 1521 1528 1522 1529 /** … … 1529 1536 function the_weekday() { 1530 1537 global $wp_locale; 1531 1538 $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) ); 1532 $the_weekday = apply_filters( 'the_weekday', $the_weekday);1539 $the_weekday = apply_filters( 'the_weekday', $the_weekday ); 1533 1540 echo $the_weekday; 1534 1541 } 1535 1542 … … 1544 1551 * @param string $before Optional Output before the date. 1545 1552 * @param string $after Optional Output after the date. 1546 1553 */ 1547 function the_weekday_date( $before='',$after='') {1554 function the_weekday_date( $before='',$after='' ) { 1548 1555 global $wp_locale, $day, $previousweekday; 1549 1556 $the_weekday_date = ''; 1550 1557 if ( $currentday != $previousweekday ) { … … 1553 1560 $the_weekday_date .= $after; 1554 1561 $previousweekday = $currentday; 1555 1562 } 1556 $the_weekday_date = apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after);1563 $the_weekday_date = apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after ); 1557 1564 echo $the_weekday_date; 1558 1565 } 1559 1566 … … 1564 1571 * @uses do_action() Calls 'wp_head' hook. 1565 1572 */ 1566 1573 function wp_head() { 1567 do_action( 'wp_head');1574 do_action( 'wp_head' ); 1568 1575 } 1569 1576 1570 1577 /** … … 1574 1581 * @uses do_action() Calls 'wp_footer' hook. 1575 1582 */ 1576 1583 function wp_footer() { 1577 do_action( 'wp_footer');1584 do_action( 'wp_footer' ); 1578 1585 } 1579 1586 1580 1587 /** … … 1585 1592 * @param array $args Optional arguments. 1586 1593 */ 1587 1594 function feed_links( $args = array() ) { 1588 if ( !current_theme_supports( 'automatic-feed-links') )1595 if ( !current_theme_supports( 'automatic-feed-links' ) ) 1589 1596 return; 1590 1597 1591 1598 $defaults = array( … … 1842 1849 * 1843 1850 * @param string $doctype The type of html document (xhtml|html). 1844 1851 */ 1845 function language_attributes( $doctype = 'html') {1852 function language_attributes( $doctype = 'html' ) { 1846 1853 $attributes = array(); 1847 1854 $output = ''; 1848 1855 … … 1858 1865 } 1859 1866 1860 1867 $output = implode(' ', $attributes); 1861 $output = apply_filters( 'language_attributes', $output);1868 $output = apply_filters( 'language_attributes', $output ); 1862 1869 echo $output; 1863 1870 } 1864 1871 … … 1925 1932 ); 1926 1933 1927 1934 $args = wp_parse_args( $args, $defaults ); 1928 extract( $args, EXTR_SKIP);1935 extract( $args, EXTR_SKIP ); 1929 1936 1930 1937 // Who knows what else people pass in $args 1931 1938 $total = (int) $total; … … 2037 2044 * @since 2.3.0 2038 2045 * 2039 2046 * @param string $file file relative to wp-admin/ without its ".css" extension. 2047 * @return string admin css file url 2040 2048 */ 2041 2049 function wp_admin_css_uri( $file = 'wp-admin' ) { 2042 2050 if ( defined('WP_INSTALLING') ) { 2043 2051 $_file = "./$file.css"; 2044 2052 } else { 2045 $_file = admin_url( "$file.css");2053 $_file = admin_url( "$file.css" ); 2046 2054 } 2047 2055 $_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file ); 2048 2056 … … 2255 2263 * @since 2.8.0 2256 2264 * @access private 2257 2265 * 2258 * @param any$helper One of the values to compare2259 * @param any$current (true) The other value to compare if not just true2266 * @param mixed $helper One of the values to compare 2267 * @param mixed $current (true) The other value to compare if not just true 2260 2268 * @param bool $echo Whether to echo or just return the string 2261 2269 * @param string $type The type of checked|selected|disabled we are doing 2262 2270 * @return string html attribute or empty string