the_shortlink
Filters the short link anchor tag for a post.
Использование
add_filter( 'the_shortlink', 'wp_kama_the_shortlink_filter', 10, 4 );
/**
* Function for `the_shortlink` filter-hook.
*
* @param string $link Shortlink anchor tag.
* @param string $shortlink Shortlink URL.
* @param string $text Shortlink's text.
* @param string $title Shortlink's title attribute. Unused.
*
* @return string
*/
function wp_kama_the_shortlink_filter( $link, $shortlink, $text, $title ){
// filter...
return $link;
}
- $link(строка)
- Shortlink anchor tag.
- $shortlink(строка)
- Shortlink URL.
- $text(строка)
- Shortlink's text.
- $title(строка)
- Shortlink's title attribute. Unused.
Список изменений
| С версии 3.0.0 | Введена. |
Где вызывается хук
the_shortlink
wp-includes/link-template.php 4287
$link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title );