функция
since 1.2.0
the_permalink()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
the_permalink( int|WP_Post $post )
Описание
Выводит постоянную ссылку для текущей записи.
Параметры
$post
int|WP_Post
необязательный
ID записи или объект записи. По умолчанию — глобальная переменная $post.
Исходный код
wp-includes/link-template.php:17
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 ) );
}
История изменений
| Версия | Описание |
|---|---|
| 4.4.0 | Added the $post parameter. |
| 1.2.0 | Introduced. |

