функция
since 2.3.0
get_the_tags()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
get_the_tags( int|WP_Post $post ): WP_Term[]|false|WP_Error
Описание
Возвращает метки записи.
Параметры
$post
int|WP_Post
обязательный
Идентификатор или объект записи.
Возвращаемое значение
WP_Term[]|false|WP_Error
WP_Term WP_Error
Исходный код
wp-includes/category-template.php:1177
function get_the_tags( $post = 0 ) {
$terms = get_the_terms( $post, 'post_tag' );
/**
* Filters the array of tags for the given post.
*
* @since 2.3.0
*
* @see get_the_terms()
*
* @param WP_Term[]|false|WP_Error $terms Array of WP_Term objects on success, false if there are no terms
* or the post does not exist, WP_Error on failure.
*/
return apply_filters( 'get_the_tags', $terms );
}
История изменений
| Версия | Описание |
|---|---|
| 2.3.0 | Introduced. |

