Changeset 55284
- Timestamp:
- 02/07/2023 05:51:53 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r54958 r55284 1032 1032 * 1033 1033 * @since 1.5.0 1034 * 1035 * @param string $format Optional. PHP time format. Defaults to the 'time_format' option. 1036 * @param bool $gmt Optional. Whether to use the GMT date. Default false. 1037 * @param bool $translate Optional. Whether to translate the time (for use in feeds). 1038 * Default true. 1034 * @since 6.2.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. 1035 * 1036 * @param string $format Optional. PHP date format. Defaults to the 'time_format' option. 1037 * @param bool $gmt Optional. Whether to use the GMT date. Default false. 1038 * @param bool $translate Optional. Whether to translate the time (for use in feeds). 1039 * Default true. 1040 * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the date. 1041 * Default is 0, or the global comment. 1039 1042 * @return string The formatted time. 1040 1043 */ 1041 function get_comment_time( $format = '', $gmt = false, $translate = true ) { 1042 $comment = get_comment(); 1044 function get_comment_time( $format = '', $gmt = false, $translate = true, $comment_ID = 0 ) { 1045 $comment = get_comment( $comment_ID ); 1046 1047 if ( null === $comment ) { 1048 return ''; 1049 } 1043 1050 1044 1051 $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
Note: See TracChangeset
for help on using the changeset viewer.