W3cubDocs

/WordPress

post_permalink( int|WP_Post $post ): string|false

Retrieve permalink from post ID.

Description

See also

Parameters

$postint|WP_Postoptional
Post ID or WP_Post object. Default is global $post.

Return

string|false

Source

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

	return get_permalink( $post );
}

Changelog

Version Description
4.4.0 Use get_permalink()
1.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/post_permalink