WP_Comments_List_Table::extra_tablenav()protectedWP 1.0

Method of the class: WP_Comments_List_Table{}

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->extra_tablenav( $which );
$which(string) (required)
-

Notes

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

WP_Comments_List_Table::extra_tablenav() code WP 6.5.2

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

	if ( ! isset( $has_items ) ) {
		$has_items = $this->has_items();
	}

	echo '<div class="alignleft actions">';

	if ( 'top' === $which ) {
		ob_start();

		$this->comment_type_dropdown( $comment_type );

		/**
		 * Fires just before the Filter submit button for comment types.
		 *
		 * @since 3.5.0
		 */
		do_action( 'restrict_manage_comments' );

		$output = ob_get_clean();

		if ( ! empty( $output ) && $this->has_items() ) {
			echo $output;
			submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
		}
	}

	if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && $has_items
		&& current_user_can( 'moderate_comments' )
	) {
		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
	 * @since 5.6.0 The `$which` parameter was added.
	 *
	 * @param string $comment_status The comment status name. Default 'All'.
	 * @param string $which          The location of the extra table nav markup: Either 'top' or 'bottom'.
	 */
	do_action( 'manage_comments_nav', $comment_status, $which );

	echo '</div>';
}