acf_field_checkbox::render_field_toggle
description
Метод класса: acf_field_checkbox{}
Хуков нет.
Возвращает
$post_id. (int)
Использование
$acf_field_checkbox = new acf_field_checkbox(); $acf_field_checkbox->render_field_toggle( $field );
- $field(обязательный)
- .
Список изменений
| С версии 5.6.0 | Введена. |
Код acf_field_checkbox::render_field_toggle() acf field checkbox::render field toggle ACF 6.4.2
function render_field_toggle( $field ) {
// vars
$atts = array(
'type' => 'checkbox',
'class' => 'acf-checkbox-toggle',
'label' => __( 'Toggle All', 'acf' ),
);
// custom label
if ( is_string( $field['toggle'] ) ) {
$atts['label'] = $field['toggle'];
}
// checked
if ( $this->_all_checked ) {
$atts['checked'] = 'checked';
}
// return
return '<li>' . acf_get_checkbox_input( $atts ) . '</li>' . "\n";
}