Hello
I’m trying to create a togglable field based on the value of a post-type field.
Is this possible, or only with a select field?
I currently have the code below, but it’s not working:
/**
* Register the module and its form settings.
*/
FLBuilder::register_module('FLActivityBlockStyleOne', array(
'general' => array( // Tab
'title' => __('General', 'xyz'), // Tab title
'sections' => array( // Tab Sections
'general' => array( // Section
'title' => '', // Section Title
'fields' => array( // Section Fields
'title' => array(
'type' => 'text',
'label' => 'Section Title',
),
'post_type' => array(
'type' => 'post-type',
'label' => 'Post type',
'toggle' => array(
'post' => array(
'fields' => array('toggle_text'),
'sections' => array('general')
)
)
),
'toggle_text' => array(
'type' => 'text',
'label' => __('Hide Me!', 'fl-builder'),
'default' => '',
'description' => 'I get hidden when you toggle the select above.'
),
'posts_per_page' => array(
'type' => 'text',
'label' => 'Number to show',
),
)
)
)
)
));
Thanks!