$wp_customize->add_setting( 'topbar', array(
'default' => false,
'sanitize_callback' => 'sanitize_checkbox',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'topbar', array(
'label' => esc_html__('Show TopBar', 'woo-mag'),
'type' => 'checkbox',
'section' => 'topbar_main',
'settings' => 'topbar',
'priority' => 10,
) ) );
$wp_customize->add_setting( 'topbar_position', array(
'default' => 'relative',
'sanitize_callback' => 'sanitize_select',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'topbar_position', array(
'label' => esc_html__( 'Position', 'woo-mag' ),
'type' => 'select',
'section' => 'topbar_main',
'settings' => 'topbar_position',
'priority' => 10,
'choices' => array(
'relative' => esc_html__( 'Relative', 'woo-mag' ),
'absolute' => esc_html__( 'Absolute', 'woo-mag' ),
),
'active_callback' => function(){
return get_theme_mod( 'topbar', true );
},
) ) );
$wp_customize->add_setting( 'topbar_disable_position', array(
'default' => false,
'sanitize_callback' => 'sanitize_checkbox',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'topbar_disable_position', array(
'label' => esc_html__('Disable position.', 'woo-mag'),
'type' => 'checkbox',
'section' => 'topbar_main',
'settings' => 'topbar_disable_position',
'priority' => 10,
'active_callback' => function(){
return get_theme_mod( 'topbar_position', 'relative' ) == 'absolute' || get_theme_mod( 'topbar', false ) == true;
},
) ) );
public function render_content() {
// Process the palette
if ( is_array( $this->palette ) ) {
$palette = implode( '|', $this->palette );
} else {
// Default to true.
$palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true';
}
// Support passing show_opacity as string or boolean. Default to true.
$show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true';
// Begin the output. ?>
<label>
<?php // Output the label and description if they were passed in.
if ( isset( $this->label ) && '' !== $this->label ) {
echo '<span class="customize-control-title">' . sanitize_text_field( $this->label ) . '</span>';
}
if ( isset( $this->description ) && '' !== $this->description ) {
echo '<span class="description customize-control-description">' . sanitize_text_field( $this->description ) . '</span>';
} ?>
<div> ПРОСТО ИНПУТ ОБЕРНУЛ В ДИВ
<input class="alpha-color-control" type="text" data-show-opacity="<?php echo $show_opacity; ?>" data-palette="<?php echo esc_attr( $palette ); ?>" data-default-color="<?php echo esc_attr( $this->settings['default']->default ); ?>" <?php $this->link(); ?> />
</div>
</label>
<?php
}
&&
поставить вместо ИЛИ, для того эффекта который хочу.Спасибо большое за потраченное время. Всего хорошего.