acf_field_flexible_content::delete_field
description
Метод класса: acf_field_flexible_content{}
Хуков нет.
Возвращает
$post_id. (int)
Использование
$acf_field_flexible_content = new acf_field_flexible_content(); $acf_field_flexible_content->delete_field( $field );
- $field(обязательный)
- .
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_field_flexible_content::delete_field() acf field flexible content::delete field ACF 6.4.2
function delete_field( $field ) {
if ( ! empty( $field['layouts'] ) ) {
// loop through layouts
foreach ( $field['layouts'] as $layout ) {
// loop through sub fields
if ( ! empty( $layout['sub_fields'] ) ) {
foreach ( $layout['sub_fields'] as $sub_field ) {
acf_delete_field( $sub_field['ID'] );
}
// foreach
}
// if
}
// foreach
}
// if
}