Automattic\WooCommerce\Internal\Admin\Orders

ListTable::get_view_link()privateWC 1.0

Form a link to use in the list of table views.

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

Хуков нет.

Возвращает

Строку.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_view_link( $slug, $name, $count, $current ): string;
$slug(строка) (обязательный)
Slug used to identify the view (usually the order status slug).
$name(строка) (обязательный)
Human-readable name of the view (usually the order status label).
$count(int) (обязательный)
Number of items in this view.
$current(true|false) (обязательный)
If this is the current view.

Код ListTable::get_view_link() WC 8.7.0

private function get_view_link( string $slug, string $name, int $count, bool $current ): string {
	$base_url = get_admin_url( null, 'admin.php?page=wc-orders' . ( 'shop_order' === $this->order_type ? '' : '--' . $this->order_type ) );
	$url      = esc_url( add_query_arg( 'status', $slug, $base_url ) );
	$name     = esc_html( $name );
	$count    = absint( $count );
	$class    = $current ? 'class="current"' : '';

	return "<a href='$url' $class>$name <span class='count'>($count)</span></a>";
}