Automattic\WooCommerce\Internal\StockNotifications\Admin

ListTable::get_linkprotectedWC 1.0

Construct a link string from args.

Method of the class: ListTable{}

No Hooks.

Returns

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_link( $args, $label, $css_class );
$args(array) (required)
Arguments for the link.
$label(string) (required)
Link label.
$css_class(string)
CSS class.
Default: ''

ListTable::get_link() code WC 10.3.6

protected function get_link( $args, $label, $css_class = '' ) {
	$url = add_query_arg( $args );

	$class_html   = '';
	$aria_current = '';
	if ( ! empty( $css_class ) ) {
		$class_html = sprintf(
			' class="%s"',
			esc_attr( $css_class )
		);

		if ( 'current' === $css_class ) {
			$aria_current = ' aria-current="page"';
		}
	}

	return sprintf(
		'<a href="%s"%s%s>%s</a>',
		esc_url( $url ),
		$class_html,
		$aria_current,
		$label
	);
}