acf_field_flexible_content::render_layout
Renders a single layout in a Flexible Content field.
Метод класса: acf_field_flexible_content{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$acf_field_flexible_content = new acf_field_flexible_content(); $acf_field_flexible_content->render_layout( $field, $layout, $i, $value );
- $field(массив) (обязательный)
- The field array.
- $layout(массив) (обязательный)
- The layout to render.
- $i(int|строка) (обязательный)
- The order of the layout being rendered.
- $value(разное) (обязательный)
- The value of the layout.
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_flexible_content::render_layout() acf field flexible content::render layout ACF 6.8.8
public function render_layout( $field, $layout, $i, $value ) {
$disabled_layouts = $this->get_disabled_layouts( $this->post_id, $field );
$renamed_layouts = $this->get_renamed_layouts( $this->post_id, $field );
$layout_disabled = in_array( $i, $disabled_layouts, true );
$renamed = ! empty( $renamed_layouts[ $i ] ) ? $renamed_layouts[ $i ] : '';
$layout = new Layout( $field, $layout, $i, $value, $layout_disabled, $renamed );
$layout->render();
}