add_section(
'child_support_settings',
array(
'title' => __( 'Child Theme Support Settings', 'blossom-floral-pro' ),
'priority' => 24,
)
);
/** Child Support Description */
$wp_customize->add_setting(
'child_additional_support',
array(
'default' => 'default',
'sanitize_callback' => 'blossom_floral_pro_sanitize_select'
)
);
$wp_customize->add_control(
new Blossom_Floral_Pro_Select_Control(
$wp_customize,
'child_additional_support',
array(
'section' => 'child_support_settings',
'label' => __( 'Child Theme Style', 'blossom-floral-pro' ),
'description' => __( 'Select respective child theme style from the drop-down below.', 'blossom-floral-pro' ),
'choices' => array(
'default' => __( 'Default', 'blossom-floral-pro' ),
'floralfashion' => __( 'Floral Fashion', 'blossom-floral-pro' ),
'eleganttravel' => __( 'Elegant Travel', 'blossom-floral-pro' )
),
)
)
);
/** Floral Fashion Note */
$wp_customize->add_setting(
'floral_fashion_text',
array(
'default' => '',
'sanitize_callback' => 'wp_kses_post'
)
);
$wp_customize->add_control(
new Blossom_Floral_Pro_Note_Control(
$wp_customize,
'floral_fashion_text',
array(
'section' => 'child_support_settings',
'description' => sprintf(__( 'To achieve the exact layout of "Floral Fashion" child theme please, select the %1$sfourth header layout%2$s, %3$seighth slider layout%4$s, and %5$sfourth home page layout%6$s respectively.', 'blossom-floral-pro' ), '', '', '', '', '', '' ),
'active_callback' => 'blossom_floral_pro_theme_support_ac',
)
)
);
/** Elegant Travel Note */
$wp_customize->add_setting(
'elegant_travel_text',
array(
'default' => '',
'sanitize_callback' => 'wp_kses_post'
)
);
$wp_customize->add_control(
new Blossom_Floral_Pro_Note_Control(
$wp_customize,
'elegant_travel_text',
array(
'section' => 'child_support_settings',
'description' => sprintf(__( 'To achieve the exact layout of "Elegant Travel" child theme please, select the %1$ssecond header layout%2$s, %3$ssecond slider layout%4$s, %5$sthirteenth home page layout%6$s respectively.', 'blossom-floral-pro' ), '', '', '', '', '', '' ),
'active_callback' => 'blossom_floral_pro_theme_support_ac',
)
)
);
}
add_action( 'customize_register', 'blossom_floral_pro_customize_register_general_child_support' );
/**
* Active Callback
*/
function blossom_floral_pro_theme_support_ac( $control ){
$child_theme_support = $control->manager->get_setting( 'child_additional_support' )->value();
$control_id = $control->id;
if ( $control_id == 'floral_fashion_text' && $child_theme_support == 'floralfashion' ) return true;
if ( $control_id == 'elegant_travel_text' && $child_theme_support == 'eleganttravel' ) return true;
return false;
}