From e9b64fb76d3d3e232f3209287662fe730454b4c7 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 5 Mar 2014 07:24:14 +0000 Subject: [PATCH] Introduce get_the_permalink() as an alias for get_permalink(). This better aligns it with other the_* and get_the_* function pairs. props ericmann. fixes #24164. Built from https://develop.svn.wordpress.org/trunk@27409 git-svn-id: http://core.svn.wordpress.org/trunk@27256 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 51589ef978..a838c2a187 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -68,13 +68,27 @@ function permalink_anchor( $mode = 'id' ) { } } +/** + * Retrieve full permalink for current post or post ID. Alias for get_permalink(). + * + * @since 3.9.0 + * @see get_permalink() + * + * @param int|WP_Post $id Optional. Post ID or post object. Defaults current post. + * @param bool $leavename Optional. Whether to keep post name or page name. Default false. + * @return string|bool The permalink URL or false if post does not exist. + */ +function get_the_permalink( $id = 0, $leavename = false ) { + return get_permalink( $id, $leavename ); +} + /** * Retrieve full permalink for current post or post ID. * * @since 1.0.0 * - * @param int|WP_Post $id Optional. Post ID or post object, defaults to the current post. - * @param bool $leavename Optional. Whether to keep post name or page name, defaults to false. + * @param int|WP_Post $id Optional. Post ID or post object. Default current post. + * @param bool $leavename Optional. Whether to keep post name or page name. Default false. * @return string|bool The permalink URL or false if post does not exist. */ function get_permalink( $id = 0, $leavename = false ) {