wp_comment_reply() – Outputs the in-line comment reply-to form in the Comments list table.

You appear to be a bot. Output may be restricted

Description

Outputs the in-line comment reply-to form in the Comments list table.

Usage

wp_comment_reply( $position, $checkbox, $mode, $table_row );

Parameters

$position
( int ) optional default: 1 – Optional. The value of the 'position' input field. Default 1.
$checkbox
( bool ) optional – Optional. The value of the 'checkbox' input field. Default false.
$mode
( string ) optional default: single – Optional. If set to 'single', will use WP_Post_Comments_List_Table, otherwise WP_Comments_List_Table. Default 'single'.
$table_row
( bool ) optional default: 1 – Optional. Whether to use a table instead of a div element. Default true.

Returns

void

Source

File name: wordpress/wp-admin/includes/template.php


Lines:

1 to 100 of 131
function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $table_row = true ) {
  global $wp_list_table;
  
/**
 * Filters the in-line comment reply-to form output in the Comments
 * list table.
 *
 * Returning a non-empty value here will short-circuit display
 * of the in-line comment-reply form in the Comments list table,
 * echoing the returned value instead.
 *
 * @since 2.7.0
 *
 * @see wp_comment_reply()
 *
 * @param string $content The reply-to form content.
 * @param array  $args    An array of default args.
 */
  $content = apply_filters(
    'wp_comment_reply',
    '',
    array(
      'position' => $position,
      'checkbox' => $checkbox,
      'mode'     => $mode,
    )
  );

  if ( ! empty( $content ) ) {
    echo $content;
    return;
  }

  if ( ! $wp_list_table ) {
    if ( 'single' === $mode ) {
      $wp_list_table = _get_list_table( 'WP_Post_Comments_List_Table' );
    } else {
      $wp_list_table = _get_list_table( 'WP_Comments_List_Table' );
    }
  }

  ?>
<form method="get">
	<?php if ( $table_row ) : ?>
<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
<?php else : ?>
<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
<?php endif; ?>
	<fieldset class="comment-reply">
	<legend>
		<span class="hidden" id="editlegend"><?php _e( 'Edit Comment' ); ?></span>
		<span class="hidden" id="replyhead"><?php _e( 'Reply to Comment' ); ?></span>
		<span class="hidden" id="addhead"><?php _e( 'Add new Comment' ); ?></span>
	</legend>

	<div id="replycontainer">
	<label for="replycontent" class="screen-reader-text">
		<?php
    /* translators: Hidden accessibility text. */
    _e( 'Comment' );
    ?>
	</label>
	<?php
  $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
  wp_editor(
    '',
    'replycontent',
    array(
      'media_buttons' => false,
      'tinymce'       => false,
      'quicktags'     => $quicktags_settings,
    )
  );
  ?>
	</div>

	<div id="edithead" style="display:none;">
		<div class="inside">
		<label for="author-name"><?php _e( 'Name' ); ?></label>
		<input type="text" name="newcomment_author" size="50" value="" id="author-name" />
		</div>

		<div class="inside">
		<label for="author-email"><?php _e( 'Email' ); ?></label>
		<input type="text" name="newcomment_author_email" size="50" value="" id="author-email" />
		</div>

		<div class="inside">
		<label for="author-url"><?php _e( 'URL' ); ?></label>
		<input type="text" id="author-url" name="newcomment_author_url" class="code" size="103" value="" />
		</div>
	</div>

	<div id="replysubmit" class="submit">
		<p class="reply-submit-buttons">
			<button type="button" class="save button button-primary">
				<span id="addbtn" style="display: none;"><?php _e( 'Add Comment' ); ?></span>
				<span id="savebtn" style="display: none;"><?php _e( 'Update Comment' ); ?></span>
				<span id="replybtn" style="display: none;"><?php _e( 'Submit Reply' ); ?></span>
			</button>
			<button type="button" class="cancel button"><?php _e( 'Cancel' ); ?></button>

 View on GitHub View on Trac