Edit File by line
/home/barbar84/www/wp-admin
File: edit-form-comment.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Edit comment form for inclusion in another file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
// Don't load directly.
[8] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[9] Fix | Delete
die( '-1' );
[10] Fix | Delete
}
[11] Fix | Delete
?>
[12] Fix | Delete
<form name="post" action="comment.php" method="post" id="post">
[13] Fix | Delete
<?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?>
[14] Fix | Delete
<div class="wrap">
[15] Fix | Delete
<h1><?php _e( 'Edit Comment' ); ?></h1>
[16] Fix | Delete
[17] Fix | Delete
<div id="poststuff">
[18] Fix | Delete
<input type="hidden" name="action" value="editedcomment" />
[19] Fix | Delete
<input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
[20] Fix | Delete
<input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
[21] Fix | Delete
[22] Fix | Delete
<div id="post-body" class="metabox-holder columns-2">
[23] Fix | Delete
<div id="post-body-content" class="edit-form-section edit-comment-section">
[24] Fix | Delete
<?php
[25] Fix | Delete
if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ID > 0 ) :
[26] Fix | Delete
$comment_link = get_comment_link( $comment );
[27] Fix | Delete
?>
[28] Fix | Delete
<div class="inside">
[29] Fix | Delete
<div id="comment-link-box">
[30] Fix | Delete
<strong><?php _ex( 'Permalink:', 'comment' ); ?></strong>
[31] Fix | Delete
<span id="sample-permalink">
[32] Fix | Delete
<a href="<?php echo esc_url( $comment_link ); ?>">
[33] Fix | Delete
<?php echo esc_html( $comment_link ); ?>
[34] Fix | Delete
</a>
[35] Fix | Delete
</span>
[36] Fix | Delete
</div>
[37] Fix | Delete
</div>
[38] Fix | Delete
<?php endif; ?>
[39] Fix | Delete
<div id="namediv" class="stuffbox">
[40] Fix | Delete
<div class="inside">
[41] Fix | Delete
<h2 class="edit-comment-author"><?php _e( 'Author' ); ?></h2>
[42] Fix | Delete
<fieldset>
[43] Fix | Delete
<legend class="screen-reader-text"><?php _e( 'Comment Author' ); ?></legend>
[44] Fix | Delete
<table class="form-table editcomment" role="presentation">
[45] Fix | Delete
<tbody>
[46] Fix | Delete
<tr>
[47] Fix | Delete
<td class="first"><label for="name"><?php _e( 'Name' ); ?></label></td>
[48] Fix | Delete
<td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>
[49] Fix | Delete
</tr>
[50] Fix | Delete
<tr>
[51] Fix | Delete
<td class="first"><label for="email"><?php _e( 'Email' ); ?></label></td>
[52] Fix | Delete
<td>
[53] Fix | Delete
<input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" />
[54] Fix | Delete
</td>
[55] Fix | Delete
</tr>
[56] Fix | Delete
<tr>
[57] Fix | Delete
<td class="first"><label for="newcomment_author_url"><?php _e( 'URL' ); ?></label></td>
[58] Fix | Delete
<td>
[59] Fix | Delete
<input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr( $comment->comment_author_url ); ?>" />
[60] Fix | Delete
</td>
[61] Fix | Delete
</tr>
[62] Fix | Delete
</tbody>
[63] Fix | Delete
</table>
[64] Fix | Delete
</fieldset>
[65] Fix | Delete
</div>
[66] Fix | Delete
</div>
[67] Fix | Delete
[68] Fix | Delete
<div id="postdiv" class="postarea">
[69] Fix | Delete
<?php
[70] Fix | Delete
echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>';
[71] Fix | Delete
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
[72] Fix | Delete
wp_editor(
[73] Fix | Delete
$comment->comment_content,
[74] Fix | Delete
'content',
[75] Fix | Delete
array(
[76] Fix | Delete
'media_buttons' => false,
[77] Fix | Delete
'tinymce' => false,
[78] Fix | Delete
'quicktags' => $quicktags_settings,
[79] Fix | Delete
)
[80] Fix | Delete
);
[81] Fix | Delete
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
[82] Fix | Delete
?>
[83] Fix | Delete
</div>
[84] Fix | Delete
</div><!-- /post-body-content -->
[85] Fix | Delete
[86] Fix | Delete
<div id="postbox-container-1" class="postbox-container">
[87] Fix | Delete
<div id="submitdiv" class="stuffbox" >
[88] Fix | Delete
<h2><?php _e( 'Save' ); ?></h2>
[89] Fix | Delete
<div class="inside">
[90] Fix | Delete
<div class="submitbox" id="submitcomment">
[91] Fix | Delete
<div id="minor-publishing">
[92] Fix | Delete
[93] Fix | Delete
<div id="misc-publishing-actions">
[94] Fix | Delete
[95] Fix | Delete
<div class="misc-pub-section misc-pub-comment-status" id="comment-status">
[96] Fix | Delete
<?php _e( 'Status:' ); ?> <span id="comment-status-display">
[97] Fix | Delete
<?php
[98] Fix | Delete
switch ( $comment->comment_approved ) {
[99] Fix | Delete
case '1':
[100] Fix | Delete
_e( 'Approved' );
[101] Fix | Delete
break;
[102] Fix | Delete
case '0':
[103] Fix | Delete
_e( 'Pending' );
[104] Fix | Delete
break;
[105] Fix | Delete
case 'spam':
[106] Fix | Delete
_e( 'Spam' );
[107] Fix | Delete
break;
[108] Fix | Delete
}
[109] Fix | Delete
?>
[110] Fix | Delete
</span>
[111] Fix | Delete
[112] Fix | Delete
<fieldset id="comment-status-radio">
[113] Fix | Delete
<legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
[114] Fix | Delete
<label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br />
[115] Fix | Delete
<label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br />
[116] Fix | Delete
<label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label>
[117] Fix | Delete
</fieldset>
[118] Fix | Delete
</div><!-- .misc-pub-section -->
[119] Fix | Delete
[120] Fix | Delete
<div class="misc-pub-section curtime misc-pub-curtime">
[121] Fix | Delete
<?php
[122] Fix | Delete
$submitted = sprintf(
[123] Fix | Delete
/* translators: 1: Comment date, 2: Comment time. */
[124] Fix | Delete
__( '%1$s at %2$s' ),
[125] Fix | Delete
/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
[126] Fix | Delete
date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $comment->comment_date ) ),
[127] Fix | Delete
/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
[128] Fix | Delete
date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $comment->comment_date ) )
[129] Fix | Delete
);
[130] Fix | Delete
?>
[131] Fix | Delete
<span id="timestamp">
[132] Fix | Delete
<?php
[133] Fix | Delete
/* translators: %s: Comment date. */
[134] Fix | Delete
printf( __( 'Submitted on: %s' ), '<b>' . $submitted . '</b>' );
[135] Fix | Delete
?>
[136] Fix | Delete
</span>
[137] Fix | Delete
<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>
[138] Fix | Delete
<fieldset id='timestampdiv' class='hide-if-js'>
[139] Fix | Delete
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
[140] Fix | Delete
<?php touch_time( ( 'editcomment' === $action ), 0 ); ?>
[141] Fix | Delete
</fieldset>
[142] Fix | Delete
</div>
[143] Fix | Delete
[144] Fix | Delete
<?php
[145] Fix | Delete
$post_id = $comment->comment_post_ID;
[146] Fix | Delete
if ( current_user_can( 'edit_post', $post_id ) ) {
[147] Fix | Delete
$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
[148] Fix | Delete
$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
[149] Fix | Delete
} else {
[150] Fix | Delete
$post_link = esc_html( get_the_title( $post_id ) );
[151] Fix | Delete
}
[152] Fix | Delete
?>
[153] Fix | Delete
[154] Fix | Delete
<div class="misc-pub-section misc-pub-response-to">
[155] Fix | Delete
<?php
[156] Fix | Delete
printf(
[157] Fix | Delete
/* translators: %s: Post link. */
[158] Fix | Delete
__( 'In response to: %s' ),
[159] Fix | Delete
'<b>' . $post_link . '</b>'
[160] Fix | Delete
);
[161] Fix | Delete
?>
[162] Fix | Delete
</div>
[163] Fix | Delete
[164] Fix | Delete
<?php
[165] Fix | Delete
if ( $comment->comment_parent ) :
[166] Fix | Delete
$parent = get_comment( $comment->comment_parent );
[167] Fix | Delete
if ( $parent ) :
[168] Fix | Delete
$parent_link = esc_url( get_comment_link( $parent ) );
[169] Fix | Delete
$name = get_comment_author( $parent );
[170] Fix | Delete
?>
[171] Fix | Delete
<div class="misc-pub-section misc-pub-reply-to">
[172] Fix | Delete
<?php
[173] Fix | Delete
printf(
[174] Fix | Delete
/* translators: %s: Comment link. */
[175] Fix | Delete
__( 'In reply to: %s' ),
[176] Fix | Delete
'<b><a href="' . $parent_link . '">' . $name . '</a></b>'
[177] Fix | Delete
);
[178] Fix | Delete
?>
[179] Fix | Delete
</div>
[180] Fix | Delete
<?php
[181] Fix | Delete
endif;
[182] Fix | Delete
endif;
[183] Fix | Delete
?>
[184] Fix | Delete
[185] Fix | Delete
<?php
[186] Fix | Delete
/**
[187] Fix | Delete
* Filters miscellaneous actions for the edit comment form sidebar.
[188] Fix | Delete
*
[189] Fix | Delete
* @since 4.3.0
[190] Fix | Delete
*
[191] Fix | Delete
* @param string $html Output HTML to display miscellaneous action.
[192] Fix | Delete
* @param WP_Comment $comment Current comment object.
[193] Fix | Delete
*/
[194] Fix | Delete
echo apply_filters( 'edit_comment_misc_actions', '', $comment );
[195] Fix | Delete
?>
[196] Fix | Delete
[197] Fix | Delete
</div> <!-- misc actions -->
[198] Fix | Delete
<div class="clear"></div>
[199] Fix | Delete
</div>
[200] Fix | Delete
[201] Fix | Delete
<div id="major-publishing-actions">
[202] Fix | Delete
<div id="delete-action">
[203] Fix | Delete
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url( 'comment.php?action=' . ( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . urlencode( wp_get_referer() ), 'delete-comment_' . $comment->comment_ID ) . "'>" . ( ! EMPTY_TRASH_DAYS ? __( 'Delete Permanently' ) : __( 'Move to Trash' ) ) . "</a>\n"; ?>
[204] Fix | Delete
</div>
[205] Fix | Delete
<div id="publishing-action">
[206] Fix | Delete
<?php submit_button( __( 'Update' ), 'primary large', 'save', false ); ?>
[207] Fix | Delete
</div>
[208] Fix | Delete
<div class="clear"></div>
[209] Fix | Delete
</div>
[210] Fix | Delete
</div>
[211] Fix | Delete
</div>
[212] Fix | Delete
</div><!-- /submitdiv -->
[213] Fix | Delete
</div>
[214] Fix | Delete
[215] Fix | Delete
<div id="postbox-container-2" class="postbox-container">
[216] Fix | Delete
<?php
[217] Fix | Delete
/** This action is documented in wp-admin/includes/meta-boxes.php */
[218] Fix | Delete
do_action( 'add_meta_boxes', 'comment', $comment );
[219] Fix | Delete
[220] Fix | Delete
/**
[221] Fix | Delete
* Fires when comment-specific meta boxes are added.
[222] Fix | Delete
*
[223] Fix | Delete
* @since 3.0.0
[224] Fix | Delete
*
[225] Fix | Delete
* @param WP_Comment $comment Comment object.
[226] Fix | Delete
*/
[227] Fix | Delete
do_action( 'add_meta_boxes_comment', $comment );
[228] Fix | Delete
[229] Fix | Delete
do_meta_boxes( null, 'normal', $comment );
[230] Fix | Delete
[231] Fix | Delete
$referer = wp_get_referer();
[232] Fix | Delete
?>
[233] Fix | Delete
</div>
[234] Fix | Delete
[235] Fix | Delete
<input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
[236] Fix | Delete
<input type="hidden" name="p" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
[237] Fix | Delete
<input name="referredby" type="hidden" id="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
[238] Fix | Delete
<?php wp_original_referer_field( true, 'previous' ); ?>
[239] Fix | Delete
<input type="hidden" name="noredir" value="1" />
[240] Fix | Delete
[241] Fix | Delete
</div><!-- /post-body -->
[242] Fix | Delete
</div>
[243] Fix | Delete
</div>
[244] Fix | Delete
</form>
[245] Fix | Delete
[246] Fix | Delete
<?php if ( ! wp_is_mobile() ) : ?>
[247] Fix | Delete
<script type="text/javascript">
[248] Fix | Delete
try{document.post.name.focus();}catch(e){}
[249] Fix | Delete
</script>
[250] Fix | Delete
<?php
[251] Fix | Delete
endif;
[252] Fix | Delete
[253] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function