WordPress at a glance
function is not described

WP_Comments_List_Table::extra_tablenav() WP 1.0

This is a method of the class: WP_Comments_List_Table

Return

Null. Nothing.

Usage

$WP_Comments_List_Table = new WP_Comments_List_Table();
$var = $WP_Comments_List_Table->extra_tablenav( $which );
$which(string) (required)

Notes

  • Global. String. $comment_status
  • Global. String. $comment_type

Code of WP Comments List Table::extra tablenav: wp-admin/includes/class-wp-comments-list-table.php WP 5.3.2

<?php
protected function extra_tablenav( $which ) {
	global $comment_status, $comment_type;
	static $has_items;

	if ( ! isset( $has_items ) ) {
		$has_items = $this->has_items();
	}
	?>
	<div class="alignleft actions">
	<?php
	if ( 'top' === $which ) {
		?>
<label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>
<select id="filter-by-comment-type" name="comment_type">
	<option value=""><?php _e( 'All comment types' ); ?></option>
		<?php
			/**
			 * Filters the comment types dropdown menu.
			 *
			 * @since 2.7.0
			 *
			 * @param string[] $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
			 */
			$comment_types = apply_filters(
				'admin_comment_types_dropdown',
				array(
					'comment' => __( 'Comments' ),
					'pings'   => __( 'Pings' ),
				)
			);

		foreach ( $comment_types as $type => $label ) {
			echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
		}
		?>
</select>
		<?php
		/**
		 * Fires just before the Filter submit button for comment types.
		 *
		 * @since 3.5.0
		 */
		do_action( 'restrict_manage_comments' );
		submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
	}

	if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
		wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
		$title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
		submit_button( $title, 'apply', 'delete_all', false );
	}
	/**
	 * Fires after the Filter submit button for comment types.
	 *
	 * @since 2.5.0
	 *
	 * @param string $comment_status The comment status name. Default 'All'.
	 */
	do_action( 'manage_comments_nav', $comment_status );
	echo '</div>';
}