Warning: This function has been deprecated. Use get_permalink() instead.

post_permalink() WordPress Function

The post_permalink() function is a great way to get a link to a specific post on your WordPress site. This function can be used in a number of ways, but the most common use is to simply echo the results of the function to the screen.

post_permalink( int|WP_Post $post_id ) #

Retrieve permalink from post ID.


Description

Top ↑

See also


Top ↑

Parameters

$post_id

(int|WP_Post)(Optional) Post ID or WP_Post object. Default is global $post.


Top ↑

Return

(string|false)


Top ↑

Source

File: wp-includes/deprecated.php

function post_permalink( $post_id = 0 ) {
	_deprecated_function( __FUNCTION__, '4.4.0', 'get_permalink()' );

	return get_permalink( $post_id );
}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Use get_permalink()
1.0.0Introduced.

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