the_shortlink
Filter HookDescription
Filters the short link anchor tag for a post.Hook Information
File Location |
wp-includes/link-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 4278 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$link
|
Shortlink anchor tag. |
string
|
$shortlink
|
Shortlink URL. |
string
|
$text
|
Shortlink's text. |
string
|
$title
|
Shortlink's title attribute. Unused. |
Usage Examples
Basic Usage
<?php
// Hook into the_shortlink
add_filter('the_shortlink', 'my_custom_filter', 10, 4);
function my_custom_filter($link, $shortlink, $text, $title) {
// Your custom filtering logic here
return $link;
}
Source Code Context
wp-includes/link-template.php:4278
- How this hook is used in WordPress core
<?php
4273 * @param string $link Shortlink anchor tag.
4274 * @param string $shortlink Shortlink URL.
4275 * @param string $text Shortlink's text.
4276 * @param string $title Shortlink's title attribute. Unused.
4277 */
4278 $link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title );
4279 echo $before, $link, $after;
4280 }
4281 }
4282
4283 /**
PHP Documentation
<?php
/**
* Filters the short link anchor tag for a post.
*
* @since 3.0.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/link-template.php
Related Hooks
Related hooks will be displayed here in future updates.