acf_field_taxonomy::render_field()
Create the HTML interface for your field
Метод класса: acf_field_taxonomy{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$acf_field_taxonomy = new acf_field_taxonomy(); $acf_field_taxonomy->render_field( $field );
- $field (обязательный)
- -
Список изменений
С версии 3.6 | Введена. |
Код acf_field_taxonomy::render_field() acf field taxonomy::render field ACF 6.0.4
<?php function render_field( $field ) { // force value to array $field['value'] = acf_get_array( $field['value'] ); // vars $div = array( 'class' => 'acf-taxonomy-field', 'data-save' => $field['save_terms'], 'data-ftype' => $field['field_type'], 'data-taxonomy' => $field['taxonomy'], 'data-allow_null' => $field['allow_null'], ); // get taxonomy $taxonomy = get_taxonomy( $field['taxonomy'] ); // bail early if taxonomy does not exist if ( ! $taxonomy ) { return; } ?> <div <?php echo acf_esc_attrs( $div ); ?>> <?php if ( $field['add_term'] && current_user_can( $taxonomy->cap->manage_terms ) ) : ?> <div class="acf-actions -hover"> <a href="#" class="acf-icon -plus acf-js-tooltip small" data-name="add" title="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>"></a> </div> <?php endif; if ( $field['field_type'] == 'select' ) { $field['multiple'] = 0; $this->render_field_select( $field ); } elseif ( $field['field_type'] == 'multi_select' ) { $field['multiple'] = 1; $this->render_field_select( $field ); } elseif ( $field['field_type'] == 'radio' ) { $this->render_field_checkbox( $field ); } elseif ( $field['field_type'] == 'checkbox' ) { $this->render_field_checkbox( $field ); } ?> </div> <?php }