Changeset 48918
- Timestamp:
- 08/31/2020 06:28:42 PM (4 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r48912 r48918 553 553 $comment = get_comment( $comment_ID ); 554 554 555 if ( ! is_string( $format ) || '' === $format ) { 556 $format = get_option( 'date_format' ); 557 } 558 559 $date = mysql2date( $format, $comment->comment_date ); 555 $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); 556 557 $date = mysql2date( $_format, $comment->comment_date ); 560 558 561 559 /** … … 1047 1045 $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date; 1048 1046 1049 if ( ! is_string( $format ) || '' === $format ) { 1050 $format = get_option( 'time_format' ); 1051 } 1052 1053 $date = mysql2date( $format, $comment_date, $translate ); 1047 $_format = ! empty( $format ) ? $format : get_option( 'time_format' ); 1048 1049 $date = mysql2date( $_format, $comment_date, $translate ); 1054 1050 1055 1051 /** -
trunk/src/wp-includes/general-template.php
r48912 r48918 2526 2526 } 2527 2527 2528 if ( ! is_string( $format ) || '' === $format ) { 2529 $format = get_option( 'date_format' ); 2530 } 2531 2532 $the_date = get_post_time( $format, false, $post, true ); 2528 $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); 2529 2530 $the_date = get_post_time( $_format, false, $post, true ); 2533 2531 2534 2532 /** … … 2596 2594 // For backward compatibility, failures go through the filter below. 2597 2595 $the_time = false; 2598 } elseif ( empty( $format ) ) {2599 $the_time = get_post_modified_time( get_option( 'date_format' ), false, $post, true );2600 2596 } else { 2601 $the_time = get_post_modified_time( $format, false, $post, true ); 2597 $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); 2598 2599 $the_time = get_post_modified_time( $_format, false, $post, true ); 2602 2600 } 2603 2601 … … 2655 2653 } 2656 2654 2657 if ( ! is_string( $format ) || '' === $format ) { 2658 $format = get_option( 'time_format' ); 2659 } 2660 2661 $the_time = get_post_time( $format, false, $post, true ); 2655 $_format = ! empty( $format ) ? $format : get_option( 'time_format' ); 2656 2657 $the_time = get_post_time( $_format, false, $post, true ); 2662 2658 2663 2659 /** … … 2844 2840 // For backward compatibility, failures go through the filter below. 2845 2841 $the_time = false; 2846 } elseif ( empty( $format ) ) {2847 $the_time = get_post_modified_time( get_option( 'time_format' ), false, $post, true );2848 2842 } else { 2849 $the_time = get_post_modified_time( $format, false, $post, true ); 2843 $_format = ! empty( $format ) ? $format : get_option( 'time_format' ); 2844 2845 $the_time = get_post_modified_time( $_format, false, $post, true ); 2850 2846 } 2851 2847
Note: See TracChangeset
for help on using the changeset viewer.