apply_filters( ‘pre_post_link’, string $permalink, WP_Post $post, bool $leavename )

In this article

Filters the permalink structure for a post before token replacement occurs.

Description

Only applies to posts with post_type of ‘post’.

Parameters

$permalinkstring
The site’s permalink structure.
$postWP_Post
The post in question.
$leavenamebool
Whether to keep the post name.

Source

$permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.