edit_post_link
Filters the post edit link anchor tag.
Использование
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(строка)
- Anchor tag for the edit link.
- $post_id(int)
- Post ID.
- $text(строка)
- Anchor text.
Список изменений
| С версии 2.3.0 | Введена. |
Где вызывается хук
edit_post_link
wp-includes/link-template.php 1541
echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after;