updated plugin GP Premium
version 1.11.2
This commit is contained in:
@ -1,35 +1,40 @@
|
||||
<?php
|
||||
// No direct access, please
|
||||
/**
|
||||
* This file handles the content spacing Customizer options.
|
||||
*
|
||||
* @package GP Premium
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
exit; // No direct access, please.
|
||||
}
|
||||
|
||||
// Add our old Spacing section
|
||||
// Add our old Spacing section.
|
||||
$wp_customize->add_section(
|
||||
'generate_spacing_content',
|
||||
array(
|
||||
'title' => __( 'Content', 'gp-premium' ),
|
||||
'capability' => 'edit_theme_options',
|
||||
'priority' => 10,
|
||||
'panel' => 'generate_spacing_panel'
|
||||
'panel' => 'generate_spacing_panel',
|
||||
)
|
||||
);
|
||||
|
||||
// If we don't have a layout panel, use our old spacing section
|
||||
// If we don't have a layout panel, use our old spacing section.
|
||||
if ( $wp_customize->get_panel( 'generate_layout_panel' ) ) {
|
||||
$content_section = 'generate_layout_container';
|
||||
} else {
|
||||
$content_section = 'generate_spacing_content';
|
||||
}
|
||||
|
||||
// Take control of the container width control
|
||||
// This control is handled by the free theme, but we take control of it here for consistency between control styles
|
||||
// Take control of the container width control.
|
||||
// This control is handled by the free theme, but we take control of it here for consistency between control styles.
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Pro_Range_Slider_Control(
|
||||
$wp_customize,
|
||||
'generate_settings[container_width]',
|
||||
array(
|
||||
'label' => __( 'Container Width', 'generatepress' ),
|
||||
'label' => __( 'Container Width', 'gp-premium' ),
|
||||
'section' => 'generate_layout_container',
|
||||
'settings' => array(
|
||||
'desktop' => 'generate_settings[container_width]',
|
||||
@ -48,14 +53,15 @@ $wp_customize->add_control(
|
||||
)
|
||||
);
|
||||
|
||||
// Separating space
|
||||
// Separating space.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[separator]', array(
|
||||
'generate_spacing_settings[separator]',
|
||||
array(
|
||||
'default' => $defaults['separator'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
@ -82,43 +88,47 @@ $wp_customize->add_control(
|
||||
)
|
||||
);
|
||||
|
||||
// Content padding top
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[content_top]',
|
||||
// Content padding top.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[content_top]',
|
||||
array(
|
||||
'default' => $defaults['content_top'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
// Content padding right
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[content_right]',
|
||||
// Content padding right.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[content_right]',
|
||||
array(
|
||||
'default' => $defaults['content_right'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
// Content padding bottom
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[content_bottom]',
|
||||
// Content padding bottom.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[content_bottom]',
|
||||
array(
|
||||
'default' => $defaults['content_bottom'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
// Content padding left
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[content_left]',
|
||||
// Content padding left.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[content_left]',
|
||||
array(
|
||||
'default' => $defaults['content_left'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
@ -129,78 +139,83 @@ $content_padding_settings = array(
|
||||
'desktop_left' => 'generate_spacing_settings[content_left]',
|
||||
);
|
||||
|
||||
// If mobile_content_top is set, the rest of them are too
|
||||
// We have to check as these defaults are set in the theme
|
||||
if ( isset( $defaults[ 'mobile_content_top' ] ) ) {
|
||||
// If mobile_content_top is set, the rest of them are too.
|
||||
// We have to check as these defaults are set in the theme.
|
||||
if ( isset( $defaults['mobile_content_top'] ) ) {
|
||||
$content_padding_settings['mobile_top'] = 'generate_spacing_settings[mobile_content_top]';
|
||||
$content_padding_settings['mobile_right'] = 'generate_spacing_settings[mobile_content_right]';
|
||||
$content_padding_settings['mobile_bottom'] = 'generate_spacing_settings[mobile_content_bottom]';
|
||||
$content_padding_settings['mobile_left'] = 'generate_spacing_settings[mobile_content_left]';
|
||||
$content_padding_settings['mobile_right'] = 'generate_spacing_settings[mobile_content_right]';
|
||||
$content_padding_settings['mobile_bottom'] = 'generate_spacing_settings[mobile_content_bottom]';
|
||||
$content_padding_settings['mobile_left'] = 'generate_spacing_settings[mobile_content_left]';
|
||||
|
||||
// Mobile content padding top
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[mobile_content_top]',
|
||||
// Mobile content padding top.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[mobile_content_top]',
|
||||
array(
|
||||
'default' => $defaults['mobile_content_top'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
// Content padding right
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[mobile_content_right]',
|
||||
// Content padding right.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[mobile_content_right]',
|
||||
array(
|
||||
'default' => $defaults['mobile_content_right'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
// Content padding bottom
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[mobile_content_bottom]',
|
||||
// Content padding bottom.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[mobile_content_bottom]',
|
||||
array(
|
||||
'default' => $defaults['mobile_content_bottom'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
// Content padding left
|
||||
$wp_customize->add_setting( 'generate_spacing_settings[mobile_content_left]',
|
||||
// Content padding left.
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[mobile_content_left]',
|
||||
array(
|
||||
'default' => $defaults['mobile_content_left'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Make use of the content padding settings
|
||||
// Make use of the content padding settings.
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Spacing_Control(
|
||||
$wp_customize,
|
||||
'content_spacing',
|
||||
array(
|
||||
'type' => 'generatepress-spacing',
|
||||
'label' => esc_html__( 'Content Padding', 'gp-premium' ),
|
||||
'section' => $content_section,
|
||||
'settings' => $content_padding_settings,
|
||||
'element' => 'content',
|
||||
'priority' => 99
|
||||
'type' => 'generatepress-spacing',
|
||||
'label' => esc_html__( 'Content Padding', 'gp-premium' ),
|
||||
'section' => $content_section,
|
||||
'settings' => $content_padding_settings,
|
||||
'element' => 'content',
|
||||
'priority' => 99,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_spacing_settings[content_element_separator]', array(
|
||||
'generate_spacing_settings[content_element_separator]',
|
||||
array(
|
||||
'default' => $defaults['content_element_separator'],
|
||||
'type' => 'option',
|
||||
'capability' => 'edit_theme_options',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_decimal_integer',
|
||||
'transport' => 'postMessage'
|
||||
'transport' => 'postMessage',
|
||||
)
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user