acf_field_clone::render_field()
Create the HTML interface for your field
Метод класса: acf_field_clone{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$acf_field_clone = new acf_field_clone(); $acf_field_clone->render_field( $field );
- $field (обязательный)
- -
Список изменений
С версии 3.6 | Введена. |
Код acf_field_clone::render_field() acf field clone::render field ACF 6.0.4
function render_field( $field ) { // bail early if no sub fields if ( empty( $field['sub_fields'] ) ) { return; } // load values foreach ( $field['sub_fields'] as &$sub_field ) { // add value if ( isset( $field['value'][ $sub_field['key'] ] ) ) { // this is a normal value $sub_field['value'] = $field['value'][ $sub_field['key'] ]; } elseif ( isset( $sub_field['default_value'] ) ) { // no value, but this sub field has a default value $sub_field['value'] = $sub_field['default_value']; } // update prefix to allow for nested values $sub_field['prefix'] = $field['name']; // restore label $sub_field['label'] = $sub_field['__label']; // restore required if ( $field['required'] ) { $sub_field['required'] = 0; } } // render if ( $field['layout'] == 'table' ) { $this->render_field_table( $field ); } else { $this->render_field_block( $field ); } }