acf_field_taxonomy::get_term_title
Returns the Term's title displayed in the field UI.
Method of the class: acf_field_taxonomy{}
Hooks from the method
Returns
String.
Usage
$acf_field_taxonomy = new acf_field_taxonomy(); $acf_field_taxonomy->get_term_title( $term, $field, $post_id );
- $term(WP_Term) (required)
- The term object.
- $field(array) (required)
- The field settings.
- $post_id(mixed)
- The post_id being edited.
Changelog
| Since 5.0.0 | Introduced. |
acf_field_taxonomy::get_term_title() acf field taxonomy::get term title code ACF 6.0.4
function get_term_title( $term, $field, $post_id = 0 ) {
$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' );
/**
* 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 );
}