Changeset 45378 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 05/22/2019 09:57:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r45377 r45378 2341 2341 global $currentday, $previousday; 2342 2342 2343 $the_date = ''; 2344 2343 2345 if ( is_new_day() ) { 2344 2346 $the_date = $before . get_the_date( $d ) . $after; 2345 2347 $previousday = $currentday; 2346 2347 /** 2348 * Filters the date a post was published for display.2349 *2350 * @since 0.712351 *2352 * @param string $the_date The formatted date string.2353 * @param string $d PHP date format. Defaults to 'date_format' option2354 * if not specified.2355 * @param string $before HTML output before the date.2356 * @param string $after HTML output afterthe date.2357 */2358 $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after );2359 2360 if ( $echo ) { 2361 echo $the_date;2362 } else {2363 return $the_date;2364 }2348 } 2349 2350 /** 2351 * Filters the date a post was published for display. 2352 * 2353 * @since 0.71 2354 * 2355 * @param string $the_date The formatted date string. 2356 * @param string $d PHP date format. Defaults to 'date_format' option 2357 * if not specified. 2358 * @param string $before HTML output before the date. 2359 * @param string $after HTML output after the date. 2360 */ 2361 $the_date = apply_filters( 'the_date', $the_date, $d, $before, $after ); 2362 2363 if ( $echo ) { 2364 echo $the_date; 2365 } else { 2366 return $the_date; 2365 2367 } 2366 2368 } … … 2701 2703 * @since 0.71 2702 2704 * 2703 * @global WP_Locale $wp_locale 2704 * @global string $currentday 2705 * @global string $previous weekday The day of the previous post in the loop.2705 * @global WP_Locale $wp_locale The WordPress date and time locale object. 2706 * @global string $currentday The day of the current post in the loop. 2707 * @global string $previousday The day of the previous post in the loop. 2706 2708 * 2707 2709 * @param string $before Optional. Output before the date. … … 2709 2711 */ 2710 2712 function the_weekday_date( $before = '', $after = '' ) { 2711 global $wp_locale, $currentday, $previousweekday; 2713 global $wp_locale, $currentday, $previousday; 2714 2712 2715 $the_weekday_date = ''; 2713 if ( $currentday != $previousweekday ) { 2716 2717 if ( is_new_day() ) { 2714 2718 $the_weekday_date .= $before; 2715 2719 $the_weekday_date .= $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) ); 2716 2720 $the_weekday_date .= $after; 2717 $previous weekday= $currentday;2721 $previousday = $currentday; 2718 2722 } 2719 2723 … … 2727 2731 * @param string $after The HTML to output after the date. 2728 2732 */ 2729 $the_weekday_date = apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after ); 2730 echo $the_weekday_date; 2733 echo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after ); 2731 2734 } 2732 2735
Note: See TracChangeset
for help on using the changeset viewer.