функция
since 3.1.0
_post_format_wp_get_object_terms()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
_post_format_wp_get_object_terms( array $terms ): array
Описание
Удаляет префикс формата записи из свойства name объектов терминов, созданных функцией wp_get_object_terms() .
Параметры
$terms
array
обязательный
Возвращаемое значение
array
Исходный код
wp-includes/post-formats.php:260
function _post_format_wp_get_object_terms( $terms ) {
foreach ( (array) $terms as $order => $term ) {
if ( isset( $term->taxonomy ) && 'post_format' === $term->taxonomy ) {
$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
}
}
return $terms;
}
История изменений
| Версия | Описание |
|---|---|
| 3.1.0 | Introduced. |

