the_permalink
Displays the permalink for the current post.
Description
the_permalink( (int) $post = 0 );
Parameters (1)
- 0. $post — Optional. (int)
- Post ID or post object. Default is the global
$post
..
Usage
if ( !function_exists( 'the_permalink' ) ) { require_once ABSPATH . WPINC . '/link-template.php'; } // Optional. Post ID or post object. Default is the global `$post`. $post = -1; // NOTICE! Understand what this does before running. $result = the_permalink($post);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/link-template.php
- 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.
- */
- }