acf_field_wysiwyg::render_field_presentation_settings
Renders the field settings used in the "Presentation" tab.
Method of the class: acf_field_wysiwyg{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_field_wysiwyg = new acf_field_wysiwyg(); $acf_field_wysiwyg->render_field_presentation_settings( $field );
- $field(array) (required)
- The field settings array.
Changelog
| Since 6.0 | Introduced. |
acf_field_wysiwyg::render_field_presentation_settings() acf field wysiwyg::render field presentation settings code ACF 6.0.4
function render_field_presentation_settings( $field ) {
$toolbars = $this->get_toolbars();
$choices = array();
if ( ! empty( $toolbars ) ) {
foreach ( $toolbars as $k => $v ) {
$label = $k;
$name = sanitize_title( $label );
$name = str_replace( '-', '_', $name );
$choices[ $name ] = $label;
}
}
acf_render_field_setting(
$field,
array(
'label' => __( 'Tabs', 'acf' ),
'instructions' => '',
'type' => 'select',
'name' => 'tabs',
'choices' => array(
'all' => __( 'Visual & Text', 'acf' ),
'visual' => __( 'Visual Only', 'acf' ),
'text' => __( 'Text Only', 'acf' ),
),
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Toolbar', 'acf' ),
'instructions' => '',
'type' => 'select',
'name' => 'toolbar',
'choices' => $choices,
'conditions' => array(
'field' => 'tabs',
'operator' => '!=',
'value' => 'text',
),
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Show Media Upload Buttons?', 'acf' ),
'instructions' => '',
'name' => 'media_upload',
'type' => 'true_false',
'ui' => 1,
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Delay initialization?', 'acf' ),
'instructions' => __( 'TinyMCE will not be initialized until field is clicked', 'acf' ),
'name' => 'delay',
'type' => 'true_false',
'ui' => 1,
'conditions' => array(
'field' => 'tabs',
'operator' => '!=',
'value' => 'text',
),
)
);
}