ListTable::get_view_link()privateWC 1.0

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

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

No Hooks.




// private - for code of main (parent) class only
$result = $this->get_view_link( $slug, $name, $count, $current ): string;
$slug(string) (required)
Slug used to identify the view (usually the order status slug).
$name(string) (required)
Human-readable name of the view (usually the order status label).
$count(int) (required)
Number of items in this view.
$current(true|false) (required)
If this is the current view.

Code of ListTable::get_view_link() WC 7.1.0

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

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