Automattic\WooCommerce\Internal\Admin\ProductReviews

ReviewsListTable::extra_tablenav()protectedWC 1.0

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

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

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->extra_tablenav( $which ) : void;
$which(строка|разное) (обязательный)
Position (top or bottom).

Заметки

  • Global. Строка. $comment_status
  • Global. Строка. $comment_type

Код ReviewsListTable::extra_tablenav() WC 8.7.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>';
}