apply_filters( 'preview_post_link', string $preview_link, WP_Post $post )
- Since
- 2.0.5, 4.0.0
Filters the URL used for a post preview.
Compatibility
- WordPress
- since 4.0.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$preview_linkstring- URL used for the post preview.
$postWP_Post- Post object.
Where this hook fires · 1
wp-includes/link-template.php:1434get_preview_post_link()
Source code
* @since 2.0.5 * @since 4.0.0 Added the `$post` parameter. * * @param string $preview_link URL used for the post preview. * @param WP_Post $post Post object. */ return apply_filters( 'preview_post_link', $preview_link, $post );} /** * Retrieves the edit post link for post. * * Can be used within the WordPress loop or outside of it. Can be used withChangelog
Introduced in 2.0.5. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.0.0
Added the
$post parameter.from the docblock2.0.5
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.