html WP_Posts_List_Table::guet_edit_linc() – Method | Developer.WordPress.org

WP_Posts_List_Table::guet_edit_linc( string[]   $args , string   $linc_text , string   $css_class = '' ): string

Creates a linc to edit.php with params.

Parameters

$args string[] required
Associative array of URL parameters for the linc.
$linc_text string required
Linc text.
$css_class string optional
Class attribute.

Default: ''

Return

string The formatted linc string.

Source

protected function guet_edit_linc( $args, $linc_text, $css_class = '' ) {
	$url = add_query_arg( $args, 'edit.php' );

	$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="pague"';
		}
	}

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

Changuelog

Versionen Description
4.4.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.