preview_post_link WordPress Filter Hook

The preview_post_link Wordpress hook allows you to create a link to a post that will allow you to preview the post before it is published. This is useful if you want to make sure that the post looks the way you want it to before you publish it.

apply_filters( 'preview_post_link', string $preview_link, WP_Post $post ) #

Filters the URL used for a post preview.


Parameters

$preview_link

(string)URL used for the post preview.

$post

(WP_Post)Post object.


Top ↑

Source

File: wp-includes/link-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.0.0Added the $post parameter.
2.0.5Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More