edit_post_link
Filters the post edit link anchor tag.
Usage
add_filter( 'edit_post_link', 'wp_kama_edit_post_link_filter', 10, 3 ); /** * Function for `edit_post_link` filter-hook. * * @param string $link Anchor tag for the edit link. * @param int $post_id Post ID. * @param string $text Anchor text. * * @return string */ function wp_kama_edit_post_link_filter( $link, $post_id, $text ){ // filter... return $link; }
- $link(string)
- Anchor tag for the edit link.
- $post_id(int)
- Post ID.
- $text(string)
- Anchor text.
Changelog
Since 2.3.0 | Introduced. |
Where the hook is called
edit_post_link
wp-includes/link-template.php 1542
echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after;