WordPress函数the_permalink()输出获取到的固定链接

描述:

显示当前文章或页面的链接

用法:

<?php the_permalink(); ?>

示例:

<a href="<?php the_permalink(); ?>">permalink</a>

源文件:

/**
 * Display the permalink for the current post.
 *
 * @since 1.2.0
 */
function the_permalink() {
	/**
	 * Filter the display of the permalink for the current post.
	 *
	 * @since 1.5.0
	 *
	 * @param string $permalink The permalink for the current post.
	 */
	echo esc_url( apply_filters( 'the_permalink', get_permalink() ) );
}