WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/the permalink

Contents

Description

the_permalink is a filter applied to the permalink URL for a post prior to printing by the function the_permalink.

Parameters

$url
(string) (required) The post URL
Default: None

Examples

Append the query string for the current page to permalink URLs (uses add_query_arg):

function append_query_string($url) {
    return add_query_arg($_GET, $url);
}
add_filter('the_permalink', 'append_query_string');

Change Log

Source Files

This filter is applied by:

Related

This page is marked as incomplete. You can help Codex by expanding it.