Make WordPress Core


Ignore:
Timestamp:
05/29/2022 03:33:12 PM (21 months ago)
Author:
SergeyBiryukov
Message:

Docs: Explicitly declare some globals for clarity.

This aims to improve developer experience by making it clear that these variables are defined elsewhere.

Props ravipatel, davidbaumwald, hellofromTonya, costdev, SergeyBiryukov.
Fixes #51439.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-comment.php

    r51080 r53450  
    1111    die( '-1' );
    1212}
     13
     14/**
     15 * @global WP_Comment $comment Global comment object.
     16 */
     17global $comment;
    1318?>
    1419<form name="post" action="comment.php" method="post" id="post">
     
    140145<fieldset id='timestampdiv' class='hide-if-js'>
    141146<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
    142 <?php touch_time( ( 'editcomment' === $action ), 0 ); ?>
     147<?php
     148/**
     149 * @global string $action
     150 */
     151global $action;
     152
     153touch_time( ( 'editcomment' === $action ), 0 );
     154?>
    143155</fieldset>
    144156</div>
Note: See TracChangeset for help on using the changeset viewer.