Пример #1
0
/**
 * {@internal Missing Short Description}}
 *
 * @since unknown
 *
 * @param unknown_type $position
 * @param unknown_type $checkbox
 * @param unknown_type $mode
 */
function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true)
{
    // allow plugin to replace the popup content
    $content = apply_filters('wp_comment_reply', '', array('position' => $position, 'checkbox' => $checkbox, 'mode' => $mode));
    if (!empty($content)) {
        echo $content;
        return;
    }
    require_once './includes/default-list-tables.php';
    $wp_list_table = new WP_Comments_Table('reply');
    $columns = $wp_list_table->get_column_headers();
    $hidden = array_intersect(array_keys($columns), array_filter($wp_list_table->get_hidden_columns()));
    $col_count = count($columns) - count($hidden);
    ?>
<form method="get" action="">
<?php 
    if ($table_row) {
        ?>
<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php 
        echo $col_count;
        ?>
">
<?php 
    } else {
        ?>
<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
<?php 
    }
    ?>
	<div id="replyhead" style="display:none;"><?php 
    _e('Reply to Comment');
    ?>
</div>

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

		<div class="inside">
		<label for="author-email"><?php 
    _e('E-mail');
    ?>
</label>
		<input type="text" name="newcomment_author_email" size="50" value="" tabindex="102" 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" size="103" value="" tabindex="103" />
		</div>
		<div style="clear:both;"></div>
	</div>

	<div id="replycontainer"><textarea rows="8" cols="40" name="replycontent" tabindex="104" id="replycontent"></textarea></div>

	<p id="replysubmit" class="submit">
	<a href="#comments-form" class="cancel button-secondary alignleft" tabindex="106"><?php 
    _e('Cancel');
    ?>
</a>
	<a href="#comments-form" class="save button-primary alignright" tabindex="104">
	<span id="savebtn" style="display:none;"><?php 
    _e('Update Comment');
    ?>
</span>
	<span id="replybtn" style="display:none;"><?php 
    _e('Submit Reply');
    ?>
</span></a>
	<img class="waiting" style="display:none;" src="<?php 
    echo esc_url(admin_url('images/wpspin_light.gif'));
    ?>
" alt="" />
	<span class="error" style="display:none;"></span>
	<br class="clear" />
	</p>

	<input type="hidden" name="user_ID" id="user_ID" value="<?php 
    echo get_current_user_id();
    ?>
" />
	<input type="hidden" name="action" id="action" value="" />
	<input type="hidden" name="comment_ID" id="comment_ID" value="" />
	<input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" />
	<input type="hidden" name="status" id="status" value="" />
	<input type="hidden" name="position" id="position" value="<?php 
    echo $position;
    ?>
" />
	<input type="hidden" name="checkbox" id="checkbox" value="<?php 
    echo $checkbox ? 1 : 0;
    ?>
" />
	<input type="hidden" name="mode" id="mode" value="<?php 
    echo esc_attr($mode);
    ?>
" />
	<?php 
    wp_nonce_field('replyto-comment', '_ajax_nonce-replyto-comment', false);
    ?>
	<?php 
    wp_comment_form_unfiltered_html_nonce();
    if ($table_row) {
        ?>
</td></tr></tbody></table>
<?php 
    } else {
        ?>
</div></div>
<?php 
    }
    ?>
</form>
<?php 
}