Make WordPress Core

Changeset 60779


Ignore:
Timestamp:
09/17/2025 10:44:00 PM (2 months ago)
Author:
peterwilsoncc
Message:

Coding Standards: Rename arguments in comment_type().

Rename the arguments in comment_type() to use underscore separators per coding standards and to add vowels for clarity.

"Pingback" and "Trackback" in the variable names are left unchanged as they are concatenated for display to site owners.

See #63168.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r60408 r60779  
    11811181 * @since 0.71
    11821182 *
    1183  * @param string|false $commenttxt   Optional. String to display for comment type. Default false.
    1184  * @param string|false $trackbacktxt Optional. String to display for trackback type. Default false.
    1185  * @param string|false $pingbacktxt  Optional. String to display for pingback type. Default false.
    1186  */
    1187 function comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false ) {
    1188     if ( false === $commenttxt ) {
    1189         $commenttxt = _x( 'Comment', 'noun' );
    1190     }
    1191     if ( false === $trackbacktxt ) {
    1192         $trackbacktxt = __( 'Trackback' );
    1193     }
    1194     if ( false === $pingbacktxt ) {
    1195         $pingbacktxt = __( 'Pingback' );
     1183 * @param string|false $comment_text   Optional. String to display for comment type. Default false.
     1184 * @param string|false $trackback_text Optional. String to display for trackback type. Default false.
     1185 * @param string|false $pingback_text  Optional. String to display for pingback type. Default false.
     1186 */
     1187function comment_type( $comment_text = false, $trackback_text = false, $pingback_text = false ) {
     1188    if ( false === $comment_text ) {
     1189        $comment_text = _x( 'Comment', 'noun' );
     1190    }
     1191    if ( false === $trackback_text ) {
     1192        $trackback_text = __( 'Trackback' );
     1193    }
     1194    if ( false === $pingback_text ) {
     1195        $pingback_text = __( 'Pingback' );
    11961196    }
    11971197    $type = get_comment_type();
    11981198    switch ( $type ) {
    11991199        case 'trackback':
    1200             echo $trackbacktxt;
     1200            echo $trackback_text;
    12011201            break;
    12021202        case 'pingback':
    1203             echo $pingbacktxt;
     1203            echo $pingback_text;
    12041204            break;
    12051205        default:
    1206             echo $commenttxt;
     1206            echo $comment_text;
    12071207    }
    12081208}
Note: See TracChangeset for help on using the changeset viewer.