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.

git-svn-id: https://develop.svn.wordpress.org/trunk@53450 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-05-29 15:33:12 +00:00
parent 4e83085806
commit a53b828af9
5 changed files with 37 additions and 3 deletions
+13 -1
View File
@@ -10,6 +10,11 @@
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @global WP_Comment $comment Global comment object.
*/
global $comment;
?>
<form name="post" action="comment.php" method="post" id="post">
<?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?>
@@ -139,7 +144,14 @@ printf( __( 'Submitted on: %s' ), '<b>' . $submitted . '</b>' );
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
<fieldset id='timestampdiv' class='hide-if-js'>
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
<?php touch_time( ( 'editcomment' === $action ), 0 ); ?>
<?php
/**
* @global string $action
*/
global $action;
touch_time( ( 'editcomment' === $action ), 0 );
?>
</fieldset>
</div>