Changeset 45379 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 05/23/2019 12:37:56 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/general-template.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r45378 r45379 2683 2683 global $wp_locale; 2684 2684 2685 $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) ); 2685 $post = get_post(); 2686 2687 if ( ! $post ) { 2688 return; 2689 } 2690 2691 $the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) ); 2686 2692 2687 2693 /** … … 2703 2709 * @since 0.71 2704 2710 * 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 $previous day The day of the previous post in the loop.2711 * @global WP_Locale $wp_locale The WordPress date and time locale object. 2712 * @global string $currentday The day of the current post in the loop. 2713 * @global string $previousweekday The day of the previous post in the loop. 2708 2714 * 2709 2715 * @param string $before Optional. Output before the date. … … 2711 2717 */ 2712 2718 function the_weekday_date( $before = '', $after = '' ) { 2713 global $wp_locale, $currentday, $previousday; 2719 global $wp_locale, $currentday, $previousweekday; 2720 2721 $post = get_post(); 2722 2723 if ( ! $post ) { 2724 return; 2725 } 2714 2726 2715 2727 $the_weekday_date = ''; 2716 2728 2717 if ( is_new_day()) {2729 if ( $currentday !== $previousweekday ) { 2718 2730 $the_weekday_date .= $before; 2719 $the_weekday_date .= $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false) );2731 $the_weekday_date .= $wp_locale->get_weekday( get_post_time( 'w', false, $post ) ); 2720 2732 $the_weekday_date .= $after; 2721 $previous day= $currentday;2733 $previousweekday = $currentday; 2722 2734 } 2723 2735
Note: See TracChangeset
for help on using the changeset viewer.