acf_field_taxonomy::get_term_title
Returns the Term's title displayed in the field UI.
Метод класса: acf_field_taxonomy{}
Хуки из метода
Возвращает
Строку.
Использование
$acf_field_taxonomy = new acf_field_taxonomy(); $acf_field_taxonomy->get_term_title( $term, $field, $post_id, $unescape );
- $term(WP_Term) (обязательный)
- The term object.
- $field(массив) (обязательный)
- The field settings.
- $post_id(разное)
- The post_id being edited.
- $unescape(true|false)
- Should we return an unescaped post title.
По умолчанию: false
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_taxonomy::get_term_title() acf field taxonomy::get term title ACF 6.4.2
function get_term_title( $term, $field, $post_id = 0, $unescape = false ) {
$title = acf_get_term_title( $term );
// Default $post_id to current post being edited.
$post_id = $post_id ? $post_id : acf_get_form_data( 'post_id' );
// unescape for select2 output which handles the escaping.
if ( $unescape ) {
$title = html_entity_decode( $title );
}
/**
* Filters the term title.
*
* @date 1/11/2013
* @since 5.0.0
*
* @param string $title The term title.
* @param WP_Term $term The term object.
* @param array $field The field settings.
* @param (int|string) $post_id The post_id being edited.
*/
return apply_filters( 'acf/fields/taxonomy/result', $title, $term, $field, $post_id );
}