acf_get_term_title()
acf_get_term_title
Returns the title for this term object.
Хуков нет.
Возвращает
Строку.
Использование
acf_get_term_title( $term );
- $term(объект) (обязательный)
- The WP_Term object.
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_get_term_title() acf get term title ACF 6.4.2
function acf_get_term_title( $term ) {
$title = $term->name;
// Allow for empty name.
if ( $title === '' ) {
$title = __( '(no title)', 'acf' );
}
// Prepend ancestors indentation.
if ( is_taxonomy_hierarchical( $term->taxonomy ) ) {
$ancestors = get_ancestors( $term->term_id, $term->taxonomy );
$title = str_repeat( '- ', count( $ancestors ) ) . $title;
}
return $title;
}