wp-includes/link-template.php:17Displays the permalink for the current post.
$postint|WP_Postoptional0One hook fires while the_permalink() runs, in this order:
Filters the display of the permalink for the current post.
function the_permalink( $post = 0 ) { /** * Filters the display of the permalink for the current post. * * @since 1.5.0 * @since 4.4.0 Added the `$post` parameter. * * @param string $permalink The permalink for the current post. * @param int|WP_Post $post Post ID, WP_Post object, or 0. Default 0. */ echo esc_url( apply_filters( 'the_permalink', get_permalink( $post ), $post ) );}Introduced in 1.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/link-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.