Uses
| Uses | Description |
|---|---|
| wp-includes/formatting.php: esc_attr() | Escaping for HTML attributes. |
| wp-includes/formatting.php: esc_url() | Checks and cleans a URL. |
| wp-includes/functions.php: add_query_arg() | Retrieves a modified URL query string. |
Helper to create links to edit.php with params.
(string[]) (Required) Associative array of URL parameters for the link.
(string) (Required) Link text.
(string) (Optional) Class attribute.
Default value: ''
(string) The formatted link string.
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
);
} | Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_posts_list_table/get_edit_link