Changeset 47287 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 02/14/2020 12:05:43 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r47276 r47287 544 544 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. 545 545 * 546 * @param string $ dOptional. The format of the date. Default user's setting.546 * @param string $format Optional. The format of the date. Default user's setting. 547 547 * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the date. 548 548 * Default current comment. 549 549 * @return string The comment's date. 550 550 */ 551 function get_comment_date( $ d= '', $comment_ID = 0 ) {551 function get_comment_date( $format = '', $comment_ID = 0 ) { 552 552 $comment = get_comment( $comment_ID ); 553 if ( '' == $ d) {553 if ( '' == $format ) { 554 554 $date = mysql2date( get_option( 'date_format' ), $comment->comment_date ); 555 555 } else { 556 $date = mysql2date( $ d, $comment->comment_date );556 $date = mysql2date( $format, $comment->comment_date ); 557 557 } 558 558 /** … … 562 562 * 563 563 * @param string|int $date Formatted date string or Unix timestamp. 564 * @param string $ dThe format of the date.564 * @param string $format The format of the date. 565 565 * @param WP_Comment $comment The comment object. 566 566 */ 567 return apply_filters( 'get_comment_date', $date, $ d, $comment );567 return apply_filters( 'get_comment_date', $date, $format, $comment ); 568 568 } 569 569 … … 574 574 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. 575 575 * 576 * @param string $ dOptional. The format of the date. Default user's settings.576 * @param string $format Optional. The format of the date. Default user's settings. 577 577 * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date. 578 578 * Default current comment. 579 579 */ 580 function comment_date( $ d= '', $comment_ID = 0 ) {581 echo get_comment_date( $ d, $comment_ID );580 function comment_date( $format = '', $comment_ID = 0 ) { 581 echo get_comment_date( $format, $comment_ID ); 582 582 } 583 583 … … 1032 1032 * @since 1.5.0 1033 1033 * 1034 * @param string $ dOptional. The format of the time. Default user's settings.1034 * @param string $format Optional. The format of the time. Default user's settings. 1035 1035 * @param bool $gmt Optional. Whether to use the GMT date. Default false. 1036 1036 * @param bool $translate Optional. Whether to translate the time (for use in feeds). … … 1038 1038 * @return string The formatted time. 1039 1039 */ 1040 function get_comment_time( $ d= '', $gmt = false, $translate = true ) {1040 function get_comment_time( $format = '', $gmt = false, $translate = true ) { 1041 1041 $comment = get_comment(); 1042 1042 1043 1043 $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date; 1044 if ( '' == $ d) {1044 if ( '' == $format ) { 1045 1045 $date = mysql2date( get_option( 'time_format' ), $comment_date, $translate ); 1046 1046 } else { 1047 $date = mysql2date( $ d, $comment_date, $translate );1047 $date = mysql2date( $format, $comment_date, $translate ); 1048 1048 } 1049 1049 … … 1054 1054 * 1055 1055 * @param string|int $date The comment time, formatted as a date string or Unix timestamp. 1056 * @param string $ dDate format.1056 * @param string $format Date format. 1057 1057 * @param bool $gmt Whether the GMT date is in use. 1058 1058 * @param bool $translate Whether the time is translated. 1059 1059 * @param WP_Comment $comment The comment object. 1060 1060 */ 1061 return apply_filters( 'get_comment_time', $date, $ d, $gmt, $translate, $comment );1061 return apply_filters( 'get_comment_time', $date, $format, $gmt, $translate, $comment ); 1062 1062 } 1063 1063 … … 1067 1067 * @since 0.71 1068 1068 * 1069 * @param string $ dOptional. The format of the time. Default user's settings.1070 */ 1071 function comment_time( $ d= '' ) {1072 echo get_comment_time( $ d);1069 * @param string $format Optional. The format of the time. Default user's settings. 1070 */ 1071 function comment_time( $format = '' ) { 1072 echo get_comment_time( $format ); 1073 1073 } 1074 1074
Note: See TracChangeset
for help on using the changeset viewer.