2020-04-07 13:03:04 +00:00
|
|
|
<?php
|
2020-08-13 14:53:39 +00:00
|
|
|
/**
|
|
|
|
* This file handles the top bar spacing Customizer options.
|
|
|
|
*
|
|
|
|
* @package GP Premium
|
|
|
|
*/
|
|
|
|
|
2020-04-07 13:03:04 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2020-08-13 14:53:39 +00:00
|
|
|
exit; // No direct access, please.
|
2020-04-07 13:03:04 +00:00
|
|
|
}
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
if ( isset( $defaults['top_bar_top'] ) ) {
|
|
|
|
$wp_customize->add_setting(
|
|
|
|
'generate_spacing_settings[top_bar_top]',
|
2020-04-07 13:03:04 +00:00
|
|
|
array(
|
|
|
|
'default' => $defaults['top_bar_top'],
|
|
|
|
'type' => 'option',
|
|
|
|
'sanitize_callback' => 'absint',
|
2020-08-13 14:53:39 +00:00
|
|
|
'transport' => 'postMessage',
|
2020-04-07 13:03:04 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
$wp_customize->add_setting(
|
|
|
|
'generate_spacing_settings[top_bar_right]',
|
2020-04-07 13:03:04 +00:00
|
|
|
array(
|
|
|
|
'default' => $defaults['top_bar_right'],
|
|
|
|
'type' => 'option',
|
|
|
|
'sanitize_callback' => 'absint',
|
2020-08-13 14:53:39 +00:00
|
|
|
'transport' => 'postMessage',
|
2020-04-07 13:03:04 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
$wp_customize->add_setting(
|
|
|
|
'generate_spacing_settings[top_bar_bottom]',
|
2020-04-07 13:03:04 +00:00
|
|
|
array(
|
|
|
|
'default' => $defaults['top_bar_bottom'],
|
|
|
|
'type' => 'option',
|
|
|
|
'sanitize_callback' => 'absint',
|
2020-08-13 14:53:39 +00:00
|
|
|
'transport' => 'postMessage',
|
2020-04-07 13:03:04 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2020-08-13 14:53:39 +00:00
|
|
|
$wp_customize->add_setting(
|
|
|
|
'generate_spacing_settings[top_bar_left]',
|
2020-04-07 13:03:04 +00:00
|
|
|
array(
|
|
|
|
'default' => $defaults['top_bar_left'],
|
|
|
|
'type' => 'option',
|
|
|
|
'sanitize_callback' => 'absint',
|
2020-08-13 14:53:39 +00:00
|
|
|
'transport' => 'postMessage',
|
2020-04-07 13:03:04 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$wp_customize->add_control(
|
|
|
|
new GeneratePress_Spacing_Control(
|
|
|
|
$wp_customize,
|
|
|
|
'top_bar_spacing',
|
|
|
|
array(
|
2020-08-13 14:53:39 +00:00
|
|
|
'type' => 'generatepress-spacing',
|
|
|
|
'label' => esc_html__( 'Top Bar Padding', 'gp-premium' ),
|
|
|
|
'section' => 'generate_top_bar',
|
|
|
|
'settings' => array(
|
2020-04-07 13:03:04 +00:00
|
|
|
'desktop_top' => 'generate_spacing_settings[top_bar_top]',
|
|
|
|
'desktop_right' => 'generate_spacing_settings[top_bar_right]',
|
|
|
|
'desktop_bottom' => 'generate_spacing_settings[top_bar_bottom]',
|
2020-08-13 14:53:39 +00:00
|
|
|
'desktop_left' => 'generate_spacing_settings[top_bar_left]',
|
2020-04-07 13:03:04 +00:00
|
|
|
),
|
2020-08-13 14:53:39 +00:00
|
|
|
'element' => 'top_bar',
|
|
|
|
'priority' => 99,
|
2020-04-07 13:03:04 +00:00
|
|
|
'active_callback' => 'generate_premium_is_top_bar_active',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|