mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
Coding Standards: Rename $d parameter in various date/time functions to $format for clarity.
See #49222. git-svn-id: https://develop.svn.wordpress.org/trunk@47287 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -543,17 +543,17 @@ function get_comment_class( $class = '', $comment_id = null, $post_id = null ) {
|
||||
* @since 1.5.0
|
||||
* @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
|
||||
*
|
||||
* @param string $d Optional. The format of the date. Default user's setting.
|
||||
* @param string $format Optional. The format of the date. Default user's setting.
|
||||
* @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the date.
|
||||
* Default current comment.
|
||||
* @return string The comment's date.
|
||||
*/
|
||||
function get_comment_date( $d = '', $comment_ID = 0 ) {
|
||||
function get_comment_date( $format = '', $comment_ID = 0 ) {
|
||||
$comment = get_comment( $comment_ID );
|
||||
if ( '' == $d ) {
|
||||
if ( '' == $format ) {
|
||||
$date = mysql2date( get_option( 'date_format' ), $comment->comment_date );
|
||||
} else {
|
||||
$date = mysql2date( $d, $comment->comment_date );
|
||||
$date = mysql2date( $format, $comment->comment_date );
|
||||
}
|
||||
/**
|
||||
* Filters the returned comment date.
|
||||
@@ -561,10 +561,10 @@ function get_comment_date( $d = '', $comment_ID = 0 ) {
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @param string|int $date Formatted date string or Unix timestamp.
|
||||
* @param string $d The format of the date.
|
||||
* @param string $format The format of the date.
|
||||
* @param WP_Comment $comment The comment object.
|
||||
*/
|
||||
return apply_filters( 'get_comment_date', $date, $d, $comment );
|
||||
return apply_filters( 'get_comment_date', $date, $format, $comment );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -573,12 +573,12 @@ function get_comment_date( $d = '', $comment_ID = 0 ) {
|
||||
* @since 0.71
|
||||
* @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
|
||||
*
|
||||
* @param string $d Optional. The format of the date. Default user's settings.
|
||||
* @param string $format Optional. The format of the date. Default user's settings.
|
||||
* @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date.
|
||||
* Default current comment.
|
||||
*/
|
||||
function comment_date( $d = '', $comment_ID = 0 ) {
|
||||
echo get_comment_date( $d, $comment_ID );
|
||||
function comment_date( $format = '', $comment_ID = 0 ) {
|
||||
echo get_comment_date( $format, $comment_ID );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1031,20 +1031,20 @@ function comment_text( $comment_ID = 0, $args = array() ) {
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @param string $d Optional. The format of the time. Default user's settings.
|
||||
* @param string $format Optional. The format of the time. Default user's settings.
|
||||
* @param bool $gmt Optional. Whether to use the GMT date. Default false.
|
||||
* @param bool $translate Optional. Whether to translate the time (for use in feeds).
|
||||
* Default true.
|
||||
* @return string The formatted time.
|
||||
*/
|
||||
function get_comment_time( $d = '', $gmt = false, $translate = true ) {
|
||||
function get_comment_time( $format = '', $gmt = false, $translate = true ) {
|
||||
$comment = get_comment();
|
||||
|
||||
$comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
|
||||
if ( '' == $d ) {
|
||||
if ( '' == $format ) {
|
||||
$date = mysql2date( get_option( 'time_format' ), $comment_date, $translate );
|
||||
} else {
|
||||
$date = mysql2date( $d, $comment_date, $translate );
|
||||
$date = mysql2date( $format, $comment_date, $translate );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1053,12 +1053,12 @@ function get_comment_time( $d = '', $gmt = false, $translate = true ) {
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @param string|int $date The comment time, formatted as a date string or Unix timestamp.
|
||||
* @param string $d Date format.
|
||||
* @param string $format Date format.
|
||||
* @param bool $gmt Whether the GMT date is in use.
|
||||
* @param bool $translate Whether the time is translated.
|
||||
* @param WP_Comment $comment The comment object.
|
||||
*/
|
||||
return apply_filters( 'get_comment_time', $date, $d, $gmt, $translate, $comment );
|
||||
return apply_filters( 'get_comment_time', $date, $format, $gmt, $translate, $comment );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1066,10 +1066,10 @@ function get_comment_time( $d = '', $gmt = false, $translate = true ) {
|
||||
*
|
||||
* @since 0.71
|
||||
*
|
||||
* @param string $d Optional. The format of the time. Default user's settings.
|
||||
* @param string $format Optional. The format of the time. Default user's settings.
|
||||
*/
|
||||
function comment_time( $d = '' ) {
|
||||
echo get_comment_time( $d );
|
||||
function comment_time( $format = '' ) {
|
||||
echo get_comment_time( $format );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user