cmb2-conditionals
cmb2-conditionals copied to clipboard
Not working on theme options page
Conditional plugin is not working on theme options.
$cookie_options = new_cmb2_box( array( 'id' => $prefix . 'metabox', 'title' => esc_html__( 'Cookie Notice', 'microlise' ), 'object_types' => array( 'options-page' ), 'option_key' => 'microlise_cookies', 'menu_title' => esc_html__( 'Cookie Notice', 'microlise' ), 'parent_slug' => 'settings.php', 'admin_menu_hook' => 'network_admin_menu', 'save_button' => esc_html__( 'Save Changes', 'microlise' ), ) );
$cookie_options->add_field( array(
'name' => __( 'More Info Link', 'microlise' ),
'desc' => __( 'Enable Read more link.', 'microlise' ),
'id' => $prefix . 'more',
'type' => 'checkbox',
) );
$cookie_options->add_field( array(
'name' => __( ' ', 'microlise' ),
'desc' => __( 'The text of the more info button.', 'microlise' ),
'id' => $prefix . 'more_text',
'type' => 'text',
'attributes' => array(
'data-conditional-id' => $prefix . 'more',
'data-conditional-value' => 'on',
),
) );
Answer here: #57