wp/wp-admin/edit-form-comment.php
changeset 21 48c4eec2b7e6
parent 18 be944660c56a
child 22 8c2e4d02f4ef
--- a/wp/wp-admin/edit-form-comment.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/edit-form-comment.php	Fri Sep 05 18:40:08 2025 +0200
@@ -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 ); ?>
@@ -42,7 +47,12 @@
 <div class="inside">
 <h2 class="edit-comment-author"><?php _e( 'Author' ); ?></h2>
 <fieldset>
-<legend class="screen-reader-text"><?php _e( 'Comment Author' ); ?></legend>
+<legend class="screen-reader-text">
+	<?php
+	/* translators: Hidden accessibility text. */
+	_e( 'Comment Author' );
+	?>
+</legend>
 <table class="form-table editcomment" role="presentation">
 <tbody>
 <tr>
@@ -68,8 +78,13 @@
 </div>
 
 <div id="postdiv" class="postarea">
+<label for="content" class="screen-reader-text">
+	<?php
+	/* translators: Hidden accessibility text. */
+	_e( 'Comment' );
+	?>
+</label>
 <?php
-	echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>';
 	$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
 	wp_editor(
 		$comment->comment_content,
@@ -112,7 +127,12 @@
 </span>
 
 <fieldset id="comment-status-radio">
-<legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
+<legend class="screen-reader-text">
+	<?php
+	/* translators: Hidden accessibility text. */
+	_e( 'Comment status' );
+	?>
+</legend>
 <label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
 <label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
 <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
@@ -136,10 +156,27 @@
 printf( __( 'Submitted on: %s' ), '<b>' . $submitted . '</b>' );
 ?>
 </span>
-<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>
+<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
+	/* translators: Hidden accessibility text. */
+	_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 ); ?>
+<legend class="screen-reader-text">
+	<?php
+	/* translators: Hidden accessibility text. */
+	_e( 'Date and time' );
+	?>
+</legend>
+<?php
+/**
+ * @global string $action
+ */
+global $action;
+
+touch_time( ( 'editcomment' === $action ), 0 );
+?>
 </fieldset>
 </div>