Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::extra_tablenav()protectedWC 1.0

Renders the extra controls to be displayed between bulk actions and pagination.

Метод класса: ReviewsListTable{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->extra_tablenav( $which ) : void;
$which(string|mixed) (required)
Position (top or bottom).

Notes

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

Код ReviewsListTable::extra_tablenav() WC 7.1.0

protected function extra_tablenav( $which ) : void {
	global $comment_status, $comment_type;

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

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

		ob_start();

		echo '<input type="hidden" name="comment_status" value="' . esc_attr( $comment_status ?? 'all' ) . '" />';

		$this->review_type_dropdown( $comment_type );
		$this->review_rating_dropdown( $this->current_reviews_rating );
		$this->product_search( $this->current_product_for_reviews );

		echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

		submit_button( __( 'Filter', 'woocommerce' ), '', 'filter_action', false, [ 'id' => 'post-query-submit' ] );
	}

	if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && $this->has_items() && $this->current_user_can_moderate_reviews ) {

		wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );

		$title = 'spam' === $comment_status
			? esc_attr__( 'Empty Spam', 'woocommerce' )
			: esc_attr__( 'Empty Trash', 'woocommerce' );

		submit_button( $title, 'apply', 'delete_all', false );
	}

	echo '</div>';
}