WP_Posts_List_Table::get_edit_link( array $args, string $label, string $class = '' )
Helper to create links to edit.php with params.
Parameters
- $args
-
(Required) URL parameters for the link.
- $label
-
(Required) Link text.
- $class
-
(Optional) Class attribute.
Default value: ''
Return
(string) The formatted link string.
Source
File: wp-admin/includes/class-wp-posts-list-table.php
protected function get_edit_link( $args, $label, $class = '' ) {
$url = add_query_arg( $args, 'edit.php' );
$class_html = $aria_current = '';
if ( ! empty( $class ) ) {
$class_html = sprintf(
' class="%s"',
esc_attr( $class )
);
if ( 'current' === $class ) {
$aria_current = ' aria-current="page"';
}
}
return sprintf(
'<a href="%s"%s%s>%s</a>',
esc_url( $url ),
$class_html,
$aria_current,
$label
);
}
Changelog
Version | Description |
---|---|
WP-4.4.0 | Introduced. |