Initial commit: Atomaste website
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
/**
|
||||
* Accessibility Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 4.1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Astra Accessibility Configurations.
|
||||
*/
|
||||
class Astra_Accessibility_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Astra Accessibility Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 4.1.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Toggle for accessibility.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-accessibility-toggle]',
|
||||
'default' => astra_get_option( 'site-accessibility-toggle' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'title' => __( 'Site Accessibility', 'astra' ),
|
||||
'section' => 'section-accessibility',
|
||||
'priority' => 1,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Highlight type.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-accessibility-highlight-type]',
|
||||
'default' => astra_get_option( 'site-accessibility-highlight-type' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-icon',
|
||||
'priority' => 1,
|
||||
'title' => __( 'Global Highlight', 'astra' ),
|
||||
'section' => 'section-accessibility',
|
||||
'choices' => array(
|
||||
'dotted' => array(
|
||||
'label' => __( 'Dotted', 'astra' ),
|
||||
'path' => 'ellipsis',
|
||||
),
|
||||
'solid' => array(
|
||||
'label' => __( 'Solid', 'astra' ),
|
||||
'path' => 'minus',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[site-accessibility-toggle]',
|
||||
'operator' => '===',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Highlight color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-accessibility-highlight-color]',
|
||||
'default' => astra_get_option( 'site-accessibility-highlight-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 1,
|
||||
'title' => __( 'Color', 'astra' ),
|
||||
'section' => 'section-accessibility',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[site-accessibility-toggle]',
|
||||
'operator' => '===',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Highlight type.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-accessibility-highlight-input-type]',
|
||||
'default' => astra_get_option( 'site-accessibility-highlight-input-type' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-icon',
|
||||
'priority' => 1,
|
||||
'title' => __( 'Input Highlight', 'astra' ),
|
||||
'section' => 'section-accessibility',
|
||||
'choices' => array(
|
||||
'disable' => array(
|
||||
'label' => __( 'Disable', 'astra' ),
|
||||
'path' => 'remove',
|
||||
),
|
||||
'dotted' => array(
|
||||
'label' => __( 'Dotted', 'astra' ),
|
||||
'path' => 'ellipsis',
|
||||
),
|
||||
'solid' => array(
|
||||
'label' => __( 'Solid', 'astra' ),
|
||||
'path' => 'minus',
|
||||
),
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[site-accessibility-toggle]',
|
||||
'operator' => '===',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Highlight color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-accessibility-highlight-input-color]',
|
||||
'default' => astra_get_option( 'site-accessibility-highlight-input-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 1,
|
||||
'title' => __( 'Color', 'astra' ),
|
||||
'section' => 'section-accessibility',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[site-accessibility-toggle]',
|
||||
'operator' => '===',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Accessibility_Configs();
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* Entry Content options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 3.8.0
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'Astra_Block_Editor_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Site Layout Customizer Configurations.
|
||||
*/
|
||||
class Astra_Block_Editor_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Site Layout Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.8.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$is_legacy_setup = ( 'legacy' === astra_get_option( 'wp-blocks-ui', 'comfort' ) || true === astra_get_option( 'blocks-legacy-setup', false ) ) ? true : false;
|
||||
|
||||
$preset_options = array(
|
||||
'compact' => __( 'Compact', 'astra' ),
|
||||
'comfort' => __( 'Comfort', 'astra' ),
|
||||
'custom' => __( 'Custom', 'astra' ),
|
||||
);
|
||||
if ( $is_legacy_setup ) {
|
||||
$preset_options = array(
|
||||
'legacy' => __( 'Legacy', 'astra' ),
|
||||
'compact' => __( 'Compact', 'astra' ),
|
||||
'comfort' => __( 'Comfort', 'astra' ),
|
||||
'custom' => __( 'Custom', 'astra' ),
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
/**
|
||||
* Option: Presets for block editor padding.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[wp-blocks-ui]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-block-editor',
|
||||
'default' => astra_get_option( 'wp-blocks-ui' ),
|
||||
'priority' => 9,
|
||||
'title' => __( 'Core Blocks Spacing', 'astra' ),
|
||||
'choices' => $preset_options,
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Global Padding Option.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[wp-blocks-global-padding]',
|
||||
'section' => 'section-block-editor',
|
||||
'title' => __( 'Size', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'default' => astra_get_option( 'wp-blocks-global-padding' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'linked_choices' => true,
|
||||
'priority' => 10,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[wp-blocks-ui]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[wp-blocks-ui-description]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-block-editor',
|
||||
'priority' => 10,
|
||||
'help' => '<p style="margin-top: -5px;">' . __( 'Global padding setting for WordPress Group, Column, Cover blocks, it can be overridden by respective block\'s Dimension setting.', 'astra' ) . '</p>',
|
||||
'settings' => array(),
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating new instance.
|
||||
*/
|
||||
new Astra_Block_Editor_Configs();
|
||||
@@ -0,0 +1,481 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Button_Component_Configs {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Configurations.
|
||||
* @param string $builder_type Builder Type.
|
||||
* @param string $section Section.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @return array $configurations Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public static function register_configuration( $configurations, $builder_type = 'header', $section = 'section-hb-button-' ) {
|
||||
|
||||
if ( 'footer' === $builder_type ) {
|
||||
$class_obj = Astra_Builder_Footer::get_instance();
|
||||
$number_of_button = Astra_Builder_Helper::$num_of_footer_button;
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_button;
|
||||
} else {
|
||||
$class_obj = Astra_Builder_Header::get_instance();
|
||||
$number_of_button = Astra_Builder_Helper::$num_of_header_button;
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_button;
|
||||
}
|
||||
|
||||
$button_config = array();
|
||||
|
||||
for ( $index = 1; $index <= $component_limit; $index++ ) {
|
||||
|
||||
$_section = $section . $index;
|
||||
$_prefix = 'button' . $index;
|
||||
|
||||
/**
|
||||
* These options are related to Header Section - Button.
|
||||
* Prefix hs represents - Header Section.
|
||||
*/
|
||||
$button_config[] = array(
|
||||
|
||||
/*
|
||||
* Header Builder section - Button Component Configs.
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 50,
|
||||
/* translators: %s Index */
|
||||
'title' => ( 1 === $number_of_button ) ? __( 'Button', 'astra' ) : sprintf( __( 'Button %s', 'astra' ), $index ),
|
||||
'panel' => 'panel-' . $builder_type . '-builder-group',
|
||||
'clone_index' => $index,
|
||||
'clone_type' => $builder_type . '-button',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text]',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text' ),
|
||||
'type' => 'control',
|
||||
'control' => 'text',
|
||||
'section' => $_section,
|
||||
'priority' => 20,
|
||||
'title' => __( 'Text', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-' . $builder_type . '-button-' . $index,
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => array( $class_obj, 'button_' . $index ),
|
||||
'fallback_refresh' => false,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Link
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-link-option]',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-link-option' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-link',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_link' ),
|
||||
'section' => $_section,
|
||||
'priority' => 30,
|
||||
'title' => __( 'Link', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-' . $builder_type . '-button-' . $index,
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => array( $class_obj, 'button_' . $index ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Group: Primary Header Button Colors Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-color-group]',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 70,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-background-color-group]',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 70,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-text-color',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 9,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-text-h-color',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 9,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-back-color',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-back-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-background-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 10,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Button Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-back-h-color',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-back-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-background-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 10,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-builder-button-border-colors-group]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'priority' => 70,
|
||||
'transport' => 'postMessage',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-border-color',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-color' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-builder-button-border-colors-group]',
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 70,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-border-h-color',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-h-color' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-builder-button-border-colors-group]',
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 70,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-border-size]',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-size' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-border',
|
||||
'transport' => 'postMessage',
|
||||
'linked_choices' => true,
|
||||
'priority' => 99,
|
||||
'title' => __( 'Border Width', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Radius Fields
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-border-radius-fields]',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-border-radius-fields' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'transport' => 'postMessage',
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 99,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'connected' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Typography
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-text-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Font', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'priority' => 90,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-font-family',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-font-family' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'connect' => $builder_type . '-' . $_prefix . '-font-weight',
|
||||
'priority' => 1,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Footer Button Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-font-weight',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-font-weight' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'connect' => $builder_type . '-' . $_prefix . '-font-family',
|
||||
'priority' => 2,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-font-size',
|
||||
'default' => astra_get_option( $builder_type . '-' . $_prefix . '-font-size' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-slider',
|
||||
'priority' => 3,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Footer Button Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-' . $_prefix . '-font-extras',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-' . $_prefix . '-text-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font-extras',
|
||||
'priority' => 5,
|
||||
'default' => astra_get_option( 'breadcrumb-font-extras' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'title' => __( 'Font Extras', 'astra' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( 'footer' === $builder_type ) {
|
||||
$button_config[] = array(
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-button-' . $index . '-alignment]',
|
||||
'default' => astra_get_option( 'footer-button-' . $index . '-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 35,
|
||||
'title' => __( 'Alignment', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'flex-start' => 'align-left',
|
||||
'center' => 'align-center',
|
||||
'flex-end' => 'align-right',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$button_config[] = Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, $builder_type );
|
||||
|
||||
$button_config[] = Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section );
|
||||
|
||||
}
|
||||
|
||||
$button_config = call_user_func_array( 'array_merge', $button_config + array( array() ) );
|
||||
|
||||
$configurations = array_merge( $configurations, $button_config );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Button_Component_Configs();
|
||||
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Html_Component_Configs {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Configurations.
|
||||
* @param string $builder_type Builder Type.
|
||||
* @param string $section Section.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @return array $configurations Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public static function register_configuration( $configurations, $builder_type = 'header', $section = 'section-hb-html-' ) {
|
||||
|
||||
$html_config = array();
|
||||
|
||||
if ( 'footer' === $builder_type ) {
|
||||
$class_obj = Astra_Builder_Footer::get_instance();
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_html;
|
||||
} else {
|
||||
$class_obj = Astra_Builder_Header::get_instance();
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_html;
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= $component_limit; $index++ ) {
|
||||
|
||||
$_section = $section . $index;
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/*
|
||||
* Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 60,
|
||||
/* translators: %s Index */
|
||||
'title' => sprintf( __( 'HTML %s', 'astra' ), $index ),
|
||||
'panel' => 'panel-' . $builder_type . '-builder-group',
|
||||
'clone_index' => $index,
|
||||
'clone_type' => $builder_type . '-html',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Html Editor.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-html-' . $index . ']',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-html-editor',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 4,
|
||||
'default' => astra_get_option( $builder_type . '-html-' . $index ),
|
||||
'input_attrs' => array(
|
||||
'id' => $builder_type . '-html-' . $index,
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-' . $builder_type . '-html-' . $index,
|
||||
'render_callback' => array( $class_obj, $builder_type . '_html_' . $index ),
|
||||
'fallback_refresh' => false,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: HTML Color.
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-html-' . $index . 'color]',
|
||||
'default' => astra_get_option( $builder_type . '-html-' . $index . 'color' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'priority' => 8,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-html-' . $index . '-link-group]',
|
||||
'default' => astra_get_option( $builder_type . '-html-' . $index . '-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Link Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 8,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Color.
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-html-' . $index . 'link-color',
|
||||
'default' => astra_get_option( $builder_type . '-html-' . $index . 'link-color' ),
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'priority' => 9,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-html-' . $index . '-link-group]',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Hover Color.
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-html-' . $index . 'link-h-color',
|
||||
'default' => astra_get_option( $builder_type . '-html-' . $index . 'link-h-color' ),
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'priority' => 10,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-html-' . $index . '-link-group]',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 109,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 109,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
if ( 'footer' === $builder_type ) {
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-html-' . $index . '-alignment]',
|
||||
'default' => astra_get_option( 'footer-html-' . $index . '-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 6,
|
||||
'title' => __( 'Alignment', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'left' => 'align-left',
|
||||
'center' => 'align-center',
|
||||
'right' => 'align-right',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
);
|
||||
}
|
||||
|
||||
$html_config[] = Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, $builder_type );
|
||||
|
||||
$html_config[] = Astra_Builder_Base_Configuration::prepare_typography_options( $_section );
|
||||
|
||||
$html_config[] = $_configs;
|
||||
}
|
||||
|
||||
$html_config = call_user_func_array( 'array_merge', $html_config + array( array() ) );
|
||||
$configurations = array_merge( $configurations, $html_config );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Html_Component_Configs();
|
||||
@@ -0,0 +1,573 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Social_Icon_Component_Configs {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Configurations.
|
||||
* @param string $builder_type Builder Type.
|
||||
* @param string $section Section slug.
|
||||
* @since 3.0.0
|
||||
* @return array $configurations Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public static function register_configuration( $configurations, $builder_type = 'header', $section = 'section-hb-social-icons-' ) {
|
||||
|
||||
$social_configs = array();
|
||||
|
||||
$class_obj = Astra_Builder_Header::get_instance();
|
||||
$number_of_social_icons = Astra_Builder_Helper::$num_of_header_social_icons;
|
||||
|
||||
if ( 'footer' === $builder_type ) {
|
||||
$class_obj = Astra_Builder_Footer::get_instance();
|
||||
$number_of_social_icons = Astra_Builder_Helper::$num_of_footer_social_icons;
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_social_icons;
|
||||
} else {
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_social_icons;
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= $component_limit; $index++ ) {
|
||||
|
||||
$_section = $section . $index;
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 90,
|
||||
/* translators: 1: index */
|
||||
'title' => ( 1 === $number_of_social_icons ) ? __( 'Social Icons', 'astra' ) : sprintf( __( 'Social Icons %s', 'astra' ), $index ),
|
||||
'panel' => 'panel-' . $builder_type . '-builder-group',
|
||||
'clone_index' => $index,
|
||||
'clone_type' => $builder_type . '-social-icons',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-color-type]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-color-type' ),
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'title' => __( 'Color Type', 'astra' ),
|
||||
'priority' => 1,
|
||||
'choices' => array(
|
||||
'custom' => __( 'Custom', 'astra' ),
|
||||
'official' => __( 'Official', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-brand-color]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-brand-color' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Icon Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-brand-hover-toggle]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-color-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'official',
|
||||
),
|
||||
),
|
||||
'priority' => 1,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-brand-label-color]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-brand-label-color' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'title' => __( 'Label Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-brand-hover-toggle]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-color-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'official',
|
||||
),
|
||||
),
|
||||
'priority' => 1,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle Social Icons Brand Color On Hover.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-brand-hover-toggle]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-brand-hover-toggle' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Enable Brand Color On Hover', 'astra' ),
|
||||
'priority' => 1,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-color-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'official',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Group: Primary Social Colors Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-icon-color-group]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Icon Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 1,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-color-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'responsive' => true,
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-label-color-group]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Label Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 1,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-color-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'responsive' => true,
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-background-color-group]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 1,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-color-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'responsive' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Text Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-social-' . $index . '-color',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-icon-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 1,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Text Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-social-' . $index . '-h-color',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-icon-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 1,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Label Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-social-' . $index . '-label-color',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-label-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-label-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 1,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Label Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-social-' . $index . '-label-h-color',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-label-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-label-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 1,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-social-' . $index . '-bg-color',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-bg-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-background-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 1,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Background Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $builder_type . '-social-' . $index . '-bg-h-color',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-bg-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-background-color-group]',
|
||||
'section' => $_section,
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 1,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Icons.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-icons-' . $index . ']',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-social-icons',
|
||||
'title' => __( 'Social Icons', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 1,
|
||||
'default' => astra_get_option( $builder_type . '-social-icons-' . $index ),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-' . $builder_type . '-social-' . $index . '-wrap',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => array( $class_obj, $builder_type . '_social_' . $index ),
|
||||
'fallback_refresh' => false,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Show label Toggle.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-label-toggle]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-label-toggle' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'title' => __( 'Show Label', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-' . $builder_type . '-social-' . $index . '-wrap',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => array( $class_obj, $builder_type . '_social_' . $index ),
|
||||
'fallback_refresh' => false,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Social Icon Spacing
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-space]',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-space' ),
|
||||
'title' => __( 'Icon Spacing', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 50,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Social Icon Background Spacing.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-bg-space]',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-bg-space' ),
|
||||
'title' => __( 'Icon Background Space', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 50,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Social Icon Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-size]',
|
||||
'section' => $_section,
|
||||
'priority' => 1,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-size' ),
|
||||
'title' => __( 'Icon Size', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 50,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider ast-top-section-divider' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Radius Fields
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-radius-fields]',
|
||||
'default' => astra_get_option( $builder_type . '-social-' . $index . '-radius-fields' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Icon Radius', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'transport' => 'postMessage',
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 4,
|
||||
'connected' => false,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 49,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 49,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( 'footer' === $builder_type ) {
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-social-' . $index . '-alignment]',
|
||||
'default' => astra_get_option( 'footer-social-' . $index . '-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 6,
|
||||
'title' => __( 'Alignment', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'refresh',
|
||||
'choices' => array(
|
||||
'left' => 'align-left',
|
||||
'center' => 'align-center',
|
||||
'right' => 'align-right',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
);
|
||||
}
|
||||
|
||||
$social_configs[] = Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, $builder_type );
|
||||
|
||||
$social_configs[] = Astra_Builder_Base_Configuration::prepare_typography_options(
|
||||
$_section,
|
||||
array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[' . $builder_type . '-social-' . $index . '-label-toggle]',
|
||||
'operator' => '===',
|
||||
'value' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$social_configs[] = $_configs;
|
||||
}
|
||||
|
||||
$social_configs = call_user_func_array( 'array_merge', $social_configs + array( array() ) );
|
||||
$configurations = array_merge( $configurations, $social_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Social_Icon_Component_Configs();
|
||||
@@ -0,0 +1,566 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Builder Base Configuration.
|
||||
*
|
||||
* @package astra-builder
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Astra_Builder_Base_Configuration.
|
||||
*/
|
||||
final class Astra_Builder_Base_Configuration {
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var mixed instance
|
||||
*/
|
||||
private static $instance = null;
|
||||
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() { }
|
||||
|
||||
/**
|
||||
* Prepare Advance Typography configuration.
|
||||
*
|
||||
* @param string $section_id section id.
|
||||
* @param array $required_condition Required Condition.
|
||||
* @param array $divider_setup Required divider setup.
|
||||
* @return array
|
||||
*/
|
||||
public static function prepare_typography_options( $section_id, $required_condition = array(), $divider_setup = array() ) {
|
||||
|
||||
$parent = ASTRA_THEME_SETTINGS . '[' . $section_id . '-typography]';
|
||||
|
||||
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
array(
|
||||
'name' => $parent,
|
||||
'default' => astra_get_option( $section_id . '-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Text Font', 'astra' ),
|
||||
'section' => $section_id,
|
||||
'divider' => $divider_setup,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 16,
|
||||
'context' => empty( $required_condition ) ? Astra_Builder_Helper::$design_tab : $required_condition,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'font-size-' . $section_id,
|
||||
'type' => 'sub-control',
|
||||
'parent' => $parent,
|
||||
'section' => $section_id,
|
||||
'control' => 'ast-responsive-slider',
|
||||
'default' => astra_get_option( 'font-size-' . $section_id ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 15,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
} else {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[font-size-' . $section_id . ']',
|
||||
'section' => $section_id,
|
||||
'default' => astra_get_option( 'font-size-' . $section_id ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'priority' => 16,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'context' => empty( $required_condition ) ? Astra_Builder_Helper::$design_tab : $required_condition,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare Visibility options.
|
||||
*
|
||||
* @param string $_section section id.
|
||||
* @param string $builder_type Builder Type.
|
||||
* @return array
|
||||
*/
|
||||
public static function prepare_visibility_tab( $_section, $builder_type = 'header' ) {
|
||||
$astra_options = Astra_Theme_Options::get_astra_options();
|
||||
/**
|
||||
* Option: Visibility
|
||||
*/
|
||||
return array(
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-visibility-responsive]',
|
||||
'default' => astra_get_option(
|
||||
'' . $_section . '-visibility-responsive',
|
||||
array(
|
||||
'desktop' => ! isset( $astra_options[ '' . $_section . '-visibility-responsive' ] ) && isset( $astra_options[ '' . $_section . '-hide-desktop' ] ) ? ( $astra_options[ '' . $_section . '-hide-desktop' ] ? 0 : 1 ) : 1,
|
||||
'tablet' => ! isset( $astra_options[ '' . $_section . '-visibility-responsive' ] ) && isset( $astra_options[ '' . $_section . '-hide-tablet' ] ) ? ( $astra_options[ '' . $_section . '-hide-tablet' ] ? 0 : 1 ) : 1,
|
||||
'mobile' => ! isset( $astra_options[ '' . $_section . '-visibility-responsive' ] ) && isset( $astra_options[ '' . $_section . '-hide-mobile' ] ) ? ( $astra_options[ '' . $_section . '-hide-mobile' ] ? 0 : 1 ) : 1,
|
||||
)
|
||||
),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-multi-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 320,
|
||||
'title' => __( 'Visibility', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'refresh',
|
||||
'choices' => array(
|
||||
'desktop' => 'customizer-desktop',
|
||||
'tablet' => 'customizer-tablet',
|
||||
'mobile' => 'customizer-mobile',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare common options for the widgets by type.
|
||||
*
|
||||
* @param string $type type.
|
||||
* @return array
|
||||
*/
|
||||
public static function prepare_widget_options( $type = 'header' ) {
|
||||
$html_config = array();
|
||||
|
||||
if ( 'footer' === $type ) {
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ?
|
||||
Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_widgets;
|
||||
} else {
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ?
|
||||
Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_widgets;
|
||||
}
|
||||
$astra_has_widgets_block_editor = astra_has_widgets_block_editor();
|
||||
for ( $index = 1; $index <= $component_limit; $index++ ) {
|
||||
|
||||
$_section = ( ! $astra_has_widgets_block_editor ) ? 'sidebar-widgets-' . $type . '-widget-' . $index : 'astra-sidebar-widgets-' . $type . '-widget-' . $index;
|
||||
|
||||
$html_config[] = array(
|
||||
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'title' => __( 'Widget ', 'astra' ) . $index,
|
||||
'panel' => 'panel-' . $type . '-builder-group',
|
||||
'clone_index' => $index,
|
||||
'clone_type' => $type . '-widget',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 220,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => ' ast-section-spacing ' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( 'footer' === $type ) {
|
||||
$html_config [] = array(
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-alignment-' . $index . ']',
|
||||
'default' => astra_get_option( $type . '-widget-alignment-' . $index ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Alignment', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'left' => 'align-left',
|
||||
'center' => 'align-center',
|
||||
'right' => 'align-right',
|
||||
),
|
||||
'divider' => ( ! $astra_has_widgets_block_editor ) ? array( 'ast_class' => 'ast-top-divider' ) : array( 'ast_class' => 'ast-bottom-section-divider ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$html_config[] = array(
|
||||
|
||||
/**
|
||||
* Option: Widget title color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-title-color]',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-title-color' ),
|
||||
'title' => __( 'Heading Color', 'astra' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'priority' => 7,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'divider' => ( ! $astra_has_widgets_block_editor ) ? array( 'ast_class' => 'ast-top-divider' ) : array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'rgba' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Widget Color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-color]',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-color' ),
|
||||
'title' => __( 'Content Color', 'astra' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'priority' => 7,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-link-color-group]',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Link Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 7,
|
||||
'responsive' => true,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Widget link color.
|
||||
*/
|
||||
array(
|
||||
'name' => $type . '-widget-' . $index . '-link-color',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-link-color' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-link-color-group]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'priority' => 3,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Widget link color.
|
||||
*/
|
||||
array(
|
||||
'name' => $type . '-widget-' . $index . '-link-h-color',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-link-h-color' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-link-color-group]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'priority' => 1,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) {
|
||||
$html_config[] = array(
|
||||
|
||||
/**
|
||||
* Option: Widget Title Typography
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-text-typography]',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-text-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Heading Font', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 90,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Widget Title Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => $type . '-widget-' . $index . '-font-size',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-font-size' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-text-typography]',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-slider',
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'priority' => 2,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Widget Content Typography
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-content-typography]',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-content-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Content Font', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 91,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Widget Content Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => $type . '-widget-' . $index . '-content-font-size',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-content-font-size' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-content-typography]',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-slider',
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'priority' => 2,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
$html_config[] = array(
|
||||
|
||||
/**
|
||||
* Option: Widget Title Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-font-size]',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-font-size' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Title Font Size', 'astra' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-slider',
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'priority' => 90,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Widget Content Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $type . '-widget-' . $index . '-content-font-size]',
|
||||
'default' => astra_get_option( $type . '-widget-' . $index . '-content-font-size' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Content Font Size', 'astra' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-slider',
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'priority' => 91,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$html_config[] = self::prepare_visibility_tab( $_section, $type );
|
||||
|
||||
}
|
||||
|
||||
return call_user_func_array( 'array_merge', $html_config + array( array() ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare if class 'Astra_Builder_Base_Configuration' exist.
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
Astra_Builder_Base_Configuration::get_instance();
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Above footer.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Above footer Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Above_Footer_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Above Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_above_footer_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Above_Footer_Configs();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Below footer.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Below footer Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Below_Footer_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Below footer Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_below_footer_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Below_Footer_Configs();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Footer Copyright Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Copyright_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_copyright_footer_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Customizer_Copyright_Configs();
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail if Customizer config base class does not exist.
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Footer_Builder_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_builder_footer_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
new Astra_Customizer_Footer_Builder_Configs();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Footer_Menu_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_menu_footer_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating 'new' object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Footer_Menu_Configs();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Social Icons Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Footer_Social_Icons_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Social Icons Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_social_footer_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Customizer_Footer_Social_Icons_Configs();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Primary_Footer_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_primary_footer_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Primary_Footer_Configs();
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Footer_Button_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_button_footer_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Footer_Button_Component_Configs();
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Footer_Html_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_html_footer_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Footer_Html_Component_Configs();
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Footer_Widget_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_widget_footer_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Footer_Widget_Component_Configs();
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
/**
|
||||
* Above footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Above footer builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_above_footer_configuration() {
|
||||
$_section = 'section-above-footer-builder';
|
||||
|
||||
$column_count = range( 1, Astra_Builder_Helper::$num_of_footer_columns );
|
||||
$column_count = array_combine( $column_count, $column_count );
|
||||
|
||||
$_configs = array(
|
||||
|
||||
// Section: Above Footer.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Above Footer', 'astra' ),
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
'priority' => 30,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Column count
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-column]',
|
||||
'default' => astra_get_option( 'hba-footer-column' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'title' => __( 'Column', 'astra' ),
|
||||
'choices' => $column_count,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'partial' => array(
|
||||
'selector' => '.site-above-footer-wrap',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => array( Astra_Builder_Footer::get_instance(), 'above_footer' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Row Layout
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-layout]',
|
||||
'section' => $_section,
|
||||
'default' => astra_get_option( 'hba-footer-layout' ),
|
||||
'priority' => 3,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-row-layout',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'input_attrs' => array(
|
||||
'responsive' => true,
|
||||
'footer' => 'above',
|
||||
'layout' => Astra_Builder_Helper::$footer_row_layouts,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider ast-bottom-section-divider' ),
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Layout Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-layout-width]',
|
||||
'default' => astra_get_option( 'hba-footer-layout-width' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 25,
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'astra' ),
|
||||
'content' => __( 'Content Width', 'astra' ),
|
||||
),
|
||||
'suffix' => '',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Section: Above Footer Height.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-height]',
|
||||
'section' => $_section,
|
||||
'transport' => 'refresh',
|
||||
'default' => astra_get_option( 'hba-footer-height' ),
|
||||
'priority' => 30,
|
||||
'title' => __( 'Height', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'input_attrs' => array(
|
||||
'min' => 30,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Vertical Alignment
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-vertical-alignment]',
|
||||
'default' => astra_get_option( 'hba-footer-vertical-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 34,
|
||||
'title' => __( 'Vertical Alignment', 'astra' ),
|
||||
'choices' => array(
|
||||
'flex-start' => __( 'Top', 'astra' ),
|
||||
'center' => __( 'Middle', 'astra' ),
|
||||
'flex-end' => __( 'Bottom', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-stack]',
|
||||
'default' => astra_get_option( 'hba-stack' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Inner Elements Layout', 'astra' ),
|
||||
'choices' => array(
|
||||
'stack' => __( 'Stack', 'astra' ),
|
||||
'inline' => __( 'Inline', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Section: Above Footer Border.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-separator]',
|
||||
'section' => $_section,
|
||||
'priority' => 40,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-footer-separator' ),
|
||||
'title' => __( 'Top Border Size', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Section: Above Footer Border Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-top-border-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-footer-top-border-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => $_section,
|
||||
'priority' => 45,
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[hba-footer-separator]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Option: Above Footer Background styling.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-footer-bg-obj-responsive]',
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-background',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-footer-bg-obj-responsive' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'priority' => 70,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Inner Spacing
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-inner-spacing]',
|
||||
'section' => $_section,
|
||||
'priority' => 205,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-inner-spacing' ),
|
||||
'title' => __( 'Inner Column Spacing', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, 'footer' ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_above_footer_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
/**
|
||||
* Below footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register below footer builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_below_footer_configuration() {
|
||||
$_section = 'section-below-footer-builder';
|
||||
|
||||
$column_count = range( 1, Astra_Builder_Helper::$num_of_footer_columns );
|
||||
$column_count = array_combine( $column_count, $column_count );
|
||||
|
||||
$_configs = array(
|
||||
|
||||
// Section: Below Footer.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Below Footer', 'astra' ),
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
'priority' => 30,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Column count
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-column]',
|
||||
'default' => astra_get_option( 'hbb-footer-column' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'title' => __( 'Column', 'astra' ),
|
||||
'choices' => $column_count,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'partial' => array(
|
||||
'selector' => '.site-below-footer-wrap',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => array( Astra_Builder_Footer::get_instance(), 'below_footer' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Row Layout
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-layout]',
|
||||
'section' => $_section,
|
||||
'default' => astra_get_option( 'hbb-footer-layout' ),
|
||||
'priority' => 3,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-row-layout',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'input_attrs' => array(
|
||||
'responsive' => true,
|
||||
'footer' => 'below',
|
||||
'layout' => Astra_Builder_Helper::$footer_row_layouts,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Layout Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-layout-width]',
|
||||
'default' => astra_get_option( 'hbb-footer-layout-width' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 25,
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'astra' ),
|
||||
'content' => __( 'Content Width', 'astra' ),
|
||||
),
|
||||
'suffix' => '',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Section: Below Footer Height.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-height]',
|
||||
'section' => $_section,
|
||||
'transport' => 'refresh',
|
||||
'default' => astra_get_option( 'hbb-footer-height' ),
|
||||
'priority' => 30,
|
||||
'title' => __( 'Height', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 30,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Vertical Alignment
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-vertical-alignment]',
|
||||
'default' => astra_get_option( 'hbb-footer-vertical-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 34,
|
||||
'title' => __( 'Vertical Alignment', 'astra' ),
|
||||
'choices' => array(
|
||||
'flex-start' => __( 'Top', 'astra' ),
|
||||
'center' => __( 'Middle', 'astra' ),
|
||||
'flex-end' => __( 'Bottom', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-stack]',
|
||||
'default' => astra_get_option( 'hbb-stack' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Inner Elements Layout', 'astra' ),
|
||||
'choices' => array(
|
||||
'stack' => __( 'Stack', 'astra' ),
|
||||
'inline' => __( 'Inline', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
// Section: Below Footer Border.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-separator]',
|
||||
'section' => $_section,
|
||||
'priority' => 40,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-footer-separator' ),
|
||||
'title' => __( 'Top Border Size', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
// Section: Below Footer Border Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-top-border-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-footer-top-border-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => $_section,
|
||||
'priority' => 50,
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
ASTRA_THEME_SETTINGS . '[hbb-footer-separator]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Option: Below Footer Background styling.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-footer-bg-obj-responsive]',
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-background',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-footer-bg-obj-responsive' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'priority' => 70,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Inner Spacing
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-inner-spacing]',
|
||||
'section' => $_section,
|
||||
'priority' => 205,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-inner-spacing' ),
|
||||
'title' => __( 'Inner Column Spacing', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, 'footer' ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_below_footer_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Button footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register button footer builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_button_footer_configuration( $configurations = array() ) {
|
||||
$_configs = Astra_Button_Component_Configs::register_configuration( $configurations, 'footer', 'section-fb-button-' );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_button_footer_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register copyright footer builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_copyright_footer_configuration() {
|
||||
$_section = 'section-footer-copyright';
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Footer Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'title' => __( 'Copyright', 'astra' ),
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Copyright Html Editor.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-copyright-editor]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-html-editor',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 4,
|
||||
'default' => astra_get_option( 'footer-copyright-editor', 'Copyright [copyright] [current_year] [site_title] | Powered by [theme_author]' ),
|
||||
'input_attrs' => array(
|
||||
'id' => 'ast-footer-copyright',
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-footer-copyright',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => array( Astra_Builder_Footer::get_instance(), 'footer_copyright' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Column Alignment
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-copyright-alignment]',
|
||||
'default' => astra_get_option( 'footer-copyright-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 6,
|
||||
'title' => __( 'Alignment', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'left' => 'align-left',
|
||||
'center' => 'align-center',
|
||||
'right' => 'align-right',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Text Color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-copyright-color]',
|
||||
'default' => astra_get_option( 'footer-copyright-color' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'priority' => 8,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 99,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 220,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_typography_options( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, 'footer' ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_copyright_footer_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,337 @@
|
||||
<?php
|
||||
/**
|
||||
* Footer Builder Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register builder footer builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_builder_footer_configuration( $configurations = array() ) {
|
||||
$cloned_component_track = Astra_Builder_Helper::$component_count_array;
|
||||
$widget_config = array();
|
||||
$astra_has_widgets_block_editor = astra_has_widgets_block_editor();
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_footer_html; $index++ ) {
|
||||
|
||||
$footer_html_section = 'section-fb-html-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $footer_html_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
Astra_Builder_Helper::$footer_desktop_items[ 'html-' . $index ] = array(
|
||||
'name' => 'HTML ' . $index,
|
||||
'icon' => 'editor-code',
|
||||
'section' => $footer_html_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'html',
|
||||
'builder' => 'footer',
|
||||
);
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_footer_widgets; $index++ ) {
|
||||
|
||||
$footer_widget_section = 'sidebar-widgets-footer-widget-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $footer_widget_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
Astra_Builder_Helper::$footer_desktop_items[ 'widget-' . $index ] = array(
|
||||
'name' => 'Widget ' . $index,
|
||||
'icon' => 'screenoptions',
|
||||
'section' => $footer_widget_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'widget',
|
||||
'builder' => 'footer',
|
||||
);
|
||||
|
||||
if ( $astra_has_widgets_block_editor ) {
|
||||
$widget_config[] = array(
|
||||
'name' => $footer_widget_section,
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $astra_has_widgets_block_editor ) {
|
||||
$configurations = array_merge( $configurations, $widget_config );
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_footer_button; $index++ ) {
|
||||
|
||||
$footer_button_section = 'section-fb-button-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $footer_button_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
Astra_Builder_Helper::$footer_desktop_items[ 'button-' . $index ] = array(
|
||||
'name' => ( 1 === Astra_Builder_Helper::$num_of_footer_button ) ? 'Button' : 'Button ' . $index,
|
||||
'icon' => 'button',
|
||||
'section' => $footer_button_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'button',
|
||||
'builder' => 'footer',
|
||||
);
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_footer_social_icons; $index++ ) {
|
||||
|
||||
$footer_social_section = 'section-fb-social-icons-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $footer_social_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
Astra_Builder_Helper::$footer_desktop_items[ 'social-icons-' . $index ] = array(
|
||||
'name' => ( 1 === Astra_Builder_Helper::$num_of_footer_social_icons ) ? 'Social' : 'Social ' . $index,
|
||||
'icon' => 'share',
|
||||
'section' => $footer_social_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'social-icons',
|
||||
'builder' => 'footer',
|
||||
);
|
||||
}
|
||||
|
||||
$zone_base = array( 'above', 'primary', 'below' );
|
||||
$zones = array(
|
||||
'above' => array(),
|
||||
'primary' => array(),
|
||||
'below' => array(),
|
||||
);
|
||||
|
||||
foreach ( $zone_base as $key => $base ) {
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_footer_columns; $index++ ) {
|
||||
$zones[ $base ][ $base . '_' . $index ] = ucfirst( $base ) . ' Section ' . $index;
|
||||
}
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
array(
|
||||
'name' => 'panel-footer-builder-group',
|
||||
'type' => 'panel',
|
||||
'priority' => 60,
|
||||
'title' => __( 'Footer Builder', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Layout
|
||||
*/
|
||||
array(
|
||||
'name' => 'section-footer-builder-layout',
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'title' => __( 'Footer Layout', 'astra' ),
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => 'section-footer-builder-layout-ast-context-tabs',
|
||||
'section' => 'section-footer-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/*
|
||||
* Header Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => 'section-footer-builder',
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'title' => __( 'Footer Builder', 'astra' ),
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'ast_selected_tab',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'general', 'design' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Builder
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[builder-footer]',
|
||||
'section' => 'section-footer-builder',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 20,
|
||||
'description' => '',
|
||||
'context' => array(),
|
||||
'divider' => ( astra_showcase_upgrade_notices() ) ? array() : array( 'ast_class' => 'ast-pro-available' ),
|
||||
),
|
||||
|
||||
// Group Option: Global Footer Background styling.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-bg-obj-responsive]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'default' => astra_get_option( 'footer-bg-obj-responsive' ),
|
||||
'section' => 'section-footer-builder-layout',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 70,
|
||||
'title' => __( 'Background Color-Image', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Footer Background Color notice.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-bg-obj-responsive-description]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-footer-builder-layout',
|
||||
'priority' => 71,
|
||||
'label' => '',
|
||||
'help' => __( 'If this color setting is not reflecting, check if colors are set from dedicated above, below or primary footer settings.', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Desktop Items.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-desktop-items]',
|
||||
'section' => 'section-footer-builder',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder',
|
||||
'title' => __( 'Footer Builder', 'astra' ),
|
||||
'priority' => 10,
|
||||
'default' => astra_get_option( 'footer-desktop-items' ),
|
||||
'choices' => Astra_Builder_Helper::$footer_desktop_items,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.site-footer',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => array( Astra_Builder_Footer::get_instance(), 'footer_markup' ),
|
||||
),
|
||||
'input_attrs' => array(
|
||||
'group' => ASTRA_THEME_SETTINGS . '[footer-desktop-items]',
|
||||
'rows' => array( 'above', 'primary', 'below' ),
|
||||
'zones' => $zones,
|
||||
'layouts' => array(
|
||||
'above' => array(
|
||||
'column' => astra_get_option( 'hba-footer-column' ),
|
||||
'layout' => astra_get_option( 'hba-footer-layout' ),
|
||||
),
|
||||
'primary' => array(
|
||||
'column' => astra_get_option( 'hb-footer-column' ),
|
||||
'layout' => astra_get_option( 'hb-footer-layout' ),
|
||||
),
|
||||
'below' => array(
|
||||
'column' => astra_get_option( 'hbb-footer-column' ),
|
||||
'layout' => astra_get_option( 'hbb-footer-layout' ),
|
||||
),
|
||||
),
|
||||
'status' => array(
|
||||
'above' => true,
|
||||
'primary' => true,
|
||||
'below' => true,
|
||||
),
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'ast_selected_tab',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'general', 'design' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Footer Available draggable items.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-draggable-items]',
|
||||
'section' => 'section-footer-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-draggable-items',
|
||||
'priority' => 10,
|
||||
'input_attrs' => array(
|
||||
'group' => ASTRA_THEME_SETTINGS . '[footer-desktop-items]',
|
||||
'zones' => array( 'above', 'primary', 'below' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( astra_showcase_upgrade_notices() ) {
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-builder-pro-items]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-upgrade',
|
||||
'campaign' => 'footer-builder',
|
||||
'renderAs' => 'list',
|
||||
'choices' => array(
|
||||
'two' => array(
|
||||
'title' => __( 'Divider element', 'astra' ),
|
||||
),
|
||||
'three' => array(
|
||||
'title' => __( 'Language Switcher element', 'astra' ),
|
||||
),
|
||||
'five' => array(
|
||||
'title' => __( 'Clone, Delete element options', 'astra' ),
|
||||
),
|
||||
'six' => array(
|
||||
'title' => __( 'Increased element count', 'astra' ),
|
||||
),
|
||||
'seven' => array(
|
||||
'title' => __( 'More design options', 'astra' ),
|
||||
),
|
||||
),
|
||||
'section' => 'section-footer-builder-layout',
|
||||
'default' => '',
|
||||
'context' => array(),
|
||||
'priority' => 999,
|
||||
'title' => __( 'Finish your page on a high with amazing website footers', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( 'section-footer-builder-layout' ) );
|
||||
|
||||
$_configs = array_merge( $_configs, $configurations );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_builder_footer_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* HTML footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register html footer builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_html_footer_configuration( $configurations = array() ) {
|
||||
$_configs = Astra_Html_Component_Configs::register_configuration( $configurations, 'footer', 'section-fb-html-' );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_html_footer_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,409 @@
|
||||
<?php
|
||||
/**
|
||||
* Menu footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register menu footer builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_menu_footer_configuration() {
|
||||
$_section = 'section-footer-menu';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
|
||||
),
|
||||
|
||||
// Section: Primary Header.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Footer Menu', 'astra' ),
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
'priority' => 50,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme Menu create link
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-create-menu-link]',
|
||||
'default' => astra_get_option( 'footer-create-menu-link' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => $_section,
|
||||
'priority' => 10,
|
||||
'link_type' => 'section',
|
||||
'linked' => 'menu_locations',
|
||||
'link_text' => __( 'Configure Menu from Here.', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
|
||||
),
|
||||
|
||||
|
||||
// Option: Footer Menu Layout.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-menu-layout]',
|
||||
'default' => astra_get_option( 'footer-menu-layout' ),
|
||||
'section' => $_section,
|
||||
'priority' => 20,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.footer-widget-area[data-section="section-footer-menu"] nav',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => array( Astra_Builder_Footer::get_instance(), 'footer_menu' ),
|
||||
),
|
||||
'choices' => array(
|
||||
'horizontal' => __( 'Inline', 'astra' ),
|
||||
'vertical' => __( 'Stack', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'responsive' => true,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Alignment
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-menu-alignment]',
|
||||
'default' => astra_get_option( 'footer-menu-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 21,
|
||||
'title' => __( 'Alignment', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'flex-start' => 'align-left',
|
||||
'center' => 'align-center',
|
||||
'flex-end' => 'align-right',
|
||||
),
|
||||
),
|
||||
|
||||
// Option Group: Menu Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-menu-link-colors]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Link / Text', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 90,
|
||||
'responsive' => true,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-menu-background-colors]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 90,
|
||||
'responsive' => true,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
// Option: Menu Color.
|
||||
array(
|
||||
'name' => 'footer-menu-color-responsive',
|
||||
'default' => astra_get_option( 'footer-menu-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-menu-link-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 7,
|
||||
),
|
||||
|
||||
// Option: Menu Background image, color.
|
||||
array(
|
||||
'name' => 'footer-menu-bg-obj-responsive',
|
||||
'default' => astra_get_option( 'footer-menu-bg-obj-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-menu-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'data_attrs' => array( 'name' => 'footer-menu-bg-obj-responsive' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'label' => __( 'Normal', 'astra' ),
|
||||
'priority' => 9,
|
||||
),
|
||||
|
||||
// Option: Menu Hover Color.
|
||||
array(
|
||||
'name' => 'footer-menu-h-color-responsive',
|
||||
'default' => astra_get_option( 'footer-menu-h-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-menu-link-colors]',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'section' => $_section,
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 19,
|
||||
),
|
||||
|
||||
// Option: Menu Hover Background Color.
|
||||
array(
|
||||
'name' => 'footer-menu-h-bg-color-responsive',
|
||||
'default' => astra_get_option( 'footer-menu-h-bg-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-menu-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 21,
|
||||
),
|
||||
|
||||
// Option: Active Menu Color.
|
||||
array(
|
||||
'name' => 'footer-menu-a-color-responsive',
|
||||
'default' => astra_get_option( 'footer-menu-a-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-menu-link-colors]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Active', 'astra' ),
|
||||
'title' => __( 'Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 31,
|
||||
),
|
||||
|
||||
// Option: Active Menu Background Color.
|
||||
array(
|
||||
'name' => 'footer-menu-a-bg-color-responsive',
|
||||
'default' => astra_get_option( 'footer-menu-a-bg-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-menu-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Active', 'astra' ),
|
||||
'tab' => __( 'Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 33,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-main-menu-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 210,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option - Menu Space.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-main-menu-spacing]',
|
||||
'default' => astra_get_option( 'footer-main-menu-spacing' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'priority' => 210,
|
||||
'title' => __( 'Menu Spacing', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider ast-section-spacing' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 220,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) {
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
|
||||
$new_configs = array(
|
||||
|
||||
// Option Group: Menu Typography.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-menu-typography]',
|
||||
'default' => astra_get_option( 'footer-menu-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Menu Font', 'astra' ),
|
||||
'section' => $_section,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 120,
|
||||
),
|
||||
|
||||
// Option: Menu Font Size.
|
||||
|
||||
array(
|
||||
'name' => 'footer-menu-font-size',
|
||||
'default' => astra_get_option( 'footer-menu-font-size' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-menu-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'priority' => 23,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
|
||||
$new_configs = array(
|
||||
|
||||
// Option: Menu Font Size.
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-menu-font-size]',
|
||||
'default' => astra_get_option( 'footer-menu-font-size' ),
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-slider',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Menu Font Size', 'astra' ),
|
||||
'priority' => 120,
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array_merge( $_configs, $new_configs );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, 'footer' ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_menu_footer_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
<?php
|
||||
/**
|
||||
* Primary footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register primary footer builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_primary_footer_configuration() {
|
||||
$_section = 'section-primary-footer-builder';
|
||||
|
||||
$column_count = range( 1, Astra_Builder_Helper::$num_of_footer_columns );
|
||||
$column_count = array_combine( $column_count, $column_count );
|
||||
|
||||
$_configs = array(
|
||||
|
||||
// Section: Primary Footer.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Primary Footer', 'astra' ),
|
||||
'panel' => 'panel-footer-builder-group',
|
||||
'priority' => 20,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Column count
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-footer-column]',
|
||||
'default' => astra_get_option( 'hb-footer-column' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'title' => __( 'Column', 'astra' ),
|
||||
'choices' => $column_count,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.site-primary-footer-wrap',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => array( Astra_Builder_Footer::get_instance(), 'primary_footer' ),
|
||||
),
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Row Layout
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-footer-layout]',
|
||||
'section' => $_section,
|
||||
'default' => astra_get_option( 'hb-footer-layout' ),
|
||||
'priority' => 3,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-row-layout',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'input_attrs' => array(
|
||||
'responsive' => true,
|
||||
'footer' => 'primary',
|
||||
'layout' => Astra_Builder_Helper::$footer_row_layouts,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Layout Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-footer-layout-width]',
|
||||
'default' => astra_get_option( 'hb-footer-layout-width' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 25,
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'astra' ),
|
||||
'content' => __( 'Content Width', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Section: Primary Footer Height.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-primary-footer-height]',
|
||||
'section' => $_section,
|
||||
'transport' => 'refresh',
|
||||
'default' => astra_get_option( 'hb-primary-footer-height' ),
|
||||
'priority' => 30,
|
||||
'title' => __( 'Height', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'input_attrs' => array(
|
||||
'min' => 30,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Vertical Alignment
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-footer-vertical-alignment]',
|
||||
'default' => astra_get_option( 'hb-footer-vertical-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 30,
|
||||
'title' => __( 'Vertical Alignment', 'astra' ),
|
||||
'choices' => array(
|
||||
'flex-start' => __( 'Top', 'astra' ),
|
||||
'center' => __( 'Middle', 'astra' ),
|
||||
'flex-end' => __( 'Bottom', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-stack]',
|
||||
'default' => astra_get_option( 'hb-stack' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Inner Elements Layout', 'astra' ),
|
||||
'choices' => array(
|
||||
'stack' => __( 'Stack', 'astra' ),
|
||||
'inline' => __( 'Inline', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Option: Footer Separator.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-footer-main-sep]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hb-footer-main-sep' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'section' => $_section,
|
||||
'priority' => 4,
|
||||
'title' => __( 'Top Border Size', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
// Option: Footer Top Boder Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-footer-main-sep-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hb-footer-main-sep-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[hb-footer-main-sep]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Sub Option: Footer Background.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-footer-bg-obj-responsive]',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 7,
|
||||
'data_attrs' => array(
|
||||
'name' => 'hb-footer-bg-obj-responsive',
|
||||
),
|
||||
'default' => astra_get_option( 'hb-footer-bg-obj-responsive' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Inner Spacing
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-inner-spacing]',
|
||||
'section' => $_section,
|
||||
'priority' => 205,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hb-inner-spacing' ),
|
||||
'title' => __( 'Inner Column Spacing', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section, 'footer' ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_primary_footer_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Social footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register social footer builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_social_footer_configuration( $configurations = array() ) {
|
||||
|
||||
$_configs = Astra_Social_Icon_Component_Configs::register_configuration( $configurations, 'footer', 'section-fb-social-icons-' );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_social_footer_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Widget footer Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register widget footer builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_widget_footer_configuration( $configurations = array() ) {
|
||||
$widget_config = Astra_Builder_Base_Configuration::prepare_widget_options( 'footer' );
|
||||
$configurations = array_merge( $configurations, $widget_config );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_footer_customizer_configs', $configurations );
|
||||
}
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_widget_footer_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Above Header.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Above Header Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Above_Header_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Above Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_above_header_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Above_Header_Configs();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Below Header.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Below Header Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Below_Header_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Below Header Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_below_header_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Below_Header_Configs();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration for EDD Cart Element.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Edd_Cart_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
if ( is_callable( 'astra_edd_cart_header_configuration' ) ) {
|
||||
$configurations = astra_edd_cart_header_configuration( $configurations );
|
||||
}
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Customizer_Edd_Cart_Configs();
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail if Customizer config base class does not exist.
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Header_Builder_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_header_header_builder_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
new Astra_Customizer_Header_Builder_Configs();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Header_Widget_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$html_config = astra_header_widget_configuration();
|
||||
$configurations = array_merge( $configurations, $html_config );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Customizer_Header_Widget_Configs();
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Mobile_Trigger_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_header_mobile_trigger_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Customizer_Mobile_Trigger_Configs();
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Off Canvas.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Off Canvas Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Off_Canvas_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Above Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_header_off_canvas_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Off_Canvas_Configs();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Primary_Header_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_primary_header_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Primary_Header_Configs();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Site Identity.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Site Identity Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Site_Identity_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Site Identity Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_header_site_identity_configuration();
|
||||
|
||||
$wp_customize->remove_control( 'astra-settings[divider-section-site-identity-logo]' );
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Customizer_Site_Identity_Configs();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Customizer_Woo_Cart_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
if ( is_callable( 'astra_header_woo_cart_configuration' ) ) {
|
||||
$configurations = astra_header_woo_cart_configuration( $configurations );
|
||||
}
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Customizer_Woo_Cart_Configs();
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Header_Account_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_header_account_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Header_Account_Component_Configs();
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* [Header] options for astra theme.
|
||||
*
|
||||
* @package Astra Header Footer Builder
|
||||
* @link https://www.brainstormforce.com
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// Block direct access to the file.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register below header Configurations.
|
||||
*/
|
||||
class Astra_Header_Button_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Button control for Header/Footer Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_header_button_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Header_Button_Component_Configs();
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Header_Html_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_header_html_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Header_Html_Component_Configs();
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Header_Menu_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$menu_config = astra_header_menu_configuration();
|
||||
$configurations = array_merge( $configurations, $menu_config );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Header_Menu_Component_Configs();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Header_Search_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_header_search_configuration();
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Header_Search_Component_Configs();
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Header_Social_Icon_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$configurations = astra_header_social_configuration( $configurations );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
|
||||
new Astra_Header_Social_Icon_Component_Configs();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Builder.
|
||||
*
|
||||
* @package astra-builder
|
||||
* @link https://wpastra.com/
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class Astra_Mobile_Menu_Component_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Builder Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = astra_header_mobile_menu_configuration();
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating object of this class.
|
||||
*/
|
||||
new Astra_Mobile_Menu_Component_Configs();
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* Above Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Above header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_above_header_configuration() {
|
||||
$_section = 'section-above-header-builder';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
// Section: Above Header.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Above Header', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
'priority' => 30,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
// Section: Above Header Height.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-header-height]',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-header-height' ),
|
||||
'priority' => 30,
|
||||
'title' => __( 'Height', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 30,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Above Header Background styling.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-header-bg-obj-responsive]',
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-background',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-header-bg-obj-responsive' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'description' => __( 'It would not be effective if transparent header is enabled.', 'astra' ),
|
||||
'priority' => 40,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Section: Above Header Border Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-header-bottom-border-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-header-bottom-border-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => $_section,
|
||||
'priority' => 40,
|
||||
'title' => __( 'Bottom Border Color', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[hba-header-separator]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Section: Above Header Border.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hba-header-separator]',
|
||||
'section' => $_section,
|
||||
'priority' => 40,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hba-header-separator' ),
|
||||
'title' => __( 'Bottom Border Size', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 10,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_above_header_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,658 @@
|
||||
<?php
|
||||
/**
|
||||
* Account Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register account header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_account_configuration() {
|
||||
$_section = 'section-header-account';
|
||||
|
||||
$account_choices = array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
);
|
||||
|
||||
$login_link_context = Astra_Builder_Helper::$general_tab;
|
||||
|
||||
$logout_link_context = array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
);
|
||||
|
||||
if ( defined( 'ASTRA_EXT_VER' ) ) {
|
||||
|
||||
$account_type_condition = array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'link',
|
||||
);
|
||||
|
||||
if ( class_exists( 'LifterLMS' ) ) {
|
||||
$account_choices['lifterlms'] = __( 'LifterLMS', 'astra' );
|
||||
}
|
||||
|
||||
if ( class_exists( 'WooCommerce' ) ) {
|
||||
$account_choices['woocommerce'] = __( 'WooCommerce', 'astra' );
|
||||
}
|
||||
|
||||
if ( count( $account_choices ) > 1 ) {
|
||||
$account_type_condition = array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'default',
|
||||
);
|
||||
}
|
||||
|
||||
$login_link_context = array(
|
||||
'relation' => 'AND',
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-action-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'link',
|
||||
),
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
$account_type_condition,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-link-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$logout_link_context = array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-action]',
|
||||
'operator' => '==',
|
||||
'value' => 'link',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Header Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 80,
|
||||
'title' => __( 'Account', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-tabs]',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Log In view
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-login-heading]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'priority' => 1,
|
||||
'title' => __( 'Logged In View', 'astra' ),
|
||||
'settings' => array(),
|
||||
'input_attrs' => array(
|
||||
'class' => 'ast-control-reduce-top-space',
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Style
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'default' => astra_get_option( 'header-account-login-style' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 3,
|
||||
'title' => __( 'Profile Type', 'astra' ),
|
||||
'choices' => array(
|
||||
'icon' => __( 'Icon', 'astra' ),
|
||||
'avatar' => __( 'Avatar', 'astra' ),
|
||||
'text' => __( 'Text', 'astra' ),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider ast-section-spacing' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Show Text with
|
||||
*
|
||||
* @since 4.6.15
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-login-style-extend-text-profile-type]',
|
||||
'default' => astra_get_option( 'header-account-login-style-extend-text-profile-type' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 3,
|
||||
'description' => __( 'Choose if you want to display Icon or Avatar with the Text selected Profile Type.', 'astra' ),
|
||||
'title' => __( 'Show Text with', 'astra' ),
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'avatar' => __( 'Avatar', 'astra' ),
|
||||
'icon' => __( 'Icon', 'astra' ),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider ast-section-spacing' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Logged Out Text
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-logged-in-text]',
|
||||
'default' => astra_get_option( 'header-account-logged-in-text' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-text-input',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Text', 'astra' ),
|
||||
'priority' => 3,
|
||||
'transport' => 'postMessage',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Account Log In Link
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-login-link]',
|
||||
'default' => astra_get_option( 'header-account-login-link' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-link',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_link' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Account URL', 'astra' ),
|
||||
'priority' => 6,
|
||||
'transport' => 'postMessage',
|
||||
'context' => $login_link_context,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Log Out view
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-logout-heading]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Logged Out View', 'astra' ),
|
||||
'priority' => 200,
|
||||
'settings' => array(),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Style
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'default' => astra_get_option( 'header-account-logout-style' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Profile Type', 'astra' ),
|
||||
'priority' => 201,
|
||||
'choices' => array(
|
||||
'none' => __( 'None', 'astra' ),
|
||||
'icon' => __( 'Icon', 'astra' ),
|
||||
'text' => __( 'Text', 'astra' ),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Show Text with
|
||||
*
|
||||
* @since 4.6.15
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-logout-style-extend-text-profile-type]',
|
||||
'default' => astra_get_option( 'header-account-logout-style-extend-text-profile-type' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 202,
|
||||
'description' => __( 'Choose if you want to display Icon with the Text selected Profile Type for logged out users.', 'astra' ),
|
||||
'title' => __( 'Show Text with', 'astra' ),
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'icon' => __( 'Icon', 'astra' ),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider ast-section-spacing' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
// Option: Logged out options preview.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-logout-preview]',
|
||||
'default' => astra_get_option( 'header-account-logout-preview' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Preview', 'astra' ),
|
||||
'priority' => 206,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Logged Out Text
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-logged-out-text]',
|
||||
'default' => astra_get_option( 'header-account-logged-out-text' ),
|
||||
'type' => 'control',
|
||||
'control' => 'text',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Text', 'astra' ),
|
||||
'priority' => 203,
|
||||
'transport' => 'postMessage',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-account',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_account' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Account Log Out Link
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-logout-link]',
|
||||
'default' => astra_get_option( 'header-account-logout-link' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-link',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_link' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Login URL', 'astra' ),
|
||||
'priority' => 205,
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
$logout_link_context,
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Image Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-image-width]',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-account-image-width' ),
|
||||
'title' => __( 'Avatar Width', 'astra' ),
|
||||
'type' => 'control',
|
||||
'divider' => defined( 'ASTRA_EXT_VER' ) ? array( 'ast_class' => 'ast-bottom-spacing' ) : array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 100,
|
||||
),
|
||||
'suffix' => 'px',
|
||||
'context' => array(
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'avatar',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style-extend-text-profile-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'avatar',
|
||||
),
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style-extend-text-profile-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'avatar',
|
||||
),
|
||||
),
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: account Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-icon-size]',
|
||||
'section' => $_section,
|
||||
'priority' => 4,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-account-icon-size' ),
|
||||
'title' => __( 'Icon Size', 'astra' ),
|
||||
'type' => 'control',
|
||||
'suffix' => 'px',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 50,
|
||||
),
|
||||
'context' => array(
|
||||
/**
|
||||
* Other conditions are maintained from "inc/customizer/custom-controls/class-astra-customizer-control-base.php".
|
||||
*/
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'icon',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'icon',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: account Color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-icon-color]',
|
||||
'default' => astra_get_option( 'header-account-icon-color' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-color',
|
||||
'divider' => defined( 'ASTRA_EXT_VER' ) ? array( 'ast_class' => 'ast-bottom-spacing' ) : array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Icon Color', 'astra' ),
|
||||
'context' => array(
|
||||
/**
|
||||
* Other conditions are maintained from "inc/customizer/custom-controls/class-astra-customizer-control-base.php".
|
||||
*/
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'icon',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'icon',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Text design options.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-text-design-options]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'priority' => 15,
|
||||
'title' => __( 'Text Options', 'astra' ),
|
||||
'settings' => array(),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: account Color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-type-text-color]',
|
||||
'default' => astra_get_option( 'header-account-type-text-color' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'priority' => 18,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-color',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-spacing ast-section-spacing' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Profile Text Color', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-spacing-divider]',
|
||||
'section' => 'section-header-account',
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 510,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-account-margin]',
|
||||
'default' => astra_get_option( 'header-account-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 511,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge(
|
||||
$_configs,
|
||||
Astra_Builder_Base_Configuration::prepare_typography_options(
|
||||
$_section,
|
||||
array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-login-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-account-logout-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'text',
|
||||
),
|
||||
),
|
||||
),
|
||||
array( 'ast_class' => 'ast-section-spacing' )
|
||||
)
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_account_configuration' );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
* Below Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register below header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_below_header_configuration() {
|
||||
$_section = 'section-below-header-builder';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
// Section: Below Header.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Below Header', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
'priority' => 30,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
// Section: Below Header Height.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-header-height]',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-header-height' ),
|
||||
'priority' => 30,
|
||||
'title' => __( 'Height', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 30,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Below Header Background styling.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-header-bg-obj-responsive]',
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-background',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-header-bg-obj-responsive' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'description' => __( 'It would not be effective if transparent header is enabled.', 'astra' ),
|
||||
'priority' => 40,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Section: Below Header Border Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-header-bottom-border-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-header-bottom-border-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => $_section,
|
||||
'priority' => 40,
|
||||
'title' => __( 'Bottom Border Color', 'astra' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[hbb-header-separator]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
// Section: Below Header Border.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hbb-header-separator]',
|
||||
'section' => $_section,
|
||||
'priority' => 40,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hbb-header-separator' ),
|
||||
'title' => __( 'Bottom Border Size', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 10,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_below_header_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Button Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register button header builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_button_configuration( $configurations = array() ) {
|
||||
|
||||
$_configs = Astra_Button_Component_Configs::register_configuration( $configurations, 'header', 'section-hb-button-' );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_button_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,379 @@
|
||||
<?php
|
||||
/**
|
||||
* EDD Cart Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register EDD Cart header builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_edd_cart_header_configuration( $configurations = array() ) {
|
||||
$_section = ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 'section-header-edd-cart' : 'section-edd-general';
|
||||
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
$_cart_total_divider = array( 'ast_class' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'edd' ) ) ? 'ast-top-section-divider' : 'ast-section-spacing' );
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* EDD Cart section
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'title' => __( 'EDD Cart', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header cart total
|
||||
*/
|
||||
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[edd-header-cart-total-display]',
|
||||
'default' => astra_get_option( 'edd-header-cart-total-display' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Display Cart Total', 'astra' ),
|
||||
'priority' => 50,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-edd-cart',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => array( 'Astra_Builder_Header', 'header_edd_cart' ),
|
||||
),
|
||||
'divider' => $_cart_total_divider,
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Cart Title
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[edd-header-cart-title-display]',
|
||||
'default' => astra_get_option( 'edd-header-cart-title-display' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Display Cart Title', 'astra' ),
|
||||
'priority' => 55,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-header-edd-cart',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => array( 'Astra_Builder_Header', 'header_edd_cart' ),
|
||||
),
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
/**
|
||||
* Option: Icon Style
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[edd-header-cart-icon-style]',
|
||||
'default' => astra_get_option( 'edd-header-cart-icon-style' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Style', 'astra' ),
|
||||
'control' => 'ast-selector',
|
||||
'priority' => 40,
|
||||
'choices' => array(
|
||||
'outline' => __( 'Outline', 'astra' ),
|
||||
'fill' => __( 'Fill', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Background color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[edd-header-cart-icon-color]',
|
||||
'default' => astra_get_option( 'edd-header-cart-icon-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Color', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[edd-header-cart-icon-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
),
|
||||
'priority' => 45,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Border Radius
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[edd-header-cart-icon-radius]',
|
||||
'default' => astra_get_option( 'edd-header-cart-icon-radius' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[edd-header-cart-icon-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
),
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'control' => 'ast-slider',
|
||||
'priority' => 47,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Icon color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-edd-cart-icon-color]',
|
||||
'default' => astra_get_option( 'transparent-header-edd-cart-icon-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'EDD Cart Icon Color', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[edd-header-cart-icon-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'none',
|
||||
),
|
||||
),
|
||||
'section' => 'section-transparent-header',
|
||||
'priority' => 95,
|
||||
),
|
||||
);
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
$_edd_configs = array(
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: EDD cart tray Section divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[section-edd-cart-tray-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Cart Tray', 'astra' ),
|
||||
'priority' => 60,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Cart Link / Text Color.
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-edd-cart-colors]',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'name' => 'header-edd-cart-text-color',
|
||||
'default' => astra_get_option( 'header-edd-cart-text-color' ),
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 65,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Cart Link / Text Color.
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-edd-cart-colors]',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'name' => 'header-edd-cart-link-color',
|
||||
'default' => astra_get_option( 'header-edd-cart-link-color' ),
|
||||
'title' => __( 'Link Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 65,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Cart Background Color.
|
||||
array(
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-edd-cart-background-color]',
|
||||
'default' => astra_get_option( 'header-edd-cart-background-color' ),
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 65,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Cart Separator Color.
|
||||
array(
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-edd-cart-separator-color]',
|
||||
'default' => astra_get_option( 'header-edd-cart-separator-color' ),
|
||||
'title' => __( 'Separator Color', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 65,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Checkout Button colors.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-edd-checkout-button-text-colors]',
|
||||
'default' => astra_get_option( 'header-edd-checkout-button-text-colors' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Button Text', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 75,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => array(
|
||||
'ast_class' => 'ast-top-dotted-divider',
|
||||
'ast_title' => __( 'Checkout', 'astra' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-edd-checkout-button-background-colors]',
|
||||
'default' => astra_get_option( 'header-edd-checkout-button-background-colors' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Button Background', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 75,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
),
|
||||
// Option: Checkout Button Text Color.
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-edd-checkout-button-text-colors]',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'name' => 'header-edd-checkout-btn-text-color',
|
||||
'default' => astra_get_option( 'header-edd-checkout-btn-text-color' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 75,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Checkout Button Background Color.
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-edd-checkout-button-background-colors]',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'name' => 'header-edd-checkout-btn-background-color',
|
||||
'default' => astra_get_option( 'header-edd-checkout-btn-background-color' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 75,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Checkout Button Hover Text Color.
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-edd-checkout-button-text-colors]',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'name' => 'header-edd-checkout-btn-text-hover-color',
|
||||
'default' => astra_get_option( 'header-edd-checkout-btn-text-hover-color' ),
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 75,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Checkout Button Hover Background Color.
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-edd-checkout-button-background-colors]',
|
||||
'section' => $_section,
|
||||
'name' => 'header-edd-checkout-btn-bg-hover-color',
|
||||
'default' => astra_get_option( 'header-edd-checkout-btn-bg-hover-color' ),
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 75,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $_edd_configs );
|
||||
|
||||
$configurations = array_merge( $configurations, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, $configurations );
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_edd_cart_header_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,770 @@
|
||||
<?php
|
||||
/**
|
||||
* Header Builder Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register header_builder header builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_header_builder_configuration( $configurations = array() ) {
|
||||
$cloned_component_track = Astra_Builder_Helper::$component_count_array;
|
||||
$widget_config = array();
|
||||
$astra_has_widgets_block_editor = astra_has_widgets_block_editor();
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_header_button; $index++ ) {
|
||||
|
||||
$header_button_section = 'section-hb-button-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $header_button_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = array(
|
||||
'name' => ( 1 === Astra_Builder_Helper::$num_of_header_button ) ? 'Button' : 'Button ' . $index,
|
||||
'icon' => 'button',
|
||||
'section' => $header_button_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'button',
|
||||
'builder' => 'header',
|
||||
);
|
||||
|
||||
Astra_Builder_Helper::$header_desktop_items[ 'button-' . $index ] = $item;
|
||||
Astra_Builder_Helper::$header_mobile_items[ 'button-' . $index ] = $item;
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_header_html; $index++ ) {
|
||||
|
||||
$header_html_section = 'section-hb-html-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $header_html_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = array(
|
||||
'name' => ( 1 === Astra_Builder_Helper::$num_of_header_html ) ? 'HTML' : 'HTML ' . $index,
|
||||
'icon' => 'editor-code',
|
||||
'section' => $header_html_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'html',
|
||||
'builder' => 'header',
|
||||
);
|
||||
|
||||
Astra_Builder_Helper::$header_desktop_items[ 'html-' . $index ] = $item;
|
||||
Astra_Builder_Helper::$header_mobile_items[ 'html-' . $index ] = $item;
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_header_widgets; $index++ ) {
|
||||
|
||||
$header_widget_section = 'sidebar-widgets-header-widget-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $header_widget_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = array(
|
||||
'name' => ( 1 === Astra_Builder_Helper::$num_of_header_widgets ) ? 'Widget' : 'Widget ' . $index,
|
||||
'icon' => 'screenoptions',
|
||||
'section' => $header_widget_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'widget',
|
||||
'builder' => 'header',
|
||||
);
|
||||
|
||||
if ( $astra_has_widgets_block_editor ) {
|
||||
$widget_config[] = array(
|
||||
'name' => $header_widget_section,
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'panel' => 'panel-header-builder-group',
|
||||
);
|
||||
}
|
||||
|
||||
Astra_Builder_Helper::$header_desktop_items[ 'widget-' . $index ] = $item;
|
||||
Astra_Builder_Helper::$header_mobile_items[ 'widget-' . $index ] = $item;
|
||||
}
|
||||
|
||||
if ( $astra_has_widgets_block_editor ) {
|
||||
$configurations = array_merge( $configurations, $widget_config );
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_header_menu; $index++ ) {
|
||||
|
||||
switch ( $index ) {
|
||||
case 1:
|
||||
$name = __( 'Primary Menu', 'astra' );
|
||||
break;
|
||||
case 2:
|
||||
$name = __( 'Secondary Menu', 'astra' );
|
||||
break;
|
||||
default:
|
||||
$name = __( 'Menu ', 'astra' ) . $index;
|
||||
break;
|
||||
}
|
||||
|
||||
$item = array(
|
||||
'name' => $name,
|
||||
'icon' => 'menu',
|
||||
'section' => 'section-hb-menu-' . $index,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'menu',
|
||||
'builder' => 'header',
|
||||
);
|
||||
|
||||
Astra_Builder_Helper::$header_desktop_items[ 'menu-' . $index ] = $item;
|
||||
|
||||
Astra_Builder_Helper::$header_mobile_items[ 'menu-' . $index ] = $item;
|
||||
}
|
||||
|
||||
for ( $index = 1; $index <= Astra_Builder_Helper::$num_of_header_social_icons; $index++ ) {
|
||||
|
||||
$header_social_section = 'section-hb-social-icons-' . $index;
|
||||
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( in_array( $header_social_section, $cloned_component_track['removed-items'], true ) ) {
|
||||
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = array(
|
||||
'name' => ( 1 === Astra_Builder_Helper::$num_of_header_social_icons ) ? 'Social' : 'Social ' . $index,
|
||||
'icon' => 'share',
|
||||
'section' => $header_social_section,
|
||||
'clone' => defined( 'ASTRA_EXT_VER' ),
|
||||
'type' => 'social-icons',
|
||||
'builder' => 'header',
|
||||
);
|
||||
|
||||
Astra_Builder_Helper::$header_desktop_items[ 'social-icons-' . $index ] = $item;
|
||||
Astra_Builder_Helper::$header_mobile_items[ 'social-icons-' . $index ] = $item;
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Header Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => 'section-header-builder',
|
||||
'type' => 'section',
|
||||
'priority' => 5,
|
||||
'title' => __( 'Header Builder', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Layout
|
||||
*/
|
||||
array(
|
||||
'name' => 'section-header-builder-layout',
|
||||
'type' => 'section',
|
||||
'priority' => 0,
|
||||
'title' => __( 'Header Layout', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => 'section-header-builder-layout-ast-context-tabs',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Header Clone Component Track.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[cloned-component-track]',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-hidden',
|
||||
'priority' => 43,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => false,
|
||||
'default' => astra_get_option( 'cloned-component-track' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[builder-header]',
|
||||
'section' => 'section-header-builder',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 40,
|
||||
'description' => '',
|
||||
'context' => array(),
|
||||
'divider' => ( astra_showcase_upgrade_notices() ) ? array() : array( 'ast_class' => 'ast-pro-available' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Desktop Items.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-desktop-items]',
|
||||
'section' => 'section-header-builder',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder',
|
||||
'title' => __( 'Header Builder', 'astra' ),
|
||||
'priority' => 25,
|
||||
'default' => astra_get_option( 'header-desktop-items' ),
|
||||
'choices' => Astra_Builder_Helper::$header_desktop_items,
|
||||
'transport' => 'refresh',
|
||||
'input_attrs' => array(
|
||||
'group' => ASTRA_THEME_SETTINGS . '[header-desktop-items]',
|
||||
'rows' => array( 'popup', 'above', 'primary', 'below' ),
|
||||
'zones' => array(
|
||||
'popup' => array(
|
||||
'popup_content' => 'Popup Content',
|
||||
),
|
||||
'above' => array(
|
||||
'above_left' => 'Top - Left',
|
||||
'above_left_center' => 'Top - Left Center',
|
||||
'above_center' => 'Top - Center',
|
||||
'above_right_center' => 'Top - Right Center',
|
||||
'above_right' => 'Top - Right',
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => 'Main - Left',
|
||||
'primary_left_center' => 'Main - Left Center',
|
||||
'primary_center' => 'Main - Center',
|
||||
'primary_right_center' => 'Main - Right Center',
|
||||
'primary_right' => 'Main - Right',
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => 'Bottom - Left',
|
||||
'below_left_center' => 'Bottom - Left Center',
|
||||
'below_center' => 'Bottom - Center',
|
||||
'below_right_center' => 'Bottom - Right Center',
|
||||
'below_right' => 'Bottom - Right',
|
||||
),
|
||||
),
|
||||
'status' => array(
|
||||
'above' => true,
|
||||
'primary' => true,
|
||||
'below' => true,
|
||||
),
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'ast_selected_device',
|
||||
'value' => 'desktop',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-preset-style]',
|
||||
'default' => astra_get_option( 'header-preset-style' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-header-presets',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'priority' => 10,
|
||||
'title' => __( 'Header Presets', 'astra' ),
|
||||
'options' => array(
|
||||
'preset_1' => array(
|
||||
'src' => 'header-preset-1',
|
||||
'options' => array(
|
||||
'header-desktop-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'mobile-menu' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_left_center' => array(),
|
||||
'above_center' => array(),
|
||||
'above_right_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array( 'logo' ),
|
||||
'primary_left_center' => array(),
|
||||
'primary_center' => array(),
|
||||
'primary_right_center' => array(),
|
||||
'primary_right' => array( 'menu-1', 'social-icons-1' ),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_left_center' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
'header-mobile-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'mobile-menu', 'social-icons-1' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array( 'logo' ),
|
||||
'primary_center' => array(),
|
||||
'primary_right' => array( 'mobile-trigger' ),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'preset_2' => array(
|
||||
'src' => 'header-preset-2',
|
||||
'options' => array(
|
||||
'header-desktop-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'mobile-menu' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_left_center' => array(),
|
||||
'above_center' => array(),
|
||||
'above_right_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array( 'logo' ),
|
||||
'primary_left_center' => array(),
|
||||
'primary_center' => array(),
|
||||
'primary_right_center' => array(),
|
||||
'primary_right' => array( 'menu-1', 'button-1' ),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_left_center' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
'header-mobile-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'mobile-menu', 'button-1' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array( 'logo' ),
|
||||
'primary_center' => array(),
|
||||
'primary_right' => array( 'mobile-trigger' ),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'preset_3' => array(
|
||||
'src' => 'header-preset-3',
|
||||
'options' => array(
|
||||
'header-desktop-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'mobile-menu' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_left_center' => array(),
|
||||
'above_center' => array(),
|
||||
'above_right_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array( 'logo', 'menu-1' ),
|
||||
'primary_left_center' => array(),
|
||||
'primary_center' => array(),
|
||||
'primary_right_center' => array(),
|
||||
'primary_right' => array( 'html-1', 'button-1' ),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_left_center' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
'header-mobile-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'mobile-menu', 'html-1', 'button-1' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array( 'logo' ),
|
||||
'primary_center' => array(),
|
||||
'primary_right' => array( 'mobile-trigger' ),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
'header-html-1' => '<a href="#">' . esc_html__( 'Log in', 'astra' ) . '</a>',
|
||||
'header-button1-text' => esc_html__( 'Sign up', 'astra' ),
|
||||
),
|
||||
),
|
||||
'preset_4' => array(
|
||||
'src' => 'header-preset-4',
|
||||
'options' => array(
|
||||
'hba-header-separator' => '0',
|
||||
'hb-header-height' => array(
|
||||
'desktop' => 80,
|
||||
'tablet' => '',
|
||||
'mobile' => '',
|
||||
),
|
||||
'header-desktop-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'mobile-menu' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_left_center' => array(),
|
||||
'above_center' => array( 'logo' ),
|
||||
'above_right_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array(),
|
||||
'primary_left_center' => array(),
|
||||
'primary_center' => array( 'menu-1' ),
|
||||
'primary_right_center' => array(),
|
||||
'primary_right' => array(),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_left_center' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
'header-mobile-items' => array(
|
||||
'popup' => array( 'popup_content' => array( 'search', 'mobile-menu' ) ),
|
||||
'above' => array(
|
||||
'above_left' => array(),
|
||||
'above_center' => array(),
|
||||
'above_right' => array(),
|
||||
),
|
||||
'primary' => array(
|
||||
'primary_left' => array( 'logo' ),
|
||||
'primary_center' => array(),
|
||||
'primary_right' => array( 'mobile-trigger' ),
|
||||
),
|
||||
'below' => array(
|
||||
'below_left' => array(),
|
||||
'below_center' => array(),
|
||||
'below_right' => array(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Header Desktop Available draggable items.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-desktop-draggable-items]',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-draggable-items',
|
||||
'priority' => 30,
|
||||
'input_attrs' => array(
|
||||
'group' => ASTRA_THEME_SETTINGS . '[header-desktop-items]',
|
||||
'zones' => array( 'popup', 'above', 'primary', 'below' ),
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'ast_selected_device',
|
||||
'value' => 'desktop',
|
||||
),
|
||||
array(
|
||||
'setting' => 'ast_selected_tab',
|
||||
'value' => 'general',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Mobile Items.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-items]',
|
||||
'section' => 'section-header-builder',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder',
|
||||
'title' => __( 'Header Builder', 'astra' ),
|
||||
'priority' => 35,
|
||||
'default' => astra_get_option( 'header-mobile-items' ),
|
||||
'choices' => Astra_Builder_Helper::$header_mobile_items,
|
||||
'transport' => 'refresh',
|
||||
'input_attrs' => array(
|
||||
'group' => ASTRA_THEME_SETTINGS . '[header-mobile-items]',
|
||||
'rows' =>
|
||||
array( 'popup', 'above', 'primary', 'below' ),
|
||||
'zones' =>
|
||||
array(
|
||||
'popup' =>
|
||||
array(
|
||||
'popup_content' => 'Popup Content',
|
||||
),
|
||||
'above' =>
|
||||
array(
|
||||
'above_left' => 'Top - Left',
|
||||
'above_center' => 'Top - Center',
|
||||
'above_right' => 'Top - Right',
|
||||
),
|
||||
'primary' =>
|
||||
array(
|
||||
'primary_left' => 'Main - Left',
|
||||
'primary_center' => 'Main - Center',
|
||||
'primary_right' => 'Main - Right',
|
||||
),
|
||||
'below' =>
|
||||
array(
|
||||
'below_left' => 'Bottom - Left',
|
||||
'below_center' => 'Bottom - Center',
|
||||
'below_right' => 'Bottom - Right',
|
||||
),
|
||||
),
|
||||
'status' => array(
|
||||
'above' => true,
|
||||
'primary' => true,
|
||||
'below' => true,
|
||||
),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$responsive_devices,
|
||||
),
|
||||
|
||||
/**
|
||||
* Header Mobile Available draggable items.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-draggable-items]',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-draggable-items',
|
||||
'input_attrs' => array(
|
||||
'group' => ASTRA_THEME_SETTINGS . '[header-mobile-items]',
|
||||
'zones' => array( 'popup', 'above', 'primary', 'below' ),
|
||||
),
|
||||
'priority' => 43,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'ast_selected_device',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'tablet', 'mobile' ),
|
||||
),
|
||||
array(
|
||||
'setting' => 'ast_selected_tab',
|
||||
'value' => 'general',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Header Mobile popup items.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-popup-items]',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-hidden',
|
||||
'priority' => 43,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '#ast-mobile-popup-wrapper',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => array( Astra_Builder_Header::get_instance(), 'mobile_popup' ),
|
||||
),
|
||||
'default' => false,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Color Section heading
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-transparent-link-heading]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'title' => __( 'Header Types', 'astra' ),
|
||||
'priority' => 44,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Transparant
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-transparant-link]',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-header-type-button',
|
||||
'input_attrs' => array(
|
||||
'section' => 'section-transparent-header',
|
||||
'label' => esc_html__( 'Transparent Header', 'astra' ),
|
||||
),
|
||||
'priority' => 45,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'settings' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Header Width.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-header-main-layout-width]',
|
||||
'default' => astra_get_option( 'hb-header-main-layout-width' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'priority' => 4,
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'astra' ),
|
||||
'content' => __( 'Content Width', 'astra' ),
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'ast_selected_tab',
|
||||
'value' => 'design',
|
||||
),
|
||||
array(
|
||||
'setting' => 'ast_selected_device',
|
||||
'value' => 'desktop',
|
||||
),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[section-header-builder-layout-margin]',
|
||||
'default' => astra_get_option( 'section-header-builder-layout-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => 'section-header-builder-layout',
|
||||
'priority' => 220,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
// Learn More link if Astra Pro is not activated.
|
||||
if ( astra_showcase_upgrade_notices() ) {
|
||||
/**
|
||||
* Option: Pro options
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-builder-pro-items]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-upgrade',
|
||||
'campaign' => 'header-builder',
|
||||
'renderAs' => 'list',
|
||||
'choices' => array(
|
||||
'one' => array(
|
||||
'title' => __( 'Sticky header', 'astra' ),
|
||||
),
|
||||
'two' => array(
|
||||
'title' => __( 'Divider element', 'astra' ),
|
||||
),
|
||||
'three' => array(
|
||||
'title' => __( 'Language Switcher element', 'astra' ),
|
||||
),
|
||||
'four' => array(
|
||||
'title' => __( 'Toggle Button element', 'astra' ),
|
||||
),
|
||||
'five' => array(
|
||||
'title' => __( 'Clone, Delete element options', 'astra' ),
|
||||
),
|
||||
'six' => array(
|
||||
'title' => __( 'Increased element count', 'astra' ),
|
||||
),
|
||||
'seven' => array(
|
||||
'title' => __( 'More design options', 'astra' ),
|
||||
),
|
||||
),
|
||||
'section' => 'section-header-builder-layout',
|
||||
'default' => '',
|
||||
'priority' => 999,
|
||||
'context' => array(),
|
||||
'title' => __( 'Make an instant connection with amazing site headers', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
);
|
||||
}
|
||||
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'sticky-header' ) ) {
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
/**
|
||||
* Option: Header Transparant
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-sticky-link]',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-header-type-button',
|
||||
'input_attrs' => array(
|
||||
'section' => 'section-sticky-header',
|
||||
'label' => esc_html__( 'Sticky Header', 'astra' ),
|
||||
),
|
||||
'priority' => 45,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'settings' => false,
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array_merge( $_configs, $configurations );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_header_builder_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Header Widget Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Header Widget header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_widget_configuration() {
|
||||
$_configs = Astra_Builder_Base_Configuration::prepare_widget_options( 'header' );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_widget_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* HTML Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register html header builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_html_configuration( $configurations = array() ) {
|
||||
|
||||
$_configs = Astra_Html_Component_Configs::register_configuration( $configurations, 'header', 'section-hb-html-' );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_html_configuration', 10, 0 );
|
||||
}
|
||||
@@ -0,0 +1,672 @@
|
||||
<?php
|
||||
/**
|
||||
* Menu Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register menu header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_menu_configuration() {
|
||||
$menu_configs = array();
|
||||
|
||||
$component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_menu;
|
||||
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
$custom_req_divider = array( 'ast_class' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ) ? 'ast-bottom-dotted-divider' : '' );
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
|
||||
for ( $index = 1; $index <= $component_limit; $index++ ) {
|
||||
|
||||
$_section = 'section-hb-menu-' . $index;
|
||||
$_prefix = 'menu' . $index;
|
||||
|
||||
switch ( $index ) {
|
||||
case 1:
|
||||
$edit_menu_title = __( 'Primary Menu', 'astra' );
|
||||
break;
|
||||
case 2:
|
||||
$edit_menu_title = __( 'Secondary Menu', 'astra' );
|
||||
break;
|
||||
default:
|
||||
$edit_menu_title = __( 'Menu ', 'astra' ) . $index;
|
||||
break;
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
// Section: Primary Header.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => $edit_menu_title,
|
||||
'panel' => 'panel-header-builder-group',
|
||||
'priority' => 40,
|
||||
'clone_index' => $index,
|
||||
'clone_type' => 'header-menu',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme Menu create link.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-create-menu-link]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-create-menu-link' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => $_section,
|
||||
'priority' => 30,
|
||||
'link_type' => 'section',
|
||||
'linked' => 'menu_locations',
|
||||
'link_text' => __( 'Configure Menu from Here.', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Menu hover style
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-menu-hover-animation]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-menu-hover-animation' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'section' => $_section,
|
||||
'priority' => 10,
|
||||
'title' => __( 'Menu Hover Style', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'None', 'astra' ),
|
||||
'zoom' => __( 'Zoom In', 'astra' ),
|
||||
'underline' => __( 'Underline', 'astra' ),
|
||||
'overline' => __( 'Overline', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'transport' => 'postMessage',
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Submenu heading.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-heading]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Submenu', 'astra' ),
|
||||
'settings' => array(),
|
||||
'priority' => 30,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Submenu width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-width]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-width' ),
|
||||
'type' => 'control',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'section' => $_section,
|
||||
'control' => 'ast-slider',
|
||||
'priority' => 30.5,
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 1920,
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Submenu Animation
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-container-animation]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-container-animation' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'section' => $_section,
|
||||
'priority' => 23,
|
||||
'title' => __( 'Submenu Animation', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'None', 'astra' ),
|
||||
'slide-down' => __( 'Slide Down', 'astra' ),
|
||||
'slide-up' => __( 'Slide Up', 'astra' ),
|
||||
'fade' => __( 'Fade', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'transport' => 'postMessage',
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Option: Submenu Container Divider.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-container-divider]',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'title' => __( 'Submenu Container', 'astra' ),
|
||||
'priority' => 20,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Submenu Divider Size.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-item-b-size]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-item-b-size' ),
|
||||
'section' => $_section,
|
||||
'priority' => 20.5,
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Divider Size', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-item-border]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 1,
|
||||
'step' => 1,
|
||||
'max' => 10,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Submenu item Border Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-item-b-color]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-item-b-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Divider Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'priority' => 21,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-item-border]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Submenu Top Offset
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-top-offset]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-top-offset' ),
|
||||
'type' => 'control',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'section' => $_section,
|
||||
'control' => 'ast-slider',
|
||||
'priority' => 22,
|
||||
'title' => __( 'Top Offset', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
// Option: Sub-Menu Border.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-border]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-border' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-border',
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'linked_choices' => true,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'priority' => 23,
|
||||
'title' => __( 'Border Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
// Option: Submenu Container Border Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-b-color]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-b-color' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-border-group]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'priority' => 23,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Radius Fields
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-border-radius-fields]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-border-radius-fields' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'transport' => 'postMessage',
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 23,
|
||||
'connected' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Submenu Divider Checkbox.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-submenu-item-border]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-submenu-item-border' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => $_section,
|
||||
'priority' => 35,
|
||||
'title' => __( 'Item Divider', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
// Option: Menu Stack on Mobile Checkbox.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-menu-stack-on-mobile]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-menu-stack-on-mobile' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => $_section,
|
||||
'priority' => 41,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'title' => __( 'Stack on Responsive', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$responsive_general_tab,
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 151,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
// Option Group: Menu Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-text-colors]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Text / Link', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 90,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => array(
|
||||
'ast_title' => __( 'Menu Color', 'astra' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-background-colors]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 90,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => $custom_req_divider,
|
||||
),
|
||||
|
||||
// Option: Menu Color.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-color-responsive',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-text-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 7,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Menu Background image, color.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-bg-obj-responsive',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-bg-obj-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'data_attrs' => array( 'name' => 'header-' . $_prefix . '-bg-obj-responsive' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'priority' => 9,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Menu Hover Color.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-h-color-responsive',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-h-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-text-colors]',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'section' => $_section,
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 19,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Menu Hover Background Color.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-h-bg-color-responsive',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-h-bg-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 21,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Active Menu Color.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-a-color-responsive',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-a-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-text-colors]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Active', 'astra' ),
|
||||
'title' => __( 'Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 31,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Active Menu Background Color.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-a-bg-color-responsive',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-a-bg-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Active', 'astra' ),
|
||||
'tab' => __( 'Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 33,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Font Divider.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $index . '-font-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Font', 'astra' ),
|
||||
'settings' => array(),
|
||||
'priority' => 120,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option Group: Menu Typography.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-header-menu-typography]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-header-menu-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Menu Font', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 120,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Menu Font Family.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-font-family',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-font-family' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-header-menu-typography]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'priority' => 22,
|
||||
'connect' => 'header-' . $_prefix . '-font-weight',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
// Option: Menu Font Weight.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-font-weight',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-font-weight' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-header-menu-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'transport' => 'postMessage',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'priority' => 23,
|
||||
'connect' => 'header-' . $_prefix . '-font-family',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
|
||||
// Option: Menu Font Size.
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-font-size',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-font-size' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-header-menu-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'priority' => 23,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'control' => 'ast-responsive-slider',
|
||||
'transport' => 'postMessage',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Primary Menu Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-' . $_prefix . '-font-extras',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-header-menu-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font-extras',
|
||||
'priority' => 26,
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-font-extras' ),
|
||||
'title' => __( 'Font Extras', 'astra' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Spacing Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $index . '-spacing-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'settings' => array(),
|
||||
'priority' => 150,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
|
||||
// Option - Menu Space.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-' . $_prefix . '-menu-spacing]',
|
||||
'default' => astra_get_option( 'header-' . $_prefix . '-menu-spacing' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'priority' => 150,
|
||||
'title' => __( 'Menu', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
|
||||
$menu_configs[] = Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section );
|
||||
$menu_configs[] = $_configs;
|
||||
}
|
||||
|
||||
$menu_configs = call_user_func_array( 'array_merge', $menu_configs + array( array() ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $menu_configs );
|
||||
}
|
||||
|
||||
return $menu_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_menu_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
/**
|
||||
* Mobile Menu Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register mobile-menu header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_mobile_menu_configuration() {
|
||||
$_section = 'section-header-mobile-menu';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
// Section: Primary Header.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Off-Canvas Menu', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
'priority' => 40,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme Menu create link
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-create-menu-link]',
|
||||
'default' => astra_get_option( 'header-mobile-menu-create-menu-link' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => $_section,
|
||||
'priority' => 30,
|
||||
'link_type' => 'section',
|
||||
'linked' => 'menu_locations',
|
||||
'link_text' => __( 'Configure Menu from Here.', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
|
||||
// Option: Submenu Divider Checkbox.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-submenu-item-border]',
|
||||
'default' => astra_get_option( 'header-mobile-menu-submenu-item-border' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => $_section,
|
||||
'priority' => 150,
|
||||
'title' => __( 'Item Divider', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
// Option: Menu Color Divider.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-divider-colors-divider]',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'title' => __( 'Item Divider', 'astra' ),
|
||||
'priority' => 150,
|
||||
'settings' => array(),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-submenu-item-border]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Submenu item Border Size.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-submenu-item-b-size]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'default' => astra_get_option( 'header-mobile-menu-submenu-item-b-size' ),
|
||||
'section' => $_section,
|
||||
'priority' => 150,
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Divider Size', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-submenu-item-border]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 1,
|
||||
'step' => 1,
|
||||
'max' => 10,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Submenu item Border Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-submenu-item-b-color]',
|
||||
'default' => astra_get_option( 'header-mobile-menu-submenu-item-b-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Divider Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'priority' => 150,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-submenu-item-border]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
// Option Group: Menu Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-link-colors]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Link', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 90,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => array(
|
||||
'ast_title' => __( 'Menu Color', 'astra' ),
|
||||
'ast_class' => 'ast-section-spacing',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-background-colors]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 90,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'responsive' => true,
|
||||
'divider' => array(
|
||||
'ast_title' => '',
|
||||
'ast_class' => class_exists( 'Astra_Ext_Extension' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ? 'ast-bottom-dotted-divider' : '',
|
||||
),
|
||||
),
|
||||
// Option: Menu Color.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-color-responsive',
|
||||
'default' => astra_get_option( 'header-mobile-menu-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-link-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 7,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Menu Background image, color.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-bg-obj-responsive',
|
||||
'default' => astra_get_option( 'header-mobile-menu-bg-obj-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'data_attrs' => array( 'name' => 'header-mobile-menu-bg-obj-responsive' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'priority' => 9,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Menu Hover Color.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-h-color-responsive',
|
||||
'default' => astra_get_option( 'header-mobile-menu-h-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-link-colors]',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'section' => $_section,
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 19,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Menu Hover Background Color.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-h-bg-color-responsive',
|
||||
'default' => astra_get_option( 'header-mobile-menu-h-bg-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 21,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Active Menu Color.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-a-color-responsive',
|
||||
'default' => astra_get_option( 'header-mobile-menu-a-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-link-colors]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'tab' => __( 'Active', 'astra' ),
|
||||
'title' => __( 'Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 31,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
// Option: Active Menu Background Color.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-a-bg-color-responsive',
|
||||
'default' => astra_get_option( 'header-mobile-menu-a-bg-color-responsive' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-background-colors]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-color',
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Active', 'astra' ),
|
||||
'tab' => __( 'Active', 'astra' ),
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'priority' => 33,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: WOO Off Canvas Menu Submenu Color Section divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-header-typo-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Font', 'astra' ),
|
||||
'priority' => 120,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array(
|
||||
'ast_class' => 'ast-section-spacing',
|
||||
),
|
||||
),
|
||||
|
||||
// Option Group: Menu Typography.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-header-menu-typography]',
|
||||
'default' => astra_get_option( 'header-mobile-menu-header-menu-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Menu Font', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 120,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array(
|
||||
'ast_class' => 'ast-section-spacing',
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Menu Font Family.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-font-family',
|
||||
'default' => astra_get_option( 'header-mobile-menu-font-family', 'inherit' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-header-menu-typography]',
|
||||
'type' => 'sub-control',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'priority' => 22,
|
||||
'connect' => 'header-mobile-menu-font-weight',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
// Option: Menu Font Weight.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-font-weight',
|
||||
'default' => astra_get_option( 'header-mobile-menu-font-weight', 'inherit' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-header-menu-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'transport' => 'postMessage',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'priority' => 23,
|
||||
'connect' => 'header-mobile-menu-font-family',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
// Option: Menu Font Size.
|
||||
array(
|
||||
'name' => 'header-mobile-menu-font-size',
|
||||
'default' => astra_get_option( 'header-mobile-menu-font-size' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-header-menu-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'priority' => 24,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'control' => 'ast-responsive-slider',
|
||||
'transport' => 'postMessage',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-header-mobile-menu',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-header-menu-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font-extras',
|
||||
'priority' => 24,
|
||||
'default' => astra_get_option( 'font-extras-header-mobile-menu' ),
|
||||
'title' => __( 'Font Extras', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-menu-spacing-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 150,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
|
||||
// Option - Menu Space.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-mobile-menu-menu-spacing]',
|
||||
'default' => astra_get_option( 'header-mobile-menu-menu-spacing' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'transport' => 'postMessage',
|
||||
'section' => $_section,
|
||||
'priority' => 150,
|
||||
'title' => __( 'Menu Spacing', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 220,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_mobile_menu_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,418 @@
|
||||
<?php
|
||||
/**
|
||||
* Mobile Trigger Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Header Trigger header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_mobile_trigger_configuration() {
|
||||
$_section = 'section-header-mobile-trigger';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Header Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => 'section-header-mobile-trigger',
|
||||
'type' => 'section',
|
||||
'priority' => 70,
|
||||
'title' => __( 'Toggle Button', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Html Editor.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-trigger-icon]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'default' => astra_get_option( 'header-trigger-icon' ),
|
||||
'title' => __( 'Icons', 'astra' ),
|
||||
'section' => $_section,
|
||||
'choices' => array(
|
||||
'menu' => array(
|
||||
'label' => __( 'Menu', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'mobile_menu' ),
|
||||
),
|
||||
'menu2' => array(
|
||||
'label' => __( 'Menu 2', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'mobile_menu2' ),
|
||||
),
|
||||
'menu3' => array(
|
||||
'label' => __( 'Menu 3', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'mobile_menu3' ),
|
||||
),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-button-wrap',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_mobile_trigger' ),
|
||||
),
|
||||
'priority' => 10,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'alt_layout' => true,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle Button Style
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-btn-style' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Toggle Button Style', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'priority' => 11,
|
||||
'choices' => array(
|
||||
'fill' => __( 'Fill', 'astra' ),
|
||||
'outline' => __( 'Outline', 'astra' ),
|
||||
'minimal' => __( 'Minimal', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-button-wrap',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_mobile_trigger' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Mobile Menu Label
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-menu-label]',
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-button-wrap',
|
||||
'render_callback' => array( 'Astra_Builder_UI_Controller', 'render_mobile_trigger' ),
|
||||
),
|
||||
'default' => astra_get_option( 'mobile-header-menu-label' ),
|
||||
'section' => $_section,
|
||||
'priority' => 20,
|
||||
'title' => __( 'Menu Label', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'text',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle Button Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-color]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-btn-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Icon Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 40,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Icon Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-icon-size]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-icon-size' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Icon Size', 'astra' ),
|
||||
'priority' => 50,
|
||||
'suffix' => 'px',
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 100,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Option: Toggle Button Bg Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-bg-color]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-btn-bg-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 40,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'fill',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle Button Border Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-border-size]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-btn-border-size' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'control' => 'ast-border',
|
||||
'transport' => 'postMessage',
|
||||
'linked_choices' => true,
|
||||
'priority' => 60,
|
||||
'title' => __( 'Border Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'outline',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle Button Border Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-border-color]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-border-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 40,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]',
|
||||
'operator' => '==',
|
||||
'value' => 'outline',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Radius Fields
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-border-radius-fields]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-border-radius-fields' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'transport' => 'postMessage',
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 50,
|
||||
'connected' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'minimal',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 130,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 130,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) {
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
|
||||
$typo_configs = array(
|
||||
|
||||
// Option Group: Trigger Typography.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-label-typography]',
|
||||
'default' => astra_get_option( 'mobile-header-label-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Typography', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 70,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-menu-label]',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Trigger Font Size.
|
||||
array(
|
||||
'name' => 'mobile-header-label-font-size',
|
||||
'default' => astra_get_option( 'mobile-header-label-font-size' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[mobile-header-label-typography]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'priority' => 23,
|
||||
'suffix' => 'px',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'control' => 'ast-slider',
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'max' => 200,
|
||||
),
|
||||
'units' => array(
|
||||
'px' => 'px',
|
||||
'em' => 'em',
|
||||
'vw' => 'vw',
|
||||
'rem' => 'rem',
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
$typo_configs = array(
|
||||
|
||||
// Option: Trigger Font Size.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-label-font-size]',
|
||||
'default' => astra_get_option( 'mobile-header-label-font-size' ),
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'priority' => 70,
|
||||
'suffix' => 'px',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'control' => 'ast-slider',
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'max' => 200,
|
||||
),
|
||||
'units' => array(
|
||||
'px' => 'px',
|
||||
'em' => 'em',
|
||||
'vw' => 'vw',
|
||||
'rem' => 'rem',
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array_merge( $_configs, $typo_configs );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_mobile_trigger_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
/**
|
||||
* Off canvas Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register off-canvas header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_off_canvas_configuration() {
|
||||
$_section = 'section-popup-header-builder';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
// Section: Off-Canvas.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Off-Canvas', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
'priority' => 30,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Mobile Header Type.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-type]',
|
||||
'default' => astra_get_option( 'mobile-header-type' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 25,
|
||||
'title' => __( 'Header Type', 'astra' ),
|
||||
'choices' => array(
|
||||
'off-canvas' => __( 'Flyout', 'astra' ),
|
||||
'full-width' => __( 'Full-Screen', 'astra' ),
|
||||
'dropdown' => __( 'Dropdown', 'astra' ),
|
||||
),
|
||||
'transport' => 'refresh',
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Off-Canvas Slide-Out.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[off-canvas-slide]',
|
||||
'default' => astra_get_option( 'off-canvas-slide' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 30,
|
||||
'title' => __( 'Position', 'astra' ),
|
||||
'choices' => array(
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'off-canvas',
|
||||
),
|
||||
),
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle on click of button or link.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-builder-menu-toggle-target]',
|
||||
'default' => astra_get_option( 'header-builder-menu-toggle-target' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'priority' => 40,
|
||||
'title' => __( 'Dropdown Target', 'astra' ),
|
||||
'suffix' => '',
|
||||
'choices' => array(
|
||||
'icon' => __( 'Icon', 'astra' ),
|
||||
'link' => __( 'Link', 'astra' ),
|
||||
),
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Content alignment option for offcanvas
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-offcanvas-content-alignment]',
|
||||
'default' => astra_get_option( 'header-offcanvas-content-alignment' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => $_section,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'priority' => 40,
|
||||
'title' => __( 'Content Alignment', 'astra' ),
|
||||
'suffix' => '',
|
||||
'choices' => array(
|
||||
'flex-start' => __( 'Left', 'astra' ),
|
||||
'center' => __( 'Center', 'astra' ),
|
||||
'flex-end' => __( 'Right', 'astra' ),
|
||||
),
|
||||
'renderAs' => 'text',
|
||||
'responsive' => false,
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
// Option Group: Off-Canvas Colors Group.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[off-canvas-background]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-background',
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 26,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_background_obj' ),
|
||||
'default' => astra_get_option( 'off-canvas-background' ),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Off-Canvas Close Icon Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[off-canvas-close-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'off-canvas-close-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => $_section,
|
||||
'priority' => 27,
|
||||
'title' => __( 'Close Icon Color', 'astra' ),
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'off-canvas',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'full-width',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Spacing Between every element in the flyout.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[off-canvas-inner-spacing]',
|
||||
'default' => astra_get_option( 'off-canvas-inner-spacing' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'title' => __( 'Inner Element Spacing', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 28,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
// Option Group: Off-Canvas Colors Group.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[off-canvas-background]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-background',
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 30,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_background_obj' ),
|
||||
'default' => astra_get_option( 'off-canvas-background' ),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Popup Padding.
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[off-canvas-padding]',
|
||||
'default' => astra_get_option( 'off-canvas-padding' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'section' => $_section,
|
||||
'priority' => 210,
|
||||
'title' => __( 'Popup Padding', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'off-canvas',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-type]',
|
||||
'operator' => '==',
|
||||
'value' => 'full-width',
|
||||
),
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_off_canvas_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* Primary Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Primary header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_primary_header_configuration() {
|
||||
$_section = 'section-primary-header-builder';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Panel - New Header
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
array(
|
||||
'name' => 'panel-header-builder-group',
|
||||
'type' => 'panel',
|
||||
'priority' => 20,
|
||||
'title' => __( 'Header Builder', 'astra' ),
|
||||
),
|
||||
|
||||
// Section: Primary Header.
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'title' => __( 'Primary Header', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
'priority' => 20,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
// Section: Primary Header Height.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-header-height]',
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hb-header-height' ),
|
||||
'priority' => 3,
|
||||
'title' => __( 'Height', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 30,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Sub Option: Header Background.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-header-bg-obj-responsive]',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'transport' => 'postMessage',
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'priority' => 5,
|
||||
'data_attrs' => array(
|
||||
'name' => 'hb-header-bg-obj-responsive',
|
||||
),
|
||||
'default' => astra_get_option( 'hb-header-bg-obj-responsive' ),
|
||||
'title' => __( 'Background', 'astra' ),
|
||||
'description' => __( 'It would not be effective if transparent header is enabled.', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
// Option: Header Bottom Boder Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-header-main-sep-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hb-header-main-sep-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Bottom Border Color', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[hb-header-main-sep]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Header Separator.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hb-header-main-sep]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'hb-header-main-sep' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Bottom Border Size', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 10,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_advanced_tab( $_section ) );
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_primary_header_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
<?php
|
||||
/**
|
||||
* Search Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register search header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_search_configuration() {
|
||||
$_section = 'section-header-search';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Header Builder section
|
||||
*/
|
||||
array(
|
||||
'name' => $_section,
|
||||
'type' => 'section',
|
||||
'priority' => 80,
|
||||
'title' => __( 'Search', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Search Color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-search-icon-color]',
|
||||
'default' => astra_get_option( 'header-search-icon-color' ),
|
||||
'type' => 'control',
|
||||
'section' => $_section,
|
||||
'priority' => 8,
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-color',
|
||||
'responsive' => true,
|
||||
'rgba' => true,
|
||||
'title' => __( 'Icon Color', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Search Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-search-icon-space]',
|
||||
'section' => $_section,
|
||||
'priority' => 3,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-search-icon-space' ),
|
||||
'title' => __( 'Icon Size', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'divider' => array( 'ast_class' => ( defined( 'ASTRA_EXT_VER' ) ) ? 'ast-top-section-divider ast-bottom-section-divider' : 'ast-section-spacing' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 50,
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Search bar width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-search-width]',
|
||||
'section' => $_section,
|
||||
'priority' => 2,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-search-width' ),
|
||||
'title' => __( 'Search Width', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'input_attrs' => array(
|
||||
'min' => 1,
|
||||
'step' => 1,
|
||||
'max' => 1000,
|
||||
),
|
||||
'divider' => defined( 'ASTRA_EXT_VER' ) ? array( 'ast_class' => 'ast-top-dotted-divider' ) : array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
'context' => defined( 'ASTRA_EXT_VER' ) ? array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-search-box-type]',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'slide-search', 'search-box' ),
|
||||
),
|
||||
) : Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Live Search.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[live-search]',
|
||||
'default' => astra_get_option( 'live-search' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Live Search', 'astra' ),
|
||||
'priority' => 5,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Live Search based on Post Types.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[live-search-post-types]',
|
||||
'default' => astra_get_option( 'live-search-post-types' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-multi-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Search Within Post Types', 'astra' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[live-search]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'transport' => 'refresh',
|
||||
'choices' => astra_customizer_search_post_types_choices(),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'renderAs' => 'text',
|
||||
'input_attrs' => array(
|
||||
'stack_after' => 2, // Currently stack options supports after 2 & 3.
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 220,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 220,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_search_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,399 @@
|
||||
<?php
|
||||
/**
|
||||
* Site identity Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register site identity header builder Customizer Configurations.
|
||||
*
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_site_identity_configuration() {
|
||||
$_section = 'title_tagline';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/*
|
||||
* Update the Site Identity section inside Layout -> Header
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
array(
|
||||
'name' => 'title_tagline',
|
||||
'type' => 'section',
|
||||
'priority' => 100,
|
||||
'title' => __( 'Logo', 'astra' ),
|
||||
'panel' => 'panel-header-builder-group',
|
||||
),
|
||||
|
||||
/**
|
||||
* Link to the astra logo and site title settings.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[logo-title-settings-link]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => 'astra-site-identity',
|
||||
'priority' => 100,
|
||||
'link_type' => 'section',
|
||||
'is_button_link' => true,
|
||||
'linked' => 'title_tagline',
|
||||
'link_text' => __( 'Site Title & Logo Settings', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Builder Tabs
|
||||
*/
|
||||
array(
|
||||
'name' => $_section . '-ast-context-tabs',
|
||||
'section' => $_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header logo color.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-logo-color]',
|
||||
'default' => astra_get_option( 'header-logo-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'section' => 'title_tagline',
|
||||
'priority' => 5,
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'title' => __( 'Logo Color', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'description' => __( 'Use it with transparent images for optimal results.', 'astra' ),
|
||||
),
|
||||
|
||||
// Option: Site Title Color.
|
||||
array(
|
||||
'name' => 'header-color-site-title',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]',
|
||||
'section' => 'title_tagline',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 5,
|
||||
'default' => astra_get_option( 'header-color-site-title' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Site Title Hover Color.
|
||||
array(
|
||||
'name' => 'header-color-h-site-title',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]',
|
||||
'section' => 'title_tagline',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 10,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-color-h-site-title' ),
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin-divider]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 220,
|
||||
'settings' => array(),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Margin Space
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $_section . '-margin]',
|
||||
'default' => astra_get_option( $_section . '-margin' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => $_section,
|
||||
'priority' => 220,
|
||||
'title' => __( 'Margin', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) {
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
$_configs[] = array(
|
||||
'name' => 'font-size-site-title',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[site-title-typography]',
|
||||
'section' => 'title_tagline',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'default' => astra_get_option( 'font-size-site-title' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 12,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
);
|
||||
$_configs[] = array(
|
||||
'name' => 'font-size-site-tagline',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[site-tagline-typography]',
|
||||
'section' => 'title_tagline',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'default' => astra_get_option( 'font-size-site-tagline' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 16,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[font-size-site-title]',
|
||||
'type' => 'control',
|
||||
'section' => 'title_tagline',
|
||||
'default' => astra_get_option( 'font-size-site-title' ),
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 16 : 8,
|
||||
'title' => __( 'Title Font Size', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]',
|
||||
'setting-key' => 'desktop',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]',
|
||||
'setting-key' => 'tablet',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]',
|
||||
'setting-key' => 'mobile',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
) : array(
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]',
|
||||
'setting-key' => 'desktop',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]',
|
||||
'setting-key' => 'tablet',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]',
|
||||
'setting-key' => 'mobile',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[font-size-site-tagline]',
|
||||
'type' => 'control',
|
||||
'section' => 'title_tagline',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'default' => astra_get_option( 'font-size-site-tagline' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 20 : 12,
|
||||
'title' => __( 'Tagline Font Size', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]',
|
||||
'setting-key' => 'desktop',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]',
|
||||
'setting-key' => 'tablet',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]',
|
||||
'setting-key' => 'mobile',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
) : array(
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]',
|
||||
'setting-key' => 'desktop',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]',
|
||||
'setting-key' => 'tablet',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]',
|
||||
'setting-key' => 'mobile',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Builder_Base_Configuration::prepare_visibility_tab( $_section ) );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_site_identity_configuration' );
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Social Header Configuration.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 4.5.2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register social header builder Customizer Configurations.
|
||||
*
|
||||
* @param array $configurations Astra Customizer Configurations.
|
||||
* @since 4.5.2
|
||||
* @return array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
function astra_header_social_configuration( $configurations = array() ) {
|
||||
|
||||
$_configs = Astra_Social_Icon_Component_Configs::register_configuration( $configurations, 'header', 'section-hb-social-icons-' );
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
array_map( 'astra_save_header_customizer_configs', $_configs );
|
||||
}
|
||||
|
||||
return $_configs;
|
||||
}
|
||||
|
||||
if ( Astra_Builder_Customizer::astra_collect_customizer_builder_data() ) {
|
||||
add_action( 'init', 'astra_header_social_configuration', 10, 0 );
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,878 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Base.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.4.3
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes
|
||||
*
|
||||
* @since 1.4.3
|
||||
*/
|
||||
if ( ! class_exists( 'Astra_Customizer_Button_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Button Customizer Configurations.
|
||||
*/
|
||||
class Astra_Customizer_Button_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Button Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array();
|
||||
$id = '';
|
||||
for ( $index = 0; $index < 2; $index++ ) {
|
||||
|
||||
$id = 1 === $index ? 'secondary-' : '';
|
||||
$_tab_configs = array(
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $id . 'button-preset-style]',
|
||||
'default' => astra_get_option( $id . 'button-preset-style' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-button-presets',
|
||||
'title' => __( 'Button Presets', 'astra' ),
|
||||
'section' => 'section-buttons',
|
||||
'options' => array(
|
||||
'button_01' => array(
|
||||
'src' => 'btn-preset-01',
|
||||
'border-size' => array(
|
||||
'top' => 0,
|
||||
'right' => 0,
|
||||
'bottom' => 0,
|
||||
'left' => 0,
|
||||
),
|
||||
'button-radius-fields' => array(
|
||||
'desktop' => array(
|
||||
'top' => 0,
|
||||
'right' => 0,
|
||||
'bottom' => 0,
|
||||
'left' => 0,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-padding' => array(
|
||||
'desktop' => array(
|
||||
'top' => 10,
|
||||
'right' => 20,
|
||||
'bottom' => 10,
|
||||
'left' => 20,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-bg-color' => '',
|
||||
'button-bg-h-color' => '',
|
||||
'button-color' => '',
|
||||
),
|
||||
'button_02' => array(
|
||||
'src' => 'btn-preset-02',
|
||||
'border-size' => array(
|
||||
'top' => 0,
|
||||
'right' => 0,
|
||||
'bottom' => 0,
|
||||
'left' => 0,
|
||||
),
|
||||
'button-radius-fields' => array(
|
||||
'desktop' => array(
|
||||
'top' => 3,
|
||||
'right' => 3,
|
||||
'bottom' => 3,
|
||||
'left' => 3,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-padding' => array(
|
||||
'desktop' => array(
|
||||
'top' => 10,
|
||||
'right' => 20,
|
||||
'bottom' => 10,
|
||||
'left' => 20,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-bg-color' => '',
|
||||
'button-bg-h-color' => '',
|
||||
'button-color' => '',
|
||||
),
|
||||
'button_03' => array(
|
||||
'src' => 'btn-preset-03',
|
||||
'border-size' => array(
|
||||
'top' => 0,
|
||||
'right' => 0,
|
||||
'bottom' => 0,
|
||||
'left' => 0,
|
||||
),
|
||||
'button-radius-fields' => array(
|
||||
'desktop' => array(
|
||||
'top' => 30,
|
||||
'right' => 30,
|
||||
'bottom' => 30,
|
||||
'left' => 30,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-padding' => array(
|
||||
'desktop' => array(
|
||||
'top' => 10,
|
||||
'right' => 20,
|
||||
'bottom' => 10,
|
||||
'left' => 20,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-bg-color' => '',
|
||||
'button-bg-h-color' => '',
|
||||
'button-color' => '',
|
||||
),
|
||||
'button_04' => array(
|
||||
'src' => 'btn-preset-04',
|
||||
'border-size' => array(
|
||||
'top' => 1,
|
||||
'right' => 1,
|
||||
'bottom' => 1,
|
||||
'left' => 1,
|
||||
),
|
||||
'button-radius-fields' => array(
|
||||
'desktop' => array(
|
||||
'top' => 0,
|
||||
'right' => 0,
|
||||
'bottom' => 0,
|
||||
'left' => 0,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-padding' => array(
|
||||
'desktop' => array(
|
||||
'top' => 10,
|
||||
'right' => 20,
|
||||
'bottom' => 10,
|
||||
'left' => 20,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-bg-color' => 'rgba(0,0,0,0)',
|
||||
'button-bg-h-color' => '',
|
||||
'button-color' => '#0170B9',
|
||||
),
|
||||
'button_05' => array(
|
||||
'src' => 'btn-preset-05',
|
||||
'border-size' => array(
|
||||
'top' => 1,
|
||||
'right' => 1,
|
||||
'bottom' => 1,
|
||||
'left' => 1,
|
||||
),
|
||||
'button-radius-fields' => array(
|
||||
'desktop' => array(
|
||||
'top' => 3,
|
||||
'right' => 3,
|
||||
'bottom' => 3,
|
||||
'left' => 3,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-padding' => array(
|
||||
'desktop' => array(
|
||||
'top' => 10,
|
||||
'right' => 20,
|
||||
'bottom' => 10,
|
||||
'left' => 20,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-bg-color' => 'rgba(0,0,0,0)',
|
||||
'button-bg-h-color' => '',
|
||||
'button-color' => '#0170B9',
|
||||
),
|
||||
'button_06' => array(
|
||||
'src' => 'btn-preset-06',
|
||||
'border-size' => array(
|
||||
'top' => 1,
|
||||
'right' => 1,
|
||||
'bottom' => 1,
|
||||
'left' => 1,
|
||||
),
|
||||
'button-radius-fields' => array(
|
||||
'desktop' => array(
|
||||
'top' => 30,
|
||||
'right' => 30,
|
||||
'bottom' => 30,
|
||||
'left' => 30,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-padding' => array(
|
||||
'desktop' => array(
|
||||
'top' => 10,
|
||||
'right' => 20,
|
||||
'bottom' => 10,
|
||||
'left' => 20,
|
||||
),
|
||||
'tablet' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'mobile' => array(
|
||||
'top' => '',
|
||||
'right' => '',
|
||||
'bottom' => '',
|
||||
'left' => '',
|
||||
),
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'button-bg-color' => 'rgba(0,0,0,0)',
|
||||
'button-bg-h-color' => '',
|
||||
'button-color' => '#0170B9',
|
||||
),
|
||||
),
|
||||
'priority' => 18,
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Group: Theme Button color Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-color-group]',
|
||||
'default' => astra_get_option( $id . 'theme-button-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'section' => 'section-buttons',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 18,
|
||||
),
|
||||
|
||||
/**
|
||||
* Group: Theme Button background colors Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-bg-color-group]',
|
||||
'default' => astra_get_option( $id . 'theme-button-bg-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'section' => 'section-buttons',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 18.5,
|
||||
),
|
||||
|
||||
/**
|
||||
* Group: Theme Button Border Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-border-color-group]',
|
||||
'default' => astra_get_option( $id . 'theme-button-border-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'section' => 'section-buttons',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 18.5,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Global Button Border Color
|
||||
*/
|
||||
array(
|
||||
'name' => $id . 'theme-button-border-group-border-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-border-color-group]',
|
||||
'default' => astra_get_option( $id . 'theme-button-border-group-border-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 18.5,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Global Button Border Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $id . 'theme-button-border-group-border-h-color',
|
||||
'default' => astra_get_option( $id . 'theme-button-border-group-border-h-color' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-border-color-group]',
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 18.5,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Color
|
||||
*/
|
||||
array(
|
||||
'name' => $id . 'button-color',
|
||||
'default' => astra_get_option( $id . 'button-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-color-group]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $id . 'button-h-color',
|
||||
'default' => astra_get_option( $id . 'button-h-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-color-group]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'priority' => 39,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => $id . 'button-bg-color',
|
||||
'default' => astra_get_option( $id . 'button-bg-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-bg-color-group]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Background Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => $id . 'button-bg-h-color',
|
||||
'default' => astra_get_option( $id . 'button-bg-h-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-bg-color-group]',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'priority' => 40,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme Button Padding
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-padding]',
|
||||
'default' => astra_get_option( $id . 'theme-button-padding' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => 'section-buttons',
|
||||
'title' => __( 'Padding', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'transport' => 'postMessage',
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 19,
|
||||
'connected' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Global Button Border Size
|
||||
*/
|
||||
array(
|
||||
'type' => 'control',
|
||||
'section' => 'section-buttons',
|
||||
'control' => 'ast-border',
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $id . 'theme-button-border-group-border-size]',
|
||||
'transport' => 'postMessage',
|
||||
'linked_choices' => true,
|
||||
'suffix' => 'px',
|
||||
'priority' => 19,
|
||||
'default' => astra_get_option( $id . 'theme-button-border-group-border-size' ),
|
||||
'title' => __( 'Border Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Global Button Radius Fields
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[' . $id . 'button-radius-fields]',
|
||||
'default' => astra_get_option( $id . 'button-radius-fields' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => 'section-buttons',
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'transport' => 'postMessage',
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 19,
|
||||
'connected' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, $_tab_configs );
|
||||
}
|
||||
|
||||
// Secondary tab.
|
||||
$_configs[] = array(
|
||||
'name' => 'section-secondary-ast-context-tabs',
|
||||
'section' => 'section-buttons',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
);
|
||||
|
||||
// Only add outline presets to secondary button presets.
|
||||
$secondary_btn_preset_index = 13;
|
||||
|
||||
// Add context & priority dynamically to secondary tab options.
|
||||
for ( $index = $secondary_btn_preset_index, $priority = 0; $index < count( $_configs ) - 1; $index++ ) {
|
||||
$_configs[ $index ]['context'] = Astra_Builder_Helper::$design_tab;
|
||||
$_configs[ $index ]['priority'] = ++$priority;
|
||||
}
|
||||
|
||||
if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
|
||||
$_trans_config = array(
|
||||
/**
|
||||
* Option: Transparent Header Button Colors Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => 'section-transparent-header',
|
||||
'title' => __( 'Header Button', 'astra' ),
|
||||
'settings' => array(),
|
||||
'priority' => 40,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
),
|
||||
),
|
||||
/**
|
||||
* Group: Transparent Header Button Colors Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]',
|
||||
'default' => astra_get_option( 'transparent-header-button-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Colors', 'astra' ),
|
||||
'section' => 'section-transparent-header',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 40,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
),
|
||||
),
|
||||
/**
|
||||
* Group: Transparent Header Button Border Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]',
|
||||
'default' => astra_get_option( 'transparent-header-button-border-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Border', 'astra' ),
|
||||
'section' => 'section-transparent-header',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 40,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-trans-section-button-text-color',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-text-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]',
|
||||
'section' => 'section-transparent-header',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-trans-section-button-text-h-color',
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-text-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]',
|
||||
'section' => 'section-transparent-header',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-trans-section-button-back-color',
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-back-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]',
|
||||
'section' => 'section-transparent-header',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Button Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-trans-section-button-back-h-color',
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-back-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-color-group]',
|
||||
'section' => 'section-transparent-header',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
),
|
||||
|
||||
// Option: Custom Menu Button Border.
|
||||
array(
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-trans-section-button-padding]',
|
||||
'section' => 'section-transparent-header',
|
||||
'transport' => 'postMessage',
|
||||
'linked_choices' => true,
|
||||
'priority' => 40,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
),
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-padding' ),
|
||||
'title' => __( 'Padding', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Size
|
||||
*/
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-border',
|
||||
'name' => 'header-main-rt-trans-section-button-border-size',
|
||||
'transport' => 'postMessage',
|
||||
'linked_choices' => true,
|
||||
'priority' => 10,
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-border-size' ),
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-trans-section-button-border-color',
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-border-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]',
|
||||
'section' => 'section-transparent-header',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 12,
|
||||
'title' => __( 'Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-trans-section-button-border-h-color',
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-border-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 14,
|
||||
'title' => __( 'Hover Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Radius
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-trans-section-button-border-radius',
|
||||
'default' => astra_get_option( 'header-main-rt-trans-section-button-border-radius' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[transparent-header-button-border-group]',
|
||||
'section' => 'section-transparent-header',
|
||||
'control' => 'ast-slider',
|
||||
'suffix' => 'px',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 16,
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 100,
|
||||
),
|
||||
),
|
||||
);
|
||||
$_configs = array_merge( $_configs, $_trans_config );
|
||||
|
||||
}
|
||||
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Customizer_Button_Configs();
|
||||
@@ -0,0 +1,466 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Base.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 2.6.0
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
if ( ! class_exists( 'Astra_Existing_Button_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Button Customizer Configurations.
|
||||
*/
|
||||
class Astra_Existing_Button_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Button Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 2.6.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Colors Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => 'section-primary-menu',
|
||||
'title' => __( 'Header Button', 'astra' ),
|
||||
'settings' => array(),
|
||||
'priority' => 17,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '==',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
/**
|
||||
* Group: Primary Header Button Colors Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]',
|
||||
'default' => astra_get_option( 'primary-header-button-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Colors', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 18,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '==',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
),
|
||||
/**
|
||||
* Group: Primary Header Button Border Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]',
|
||||
'default' => astra_get_option( 'primary-header-button-border-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Border', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 19,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '==',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-section-button-text-color',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-text-color' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-section-button-text-h-color',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-text-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Background Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-section-button-back-color',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-back-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'tab' => __( 'Normal', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Button Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-section-button-back-h-color',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-back-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-color-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'tab' => __( 'Hover', 'astra' ),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Typography
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]',
|
||||
'default' => astra_get_option( 'primary-header-button-text-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Typography', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 20,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '==',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'primary-header-button-font-family',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]',
|
||||
'section' => 'section-primary-menu',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'default' => astra_get_option( 'primary-header-button-font-family' ),
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[primary-header-button-font-weight]',
|
||||
'priority' => 1,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => 'primary-header-button-font-size',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]',
|
||||
'section' => 'section-primary-menu',
|
||||
'default' => astra_get_option( 'primary-header-button-font-size' ),
|
||||
'control' => 'ast-responsive-slider',
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'primary-header-button-font-weight',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]',
|
||||
'section' => 'section-primary-menu',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'primary-header-button-font-weight' ),
|
||||
'connect' => 'primary-header-button-font-family',
|
||||
'priority' => 2,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Text Transform
|
||||
*/
|
||||
array(
|
||||
'name' => 'primary-header-button-text-transform',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'primary-header-button-text-transform' ),
|
||||
'title' => __( 'Text Transform', 'astra' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]',
|
||||
'section' => 'section-primary-menu',
|
||||
'control' => 'ast-select',
|
||||
'priority' => 3,
|
||||
'choices' => array(
|
||||
'' => __( 'Inherit', 'astra' ),
|
||||
'none' => __( 'None', 'astra' ),
|
||||
'capitalize' => __( 'Capitalize', 'astra' ),
|
||||
'uppercase' => __( 'Uppercase', 'astra' ),
|
||||
'lowercase' => __( 'Lowercase', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Line Height
|
||||
*/
|
||||
array(
|
||||
'name' => 'primary-header-button-line-height',
|
||||
'control' => 'ast-slider',
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'default' => astra_get_option( 'primary-header-button-line-height' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]',
|
||||
'section' => 'section-primary-menu',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ),
|
||||
'title' => __( 'Line Height', 'astra' ),
|
||||
'suffix' => 'em',
|
||||
'priority' => 4,
|
||||
'input_attrs' => array(
|
||||
'min' => 1,
|
||||
'step' => 0.01,
|
||||
'max' => 5,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Header Button Letter Spacing
|
||||
*/
|
||||
array(
|
||||
'name' => 'primary-header-button-letter-spacing',
|
||||
'control' => 'ast-slider',
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'default' => astra_get_option( 'primary-header-button-letter-spacing' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-text-typography]',
|
||||
'section' => 'section-primary-menu',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ),
|
||||
'title' => __( 'Letter Spacing', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'priority' => 5,
|
||||
'input_attrs' => array(
|
||||
'min' => 1,
|
||||
'step' => 1,
|
||||
'max' => 100,
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Custom Menu Button Border.
|
||||
array(
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-padding]',
|
||||
'section' => 'section-primary-menu',
|
||||
'transport' => 'postMessage',
|
||||
'linked_choices' => true,
|
||||
'priority' => 21,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom-button',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '==',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-padding' ),
|
||||
'title' => __( 'Padding', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Size
|
||||
*/
|
||||
array(
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'control' => 'ast-border',
|
||||
'name' => 'header-main-rt-section-button-border-size',
|
||||
'transport' => 'postMessage',
|
||||
'linked_choices' => true,
|
||||
'priority' => 10,
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-border-size' ),
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-section-button-border-color',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-border-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 12,
|
||||
'title' => __( 'Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-section-button-border-h-color',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-border-h-color' ),
|
||||
'transport' => 'postMessage',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'priority' => 14,
|
||||
'title' => __( 'Hover Color', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Border Radius
|
||||
*/
|
||||
array(
|
||||
'name' => 'header-main-rt-section-button-border-radius',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-border-radius' ),
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[primary-header-button-border-group]',
|
||||
'section' => 'section-primary-menu',
|
||||
'control' => 'ast-slider',
|
||||
'suffix' => 'px',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 16,
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 100,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Existing_Button_Configs();
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* Astra Theme Customizer Configuration Base.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.4.3
|
||||
*/
|
||||
|
||||
// No direct access, please.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
if ( ! class_exists( 'Astra_Customizer_Config_Base' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
// Bail early if it is not astra customizer.
|
||||
if ( ! Astra_Customizer::is_astra_customizer() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter( 'astra_customizer_configurations', array( $this, 'register_configuration' ), 30, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Base Method for Registering Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
return $configurations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Section Description
|
||||
*
|
||||
* @since 1.4.3
|
||||
*
|
||||
* @param array $args Description arguments.
|
||||
* @return mixed Markup of the section description.
|
||||
*/
|
||||
public function section_get_description( $args ) {
|
||||
|
||||
// Return if white labeled.
|
||||
if ( astra_is_white_labelled() ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Description.
|
||||
$content = '<div class="astra-section-description">';
|
||||
$content .= wp_kses_post( astra_get_prop( $args, 'description' ) );
|
||||
|
||||
// Links.
|
||||
if ( astra_get_prop( $args, 'links' ) ) {
|
||||
$content .= '<ul>';
|
||||
foreach ( $args['links'] as $index => $link ) {
|
||||
|
||||
if ( astra_get_prop( $link, 'attrs' ) ) {
|
||||
|
||||
$content .= '<li>';
|
||||
|
||||
// Attribute mapping.
|
||||
$attributes = ' target="_blank" ';
|
||||
foreach ( astra_get_prop( $link, 'attrs' ) as $attr => $attr_value ) {
|
||||
$attributes .= ' ' . $attr . '="' . esc_attr( $attr_value ) . '" ';
|
||||
}
|
||||
$content .= '<a ' . $attributes . '>' . esc_html( astra_get_prop( $link, 'text' ) ) . '</a></li>';
|
||||
|
||||
$content .= '</li>';
|
||||
}
|
||||
}
|
||||
$content .= '</ul>';
|
||||
}
|
||||
|
||||
$content .= '</div><!-- .astra-section-description -->';
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Customizer_Config_Base();
|
||||
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 1.4.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Adv_Footer_Colors_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Advanced Footer Color Customizer Configurations.
|
||||
*/
|
||||
class Astra_Advanced_Footer_Colors_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Advanced Footer Color Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Footer Bar Content Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-widget-background-group]',
|
||||
'default' => astra_get_option( 'footer-widget-background-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'section' => 'section-footer-adv',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'priority' => 47,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Bar Content Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]',
|
||||
'default' => astra_get_option( 'footer-widget-content-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Content Colors', 'astra' ),
|
||||
'section' => 'section-footer-adv',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 48,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Bar Content Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]',
|
||||
'default' => astra_get_option( 'footer-widget-link-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Link Color', 'astra' ),
|
||||
'section' => 'section-footer-adv',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 48,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Widget Title Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-adv-wgt-title-color',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]',
|
||||
'section' => 'section-footer-adv',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Title Color', 'astra' ),
|
||||
'default' => astra_get_option( 'footer-adv-wgt-title-color' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Text Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-adv-text-color',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-content-group]',
|
||||
'section' => 'section-footer-adv',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'default' => astra_get_option( 'footer-adv-text-color' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-adv-link-color',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]',
|
||||
'section' => 'section-footer-adv',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'default' => astra_get_option( 'footer-adv-link-color' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-adv-link-h-color',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-link-color-group]',
|
||||
'section' => 'section-footer-adv',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'default' => astra_get_option( 'footer-adv-link-h-color' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer widget Background
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-adv-bg-obj',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-widget-background-group]',
|
||||
'section' => 'section-footer-adv',
|
||||
'control' => 'ast-background',
|
||||
'default' => astra_get_option( 'footer-adv-bg-obj' ),
|
||||
'label' => __( 'Background', 'astra' ),
|
||||
),
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Advanced_Footer_Colors_Configs();
|
||||
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 1.4.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Body_Colors_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Body Color Customizer Configurations.
|
||||
*/
|
||||
class Astra_Body_Colors_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Body Color Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_section = 'section-colors-background';
|
||||
|
||||
if ( class_exists( 'Astra_Ext_Extension' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) && ! astra_has_gcp_typo_preset_compatibility() ) {
|
||||
$_section = 'section-colors-body';
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[global-color-palette]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-hidden',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Global Palette', 'astra' ),
|
||||
'default' => astra_get_option( 'global-color-palette' ),
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'astra-color-palettes',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-palette',
|
||||
'section' => $_section,
|
||||
'priority' => 5,
|
||||
'title' => __( 'Global Palette', 'astra' ),
|
||||
'default' => astra_get_palette_colors(),
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme color heading
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[theme-color-divider-reset]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Theme Color', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-group-title',
|
||||
'priority' => 5,
|
||||
'settings' => array(),
|
||||
'input_attrs' => array(
|
||||
'reset_linked_controls' => array(
|
||||
'theme-color',
|
||||
'link-color',
|
||||
'link-h-color',
|
||||
'heading-base-color',
|
||||
'text-color',
|
||||
'border-color',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[theme-color]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'section' => $_section,
|
||||
'default' => astra_get_option( 'theme-color' ),
|
||||
'priority' => 5,
|
||||
'title' => __( 'Accent', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Colors group.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[base-link-colors-group]',
|
||||
'default' => astra_get_option( 'base-link-colors-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Links', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 5,
|
||||
'responsive' => false,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'link-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[base-link-colors-group]',
|
||||
'section' => $_section,
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'default' => astra_get_option( 'link-color' ),
|
||||
'priority' => 5,
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'link-h-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[base-link-colors-group]',
|
||||
'section' => $_section,
|
||||
'default' => astra_get_option( 'link-h-color' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 10,
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Text Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[text-color]',
|
||||
'default' => astra_get_option( 'text-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'section' => $_section,
|
||||
'priority' => 6,
|
||||
'title' => __( 'Body Text', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Text Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[border-color]',
|
||||
'default' => astra_get_option( 'border-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'section' => $_section,
|
||||
'priority' => 6,
|
||||
'title' => __( 'Borders', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Body_Colors_Configs();
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since 1.4.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Footer_Colors_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Footer Color Configurations.
|
||||
*/
|
||||
class Astra_Footer_Colors_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Footer Color Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-color',
|
||||
'type' => 'sub-control',
|
||||
'priority' => 5,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-content-group]',
|
||||
'section' => 'section-footer-small',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Text Color', 'astra' ),
|
||||
'default' => astra_get_option( 'footer-color' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-link-color',
|
||||
'type' => 'sub-control',
|
||||
'priority' => 6,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]',
|
||||
'section' => 'section-footer-small',
|
||||
'control' => 'ast-color',
|
||||
'default' => astra_get_option( 'footer-link-color' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Link Hover Color
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-link-h-color',
|
||||
'type' => 'sub-control',
|
||||
'priority' => 5,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]',
|
||||
'section' => 'section-footer-small',
|
||||
'control' => 'ast-color',
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'default' => astra_get_option( 'section-footer-small' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Background
|
||||
*/
|
||||
array(
|
||||
'name' => 'footer-bg-obj',
|
||||
'type' => 'sub-control',
|
||||
'priority' => 7,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[footer-bar-background-group]',
|
||||
'section' => 'section-footer-small',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-background',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_background_obj' ),
|
||||
'default' => astra_get_option( 'footer-bg-obj' ),
|
||||
'label' => __( 'Background', 'astra' ),
|
||||
),
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Footer_Colors_Configs();
|
||||
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* Comments options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 4.6.0
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'Astra_Comments_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Comments Customizer Configurations.
|
||||
*/
|
||||
class Astra_Comments_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Comments Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.8.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
$parent_section = 'section-blog-single';
|
||||
$_configs = array(
|
||||
array(
|
||||
'name' => 'comments-section-ast-context-tabs',
|
||||
'section' => 'ast-sub-section-comments',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
'context' => array(),
|
||||
),
|
||||
array(
|
||||
'name' => 'ast-sub-section-comments',
|
||||
'title' => __( 'Comments', 'astra' ),
|
||||
'type' => 'section',
|
||||
'section' => $parent_section,
|
||||
'panel' => '',
|
||||
'priority' => 1,
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[comments-single-section-heading]',
|
||||
'section' => $parent_section,
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'title' => __( 'Comments', 'astra' ),
|
||||
'priority' => 20,
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[enable-comments-area]',
|
||||
'type' => 'control',
|
||||
'default' => astra_get_option( 'enable-comments-area' ),
|
||||
'control' => 'ast-section-toggle',
|
||||
'section' => $parent_section,
|
||||
'priority' => 20,
|
||||
'linked' => 'ast-sub-section-comments',
|
||||
'linkText' => __( 'Comments', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider ast-bottom-section-divider' ),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[comments-box-placement]',
|
||||
'default' => astra_get_option( 'comments-box-placement' ),
|
||||
'type' => 'control',
|
||||
'section' => 'ast-sub-section-comments',
|
||||
'priority' => 20,
|
||||
'title' => __( 'Section Placement', 'astra' ),
|
||||
'control' => 'ast-selector',
|
||||
'description' => __( 'Decide whether to isolate or integrate the module with the entry content area.', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'Default', 'astra' ),
|
||||
'inside' => __( 'Contained', 'astra' ),
|
||||
'outside' => __( 'Separated', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[comments-box-container-width]',
|
||||
'default' => astra_get_option( 'comments-box-container-width' ),
|
||||
'type' => 'control',
|
||||
'section' => 'ast-sub-section-comments',
|
||||
'priority' => 20,
|
||||
'title' => __( 'Container Structure', 'astra' ),
|
||||
'control' => 'ast-selector',
|
||||
'choices' => array(
|
||||
'narrow' => __( 'Narrow', 'astra' ),
|
||||
'' => __( 'Full Width', 'astra' ),
|
||||
),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[comments-box-placement]',
|
||||
'operator' => '==',
|
||||
'value' => 'outside',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-spacing' ),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[comment-form-position]',
|
||||
'default' => astra_get_option( 'comment-form-position' ),
|
||||
'type' => 'control',
|
||||
'section' => 'ast-sub-section-comments',
|
||||
'priority' => 20,
|
||||
'title' => __( 'Form Position', 'astra' ),
|
||||
'control' => 'ast-selector',
|
||||
'choices' => array(
|
||||
'below' => __( 'Below Comments', 'astra' ),
|
||||
'above' => __( 'Above Comments', 'astra' ),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, Astra_Extended_Base_Configuration::prepare_section_spacing_border_options( 'ast-sub-section-comments', true ) );
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by creating new instance.
|
||||
*/
|
||||
new Astra_Comments_Configs();
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Global Misc Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 4.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Astra Global Misc Configurations.
|
||||
*/
|
||||
class Astra_Global_Misc_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Astra Global Misc Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 4.0.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Scroll to id.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[enable-scroll-to-id]',
|
||||
'default' => astra_get_option( 'enable-scroll-to-id' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'title' => __( 'Enable Smooth Scroll to ID', 'astra' ),
|
||||
'section' => 'section-global-misc',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'priority' => 10,
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Global_Misc_Configs();
|
||||
@@ -0,0 +1,718 @@
|
||||
<?php
|
||||
/**
|
||||
* Bottom Footer Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Blog_Layout_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Blog Layout Customizer Configurations.
|
||||
*/
|
||||
class Astra_Blog_Layout_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Blog Layout Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$astra_backwards = Astra_Dynamic_CSS::astra_4_6_0_compatibility();
|
||||
|
||||
$old_blog_layouts = array();
|
||||
$old_blog_layouts_free = array();
|
||||
$new_blog_layouts = array();
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
$if_astra_addon = defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'blog-pro' );
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
|
||||
if ( false === $astra_backwards ) {
|
||||
$old_blog_layouts = array(
|
||||
'blog-layout-1' => array(
|
||||
'label' => __( 'Layout 1', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-1', false ) : '',
|
||||
),
|
||||
'blog-layout-2' => array(
|
||||
'label' => __( 'Layout 2', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-2', false ) : '',
|
||||
),
|
||||
'blog-layout-3' => array(
|
||||
'label' => __( 'Layout 3', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-3', false ) : '',
|
||||
),
|
||||
);
|
||||
|
||||
$old_blog_layouts_free = array(
|
||||
'blog-layout-classic' => array(
|
||||
'label' => __( 'Classic Layout', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-classic', false ) : '',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$new_blog_layouts = array(
|
||||
'blog-layout-4' => array(
|
||||
'label' => __( 'Grid', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-4', false ) : '',
|
||||
),
|
||||
'blog-layout-5' => array(
|
||||
'label' => __( 'List', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-5', false ) : '',
|
||||
),
|
||||
'blog-layout-6' => array(
|
||||
'label' => __( 'Cover', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'blog-layout-6', false ) : '',
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
if ( $if_astra_addon ) {
|
||||
$blog_layout = array_merge(
|
||||
$old_blog_layouts,
|
||||
$new_blog_layouts
|
||||
);
|
||||
} else {
|
||||
$blog_layout = array_merge(
|
||||
$old_blog_layouts_free,
|
||||
$new_blog_layouts
|
||||
);
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Blog Content Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-width]',
|
||||
'default' => astra_get_option( 'blog-width' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-blog',
|
||||
'priority' => 50,
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Content Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'custom' => __( 'Custom', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Enter Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-max-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'section' => 'section-blog',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'blog-max-width' ),
|
||||
'priority' => 50,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-width]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'title' => __( 'Custom Width', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 768,
|
||||
'step' => 1,
|
||||
'max' => 1920,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Post Content
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-post-content',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Post Content', 'astra' ),
|
||||
'default' => astra_get_option( 'blog-post-content' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-selector',
|
||||
'linked' => 'excerpt',
|
||||
'priority' => 75,
|
||||
'choices' => array(
|
||||
'full-content' => __( 'Full Content', 'astra' ),
|
||||
'excerpt' => __( 'Excerpt', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'input_attrs' => array(
|
||||
'dependents' => array(
|
||||
'excerpt' => array( 'blog-excerpt-count' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-divider]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Blog Layout', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 14,
|
||||
'settings' => array(),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Layout
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-layout]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'section' => 'section-blog',
|
||||
'default' => astra_get_option( 'blog-layout' ),
|
||||
'priority' => 14,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'choices' => $blog_layout,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Post Per Page
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-post-per-page]',
|
||||
'default' => astra_get_option( 'blog-post-per-page' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-number',
|
||||
'qty_selector' => true,
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Post Per Page', 'astra' ),
|
||||
'priority' => 14,
|
||||
'responsive' => false,
|
||||
'input_attrs' => array(
|
||||
'min' => 1,
|
||||
'step' => 1,
|
||||
'max' => 500,
|
||||
),
|
||||
'divider' => array( 'ast_class' => ( $if_astra_addon ) ? 'ast-top-dotted-divider' : 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[archive-post-content-structure-divider]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Posts Structure', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 51,
|
||||
'settings' => array(),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-spacing' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'default' => astra_get_option( 'blog-post-structure' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-sortable',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ),
|
||||
'section' => 'section-blog',
|
||||
'priority' => 52,
|
||||
'title' => __( 'Post Elements', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-spacing' ),
|
||||
'choices' => array(
|
||||
'image' => array(
|
||||
'clone' => false,
|
||||
'is_parent' => true,
|
||||
'main_index' => 'image',
|
||||
'clone_limit' => 1,
|
||||
'title' => __( 'Featured Image', 'astra' ),
|
||||
),
|
||||
'category' => array(
|
||||
'clone' => false,
|
||||
'is_parent' => true,
|
||||
'main_index' => 'category',
|
||||
'clone_limit' => 1,
|
||||
'title' => __( 'Categories', 'astra' ),
|
||||
),
|
||||
'tag' => array(
|
||||
'clone' => false,
|
||||
'is_parent' => true,
|
||||
'main_index' => 'tag',
|
||||
'clone_limit' => 1,
|
||||
'title' => __( 'Tags', 'astra' ),
|
||||
),
|
||||
'title' => __( 'Title', 'astra' ),
|
||||
'title-meta' => array(
|
||||
'clone' => false,
|
||||
'is_parent' => true,
|
||||
'main_index' => 'title-meta',
|
||||
'clone_limit' => 1,
|
||||
'title' => __( 'Post Meta', 'astra' ),
|
||||
),
|
||||
'excerpt' => array(
|
||||
'clone' => false,
|
||||
'is_parent' => true,
|
||||
'main_index' => 'excerpt',
|
||||
'clone_limit' => 1,
|
||||
'title' => __( 'Excerpt', 'astra' ),
|
||||
),
|
||||
'read-more' => array(
|
||||
'clone' => false,
|
||||
'is_parent' => $if_astra_addon ? true : false,
|
||||
'main_index' => 'read-more',
|
||||
'clone_limit' => 1,
|
||||
'title' => __( 'Read More', 'astra' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Date Meta Type.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-meta-date-type',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-meta]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-blog',
|
||||
'default' => astra_get_option( 'blog-meta-date-type' ),
|
||||
'priority' => 1,
|
||||
'linked' => 'date',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Type', 'astra' ),
|
||||
'choices' => array(
|
||||
'published' => __( 'Published', 'astra' ),
|
||||
'updated' => __( 'Last Updated', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-spacing' ),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Date format support for meta field.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-meta-date-format',
|
||||
'default' => astra_get_option( 'blog-meta-date-format' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-meta]',
|
||||
'linked' => 'date',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-select',
|
||||
'transport' => 'postMessage',
|
||||
'section' => 'section-blog',
|
||||
'priority' => 2,
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'title' => __( 'Format', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'Default', 'astra' ),
|
||||
'F j, Y' => 'November 6, 2010',
|
||||
'Y-m-d' => '2010-11-06',
|
||||
'm/d/Y' => '11/06/2010',
|
||||
'd/m/Y' => '06/11/2010',
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Image Ratio Type.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-image-ratio-type',
|
||||
'default' => astra_get_option( 'blog-image-ratio-type' ),
|
||||
'type' => 'sub-control',
|
||||
'transport' => 'postMessage',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'linked' => 'image',
|
||||
'priority' => 5,
|
||||
'control' => 'ast-selector',
|
||||
'title' => __( 'Image Ratio', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'Original', 'astra' ),
|
||||
'predefined' => __( 'Predefined', 'astra' ),
|
||||
'custom' => __( 'Custom', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'contextual_sub_control' => true,
|
||||
'input_attrs' => array(
|
||||
'dependents' => array(
|
||||
'' => array( 'blog-original-image-scale-description' ),
|
||||
'predefined' => array( 'blog-image-ratio-pre-scale' ),
|
||||
'custom' => array( 'blog-image-custom-scale-width', 'blog-image-custom-scale-height', 'blog-custom-image-scale-description' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Image Ratio Scale.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-image-ratio-pre-scale',
|
||||
'default' => astra_get_option( 'blog-image-ratio-pre-scale', '16/9' ),
|
||||
'type' => 'sub-control',
|
||||
'transport' => 'postMessage',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'linked' => 'image',
|
||||
'section' => 'section-blog',
|
||||
'priority' => 10,
|
||||
'control' => 'ast-selector',
|
||||
'choices' => array(
|
||||
'1/1' => __( '1:1', 'astra' ),
|
||||
'4/3' => __( '4:3', 'astra' ),
|
||||
'16/9' => __( '16:9', 'astra' ),
|
||||
'2/1' => __( '2:1', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Image Scale width.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-image-custom-scale-width',
|
||||
'default' => astra_get_option( 'blog-image-custom-scale-width', 16 ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-number',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'qty_selector' => true,
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'linked' => 'image',
|
||||
'priority' => 11,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Image Scale height.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-image-custom-scale-height',
|
||||
'default' => astra_get_option( 'blog-image-custom-scale-height', 9 ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-number',
|
||||
'qty_selector' => true,
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Height', 'astra' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'linked' => 'image',
|
||||
'priority' => 12,
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'blog-custom-image-scale-description',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'linked' => 'image',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-blog',
|
||||
'priority' => 14,
|
||||
'label' => '',
|
||||
'help' => sprintf( /* translators: 1: link open markup, 2: link close markup */ __( 'Calculate a personalized image ratio using this %1$s online tool %2$s for your image dimensions.', 'astra' ), '<a href="' . esc_url( 'https://www.digitalrebellion.com/webapps/aspectcalc' ) . '" target="_blank">', '</a>' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Hover Effect.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-hover-effect',
|
||||
'default' => astra_get_option( 'blog-hover-effect' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'linked' => 'image',
|
||||
'type' => 'sub-control',
|
||||
'priority' => 17,
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Hover Effect', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'control' => 'ast-selector',
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'choices' => array(
|
||||
'none' => __( 'None', 'astra' ),
|
||||
'zoom-in' => __( 'Zoom In', 'astra' ),
|
||||
'zoom-out' => __( 'Zoom Out', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Image Size.
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-image-size',
|
||||
'default' => astra_get_option( 'blog-image-size', 'large' ),
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'linked' => 'image',
|
||||
'type' => 'sub-control',
|
||||
'priority' => 17,
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Image Size', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'control' => 'ast-select',
|
||||
'choices' => astra_get_site_image_sizes(),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-post-color-divider]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Post Cards', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 1,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-layout]',
|
||||
'operator' => '===',
|
||||
'value' => 'blog-layout-6',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[post-card-featured-overlay]',
|
||||
'default' => astra_get_option( 'post-card-featured-overlay' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'section' => 'section-blog',
|
||||
'priority' => 2.5,
|
||||
'title' => __( 'Background Overlay', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-layout]',
|
||||
'operator' => '===',
|
||||
'value' => 'blog-layout-6',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Card Radius
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[post-card-border-radius]',
|
||||
'default' => astra_get_option( 'post-card-border-radius' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'transport' => 'postMessage',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'priority' => $if_astra_addon ? 144 : 2.5,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'connected' => false,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Category Style
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-category-style',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Style', 'astra' ),
|
||||
'default' => astra_get_option( 'blog-category-style' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-selector',
|
||||
'linked' => 'category',
|
||||
'priority' => 75,
|
||||
'transport' => 'refresh',
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'badge' => __( 'Badge', 'astra' ),
|
||||
'underline' => __( 'Underline', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Tag Style
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-tag-style',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Style', 'astra' ),
|
||||
'default' => astra_get_option( 'blog-tag-style' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-selector',
|
||||
'transport' => 'postMessage',
|
||||
'linked' => 'tag',
|
||||
'priority' => 75,
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'badge' => __( 'Badge', 'astra' ),
|
||||
'underline' => __( 'Underline', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Blog Meta Category Divider Type
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-post-meta-divider-type',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Divider Type', 'astra' ),
|
||||
'default' => astra_get_option( 'blog-post-meta-divider-type' ),
|
||||
'type' => 'sub-control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-selector',
|
||||
'linked' => 'title-meta',
|
||||
'priority' => 75,
|
||||
'choices' => array(
|
||||
'/' => '/',
|
||||
'-' => '-',
|
||||
'|' => '|',
|
||||
'•' => '•',
|
||||
'none' => __( 'None', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Meta Category Style
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-meta-category-style',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-meta]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Style', 'astra' ),
|
||||
'default' => astra_get_option( 'blog-meta-category-style' ),
|
||||
'type' => 'sub-control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-selector',
|
||||
'linked' => 'category',
|
||||
'priority' => 75,
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'underline' => __( 'Underline', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Blog Meta Tag Style
|
||||
*/
|
||||
array(
|
||||
'name' => 'blog-meta-tag-style',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[blog-meta]',
|
||||
'section' => 'section-blog',
|
||||
'title' => __( 'Style', 'astra' ),
|
||||
'default' => astra_get_option( 'blog-meta-tag-style' ),
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-selector',
|
||||
'transport' => 'postMessage',
|
||||
'linked' => 'tag',
|
||||
'priority' => 75,
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'underline' => __( 'Underline', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
);
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => 'section-blog-ast-context-tabs',
|
||||
'section' => 'section-blog',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
);
|
||||
|
||||
/** @psalm-suppress UndefinedClass */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ! Astra_Ext_Extension::is_active( 'blog-pro' ) ) ) {
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-meta]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-sortable',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_multi_choices' ),
|
||||
'section' => 'section-blog',
|
||||
'default' => astra_get_option( 'blog-meta' ),
|
||||
'priority' => 52,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'operator' => 'contains',
|
||||
'value' => 'title-meta',
|
||||
),
|
||||
),
|
||||
'title' => __( 'Meta', 'astra' ),
|
||||
'choices' => array(
|
||||
'comments' => __( 'Comments', 'astra' ),
|
||||
'category' => __( 'Categories', 'astra' ),
|
||||
'author' => __( 'Author', 'astra' ),
|
||||
'date' => array(
|
||||
'clone' => false,
|
||||
'is_parent' => true,
|
||||
'main_index' => 'date',
|
||||
'clone_limit' => 1,
|
||||
'title' => __( 'Date', 'astra' ),
|
||||
),
|
||||
'tag' => __( 'Tags', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
);
|
||||
}
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Blog_Layout_Configs();
|
||||
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
/**
|
||||
* Bottom Footer Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Blog_Single_Layout_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Blog Single Layout Configurations.
|
||||
*/
|
||||
class Astra_Blog_Single_Layout_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Blog Single Layout Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
/** @psalm-suppress DocblockTypeContradiction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
$tab_config = Astra_Builder_Helper::$design_tab;
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Single Post Content Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-single-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-blog-single',
|
||||
'default' => astra_get_option( 'blog-single-width' ),
|
||||
'priority' => 6,
|
||||
'title' => __( 'Content Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'default' => __( 'Default', 'astra' ),
|
||||
'custom' => __( 'Custom', 'astra' ),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'responsive' => false,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Enter Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[blog-single-max-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'section' => 'section-blog-single',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'blog-single-max-width' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-single-width]',
|
||||
'operator' => '===',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'priority' => 6,
|
||||
'title' => __( 'Custom Width', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 1920,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Content images shadow
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[single-content-images-shadow]',
|
||||
'default' => astra_get_option( 'single-content-images-shadow' ),
|
||||
'type' => 'control',
|
||||
'section' => 'section-blog-single',
|
||||
'title' => __( 'Content Images Box Shadow', 'astra' ),
|
||||
'control' => 'ast-toggle-control',
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-spacing' ),
|
||||
'priority' => 9,
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[section-blog-single-spacing-divider]',
|
||||
'section' => 'section-blog-single',
|
||||
'title' => __( 'Post Spacing', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 24,
|
||||
'context' => $tab_config,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Single Post Spacing
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[single-post-outside-spacing]',
|
||||
'default' => astra_get_option( 'single-post-outside-spacing' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => 'section-blog-single',
|
||||
'title' => __( 'Outside', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 25,
|
||||
'context' => $tab_config,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Single Post Margin
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[single-post-inside-spacing]',
|
||||
'default' => astra_get_option( 'single-post-inside-spacing' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-spacing',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_spacing' ),
|
||||
'section' => 'section-blog-single',
|
||||
'title' => __( 'Inside', 'astra' ),
|
||||
'linked_choices' => true,
|
||||
'transport' => 'refresh',
|
||||
'unit_choices' => array( 'px', 'em', '%' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
'priority' => 30,
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'context' => $tab_config,
|
||||
),
|
||||
);
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => 'section-blog-single-ast-context-tabs',
|
||||
'section' => 'section-blog-single',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-builder-header-control',
|
||||
'priority' => 0,
|
||||
'description' => '',
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Blog_Single_Layout_Configs();
|
||||
@@ -0,0 +1,480 @@
|
||||
<?php
|
||||
/**
|
||||
* Bottom Footer Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Footer_Layout_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Footer Layout Configurations.
|
||||
*/
|
||||
class Astra_Footer_Layout_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Footer Layout Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Footer Bar Layout
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'default' => astra_get_option( 'footer-sml-layout' ),
|
||||
'section' => 'section-footer-small',
|
||||
'priority' => 5,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'choices' => array(
|
||||
'disabled' => array(
|
||||
'label' => __( 'Disabled', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'disabled' ),
|
||||
),
|
||||
'footer-sml-layout-1' => array(
|
||||
'label' => __( 'Footer Bar Layout 1', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-1' ),
|
||||
),
|
||||
'footer-sml-layout-2' => array(
|
||||
'label' => __( 'Footer Bar Layout 2', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-2' ),
|
||||
),
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-small-footer',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Section: Section 1
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1]',
|
||||
'control' => 'ast-selector',
|
||||
'default' => astra_get_option( 'footer-sml-section-1' ),
|
||||
'type' => 'control',
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'section' => 'section-footer-small',
|
||||
'priority' => 15,
|
||||
'title' => __( 'Section 1', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-divider' ),
|
||||
'choices' => array(
|
||||
'' => __( 'None', 'astra' ),
|
||||
'custom' => __( 'Text', 'astra' ),
|
||||
'widget' => __( 'Widget', 'astra' ),
|
||||
'menu' => __( 'Footer Menu', 'astra' ),
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-small-footer .ast-container .ast-footer-widget-1-area .ast-no-widget-row, .ast-small-footer .ast-container .ast-small-footer-section-1 .footer-primary-navigation .nav-menu',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
/**
|
||||
* Option: Section 1 Custom Text
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1-credit]',
|
||||
'default' => astra_get_option( 'footer-sml-section-1-credit' ),
|
||||
'type' => 'control',
|
||||
'control' => 'textarea',
|
||||
'transport' => 'postMessage',
|
||||
'section' => 'section-footer-small',
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-section-1]',
|
||||
'operator' => '==',
|
||||
'value' => array( 'custom' ),
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'priority' => 20,
|
||||
'title' => __( 'Section 1 Custom Text', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'None', 'astra' ),
|
||||
'custom' => __( 'Custom Text', 'astra' ),
|
||||
'widget' => __( 'Widget', 'astra' ),
|
||||
'menu' => __( 'Footer Menu', 'astra' ),
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-small-footer .ast-container .ast-small-footer-section.ast-small-footer-section-1:has(> .ast-footer-site-title)',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Customizer_Partials::render_footer_sml_section_1_credit',
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Section 2
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'default' => astra_get_option( 'footer-sml-section-2' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'section' => 'section-footer-small',
|
||||
'priority' => 25,
|
||||
'title' => __( 'Section 2', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'None', 'astra' ),
|
||||
'custom' => __( 'Text', 'astra' ),
|
||||
'widget' => __( 'Widget', 'astra' ),
|
||||
'menu' => __( 'Footer Menu', 'astra' ),
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-small-footer .ast-container .ast-footer-widget-2-area .ast-no-widget-row, .ast-small-footer .ast-container .ast-small-footer-section-2 .footer-primary-navigation .nav-menu',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Section 2 Custom Text
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2-credit]',
|
||||
'type' => 'control',
|
||||
'control' => 'textarea',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'footer-sml-section-2-credit' ),
|
||||
'section' => 'section-footer-small',
|
||||
'priority' => 30,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-section-2]',
|
||||
'operator' => '==',
|
||||
'value' => 'custom',
|
||||
),
|
||||
),
|
||||
'title' => __( 'Section 2 Custom Text', 'astra' ),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-small-footer-section-2',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Customizer_Partials::render_footer_sml_section_2_credit',
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.ast-small-footer .ast-container .ast-small-footer-section.ast-small-footer-section-2:has(> .ast-footer-site-title)',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Top Border
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-sml-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'default' => astra_get_option( 'footer-sml-divider' ),
|
||||
'section' => 'section-footer-small',
|
||||
'priority' => 40,
|
||||
'suffix' => 'px',
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'title' => __( 'Border Size', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Top Border Color
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-sml-divider-color]',
|
||||
'section' => 'section-footer-small',
|
||||
'default' => astra_get_option( 'footer-sml-divider-color', '#7a7a7a' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-divider]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'priority' => 45,
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Bar Content Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-bar-background-group]',
|
||||
'default' => astra_get_option( 'footer-bar-background-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Background Color', 'astra' ),
|
||||
'section' => 'section-footer-small',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'priority' => 47,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Bar Content Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-bar-content-group]',
|
||||
'default' => astra_get_option( 'footer-bar-content-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Content Colors', 'astra' ),
|
||||
'section' => 'section-footer-small',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 47,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Bar Content Group
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-bar-link-color-group]',
|
||||
'default' => astra_get_option( 'footer-bar-link-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Link Color', 'astra' ),
|
||||
'section' => 'section-footer-small',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 47,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-layout-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'default' => astra_get_option( 'footer-layout-width' ),
|
||||
'section' => 'section-footer-small',
|
||||
'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-divider' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[site-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'ast-box-layout',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[site-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'ast-fluid-width-layout',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-sml-layout]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'priority' => 35,
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'astra' ),
|
||||
'content' => __( 'Content Width', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Top Border
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-adv-border-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'transport' => 'postMessage',
|
||||
'section' => 'section-footer-adv',
|
||||
'default' => astra_get_option( 'footer-adv-border-width' ),
|
||||
'priority' => 40,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'suffix' => 'px',
|
||||
'title' => __( 'Top Border Size', 'astra' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Footer Top Border Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-adv-border-color]',
|
||||
'section' => 'section-footer-adv',
|
||||
'title' => __( 'Top Border Color', 'astra' ),
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'control' => 'ast-color',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'default' => astra_get_option( 'footer-adv-border-color' ),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[footer-adv]',
|
||||
'operator' => '!=',
|
||||
'value' => 'disabled',
|
||||
),
|
||||
),
|
||||
'priority' => 45,
|
||||
),
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
// Learn More link if Astra Pro is not activated.
|
||||
if ( ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && false === Astra_Ext_Extension::is_active( 'advanced-footer' ) ) ) {
|
||||
|
||||
$config = array(
|
||||
|
||||
/**
|
||||
* Option: Footer Widgets Layout Layout
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[footer-adv]',
|
||||
'type' => 'control',
|
||||
'priority' => 0,
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'default' => astra_get_option( 'footer-adv' ),
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'section' => 'section-footer-adv',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'choices' => array(
|
||||
'disabled' => array(
|
||||
'label' => __( 'Disable', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'disabled' ),
|
||||
),
|
||||
'layout-4' => array(
|
||||
'label' => __( 'Layout 4', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'footer-layout-4' ),
|
||||
),
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.footer-adv .ast-container',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Learn More about Footer Widget
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-footer-widget-more-feature-description]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-footer-adv',
|
||||
'priority' => 999,
|
||||
'label' => '',
|
||||
'help' => '<p>' . __( 'More Options Available in Astra Pro!', 'astra' ) . '</p><a href="' . ASTRA_PRO_CUSTOMIZER_UPGRADE_URL . '" class="button button-secondary" target="_blank" rel="noopener">' . __( 'Learn More', 'astra' ) . '</a>',
|
||||
'settings' => array(),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $config );
|
||||
}
|
||||
|
||||
return $configurations;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
new Astra_Footer_Layout_Configs();
|
||||
@@ -0,0 +1,689 @@
|
||||
<?php
|
||||
/**
|
||||
* General Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Header_Layout_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Header Layout Customizer Configurations.
|
||||
*/
|
||||
class Astra_Header_Layout_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Header Layout Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Header Layout
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-layouts]',
|
||||
'default' => astra_get_option( 'header-layouts' ),
|
||||
'section' => 'section-header',
|
||||
'priority' => 4,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'choices' => array(
|
||||
'header-main-layout-1' => array(
|
||||
'label' => __( 'Logo Left', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-1' ),
|
||||
),
|
||||
'header-main-layout-2' => array(
|
||||
'label' => __( 'Logo Center', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-2' ),
|
||||
),
|
||||
'header-main-layout-3' => array(
|
||||
'label' => __( 'Logo Right', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'header-main-layout-3' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Header Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-layout-width]',
|
||||
'default' => astra_get_option( 'header-main-layout-width' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'section' => 'section-header',
|
||||
'priority' => 4,
|
||||
'title' => __( 'Width', 'astra' ),
|
||||
'choices' => array(
|
||||
'full' => __( 'Full Width', 'astra' ),
|
||||
'content' => __( 'Content Width', 'astra' ),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Bottom Border Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-sep]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-main-sep' ),
|
||||
'type' => 'control',
|
||||
'control' => 'number',
|
||||
'section' => 'section-header',
|
||||
'priority' => 4,
|
||||
'title' => __( 'Bottom Border Size', 'astra' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Bottom Border Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-sep-color]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-main-sep-color' ),
|
||||
'type' => 'control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-sep]',
|
||||
'operator' => '>=',
|
||||
'value' => 1,
|
||||
),
|
||||
),
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'section' => 'section-header',
|
||||
'priority' => 4,
|
||||
'title' => __( 'Bottom Border Color', 'astra' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]',
|
||||
'default' => astra_get_option( 'disable-primary-nav' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => 'section-primary-menu',
|
||||
'title' => __( 'Disable Menu', 'astra' ),
|
||||
'priority' => 5,
|
||||
'partial' => array(
|
||||
'selector' => '.main-header-bar .main-navigation',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'default' => astra_get_option( 'header-main-rt-section' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'section' => 'section-primary-menu',
|
||||
'priority' => 7,
|
||||
'title' => __( 'Last Item in Menu', 'astra' ),
|
||||
'choices' => apply_filters(
|
||||
'astra_header_section_elements',
|
||||
array(
|
||||
'none' => __( 'None', 'astra' ),
|
||||
'search' => __( 'Search', 'astra' ),
|
||||
'button' => __( 'Button', 'astra' ),
|
||||
'text-html' => __( 'Text / HTML', 'astra' ),
|
||||
'widget' => __( 'Widget', 'astra' ),
|
||||
),
|
||||
'primary-header'
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.search-custom-menu-item .ast-search-icon .astra-search-icon, .main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.woocommerce-custom-menu-item, .main-header-bar .ast-masthead-custom-menu-items.widget-custom-menu-item .ast-header-widget-area .widget.ast-no-widget-row, .main-header-bar .main-navigation .main-header-menu .ast-masthead-custom-menu-items.edd-custom-menu-item',
|
||||
'container_inclusive' => false,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Text
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-text]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-text' ),
|
||||
'type' => 'control',
|
||||
'control' => 'text',
|
||||
'section' => 'section-primary-menu',
|
||||
'partial' => array(
|
||||
'selector' => '.button-custom-menu-item',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Customizer_Partials::render_header_main_rt_section_button_text',
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '===',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Button Text', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Link
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-link-option]',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-link-option' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-link',
|
||||
'section' => 'section-primary-menu',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '===',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
'priority' => 10,
|
||||
'title' => __( 'Button Link', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Button Style
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'default' => astra_get_option( 'header-main-rt-section-button-style' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'section' => 'section-primary-menu',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '===',
|
||||
'value' => 'button',
|
||||
),
|
||||
),
|
||||
'priority' => 10,
|
||||
'choices' => array(
|
||||
'theme-button' => __( 'Theme Button', 'astra' ),
|
||||
'custom-button' => __( 'Header Button', 'astra' ),
|
||||
),
|
||||
'title' => __( 'Button Style', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme Button Style edit link
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-button-style-link]',
|
||||
'default' => astra_get_option( 'header-button-style-link' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => 'section-primary-menu',
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '===',
|
||||
'value' => 'button',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-button-style]',
|
||||
'operator' => '===',
|
||||
'value' => 'theme-button',
|
||||
),
|
||||
),
|
||||
'priority' => 10,
|
||||
'link_type' => 'section',
|
||||
'linked' => 'section-buttons',
|
||||
'link_text' => __( 'Customize Button Style.', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Right Section Text / HTML
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-rt-section-html]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-main-rt-section-html' ),
|
||||
'type' => 'control',
|
||||
'control' => 'textarea',
|
||||
'section' => 'section-primary-menu',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '===',
|
||||
'value' => 'text-html',
|
||||
),
|
||||
),
|
||||
'priority' => 10,
|
||||
'partial' => array(
|
||||
'selector' => '.main-header-bar .ast-masthead-custom-menu-items .ast-custom-html',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Customizer_Partials::render_header_main_rt_section_html',
|
||||
),
|
||||
'title' => __( 'Custom Menu Text / HTML', 'astra' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'primary-header-sub-menu-label-divider',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 30,
|
||||
'title' => __( 'Sub Menu', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'settings' => array(),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Submenu Container Animation
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-submenu-container-animation]',
|
||||
'default' => astra_get_option( 'header-main-submenu-container-animation' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'section' => 'section-primary-menu',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]',
|
||||
'operator' => '!=',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'priority' => 30,
|
||||
'title' => __( 'Submenu Animation', 'astra' ),
|
||||
'choices' => array(
|
||||
'' => __( 'None', 'astra' ),
|
||||
'slide-down' => __( 'Slide Down', 'astra' ),
|
||||
'slide-up' => __( 'Slide Up', 'astra' ),
|
||||
'fade' => __( 'Fade', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Primary Menu Border.
|
||||
array(
|
||||
'type' => 'control',
|
||||
'control' => 'ast-border',
|
||||
'transport' => 'postMessage',
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-border]',
|
||||
'section' => 'section-primary-menu',
|
||||
'linked_choices' => true,
|
||||
'priority' => 30,
|
||||
'default' => astra_get_option( 'primary-submenu-border' ),
|
||||
'title' => __( 'Container Border', 'astra' ),
|
||||
'choices' => array(
|
||||
'top' => __( 'Top', 'astra' ),
|
||||
'right' => __( 'Right', 'astra' ),
|
||||
'bottom' => __( 'Bottom', 'astra' ),
|
||||
'left' => __( 'Left', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Submenu Container Border Color.
|
||||
array(
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-b-color]',
|
||||
'default' => astra_get_option( 'primary-submenu-b-color' ),
|
||||
'title' => __( 'Border Color', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'priority' => 30,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'transport' => 'postMessage',
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-border]',
|
||||
'section' => 'section-primary-menu',
|
||||
'priority' => 30,
|
||||
'default' => astra_get_option( 'primary-submenu-item-border' ),
|
||||
'title' => __( 'Submenu Divider', 'astra' ),
|
||||
),
|
||||
|
||||
// Option: Submenu item Border Color.
|
||||
array(
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'transport' => 'postMessage',
|
||||
'name' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-b-color]',
|
||||
'default' => astra_get_option( 'primary-submenu-item-b-color' ),
|
||||
'title' => __( 'Divider Color', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[primary-submenu-item-border]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'priority' => 30,
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Mobile Menu Label Divider
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-label-divider]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'section' => 'section-header',
|
||||
'priority' => 35,
|
||||
'title' => __( 'Mobile Header', 'astra' ),
|
||||
'settings' => array(),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Mobile Menu Alignment
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-align]',
|
||||
'default' => astra_get_option( 'header-main-menu-align' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'choices' => array(
|
||||
'inline' => array(
|
||||
'label' => __( 'Inline', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'menu-inline' ),
|
||||
),
|
||||
'stack' => array(
|
||||
'label' => __( 'Stack', 'astra' ),
|
||||
'path' => Astra_Builder_UI_Controller::fetch_svg_icon( 'menu-stack' ),
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'section' => 'section-header',
|
||||
'priority' => 40,
|
||||
'title' => __( 'Layout', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Hide Last item in Menu on mobile device
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[hide-custom-menu-mobile]',
|
||||
'default' => astra_get_option( 'hide-custom-menu-mobile' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'search', 'button', 'text-html', 'widget', 'woocommerce' ),
|
||||
),
|
||||
),
|
||||
'section' => 'section-primary-menu',
|
||||
'title' => __( 'Hide Last Item in Menu on Mobile', 'astra' ),
|
||||
'priority' => 7,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider ast-top-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Display outside menu
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-display-outside-menu]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'search', 'button', 'text-html', 'widget', 'woocommerce' ),
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[hide-custom-menu-mobile]',
|
||||
'operator' => '!=',
|
||||
'value' => '1',
|
||||
),
|
||||
),
|
||||
'default' => astra_get_option( 'header-display-outside-menu' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'title' => __( 'Take Last Item Outside Menu', 'astra' ),
|
||||
'priority' => 7,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'primary-menu-label-divider',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 39,
|
||||
'title' => __( 'Mobile Menu', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'settings' => array(),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Mobile Header Breakpoint
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-breakpoint]',
|
||||
'default' => astra_get_option( 'mobile-header-breakpoint' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'section' => 'section-primary-menu',
|
||||
'priority' => 40,
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ),
|
||||
'title' => __( 'Menu Breakpoint', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 10,
|
||||
'max' => 6000,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Notice to add # link to parent menu when Link option selected in Dropdown Target.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target-link-notice]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-header',
|
||||
'priority' => 41,
|
||||
'title' => '',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target]',
|
||||
'operator' => '==',
|
||||
'value' => 'link',
|
||||
),
|
||||
),
|
||||
'help' => __( 'The parent menu should have a # link for the submenu to open on a link.', 'astra' ),
|
||||
'settings' => array(),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Mobile Menu Label.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-main-menu-label]',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-main-menu-label' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'context' => array(
|
||||
'relation' => 'AND',
|
||||
( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? Astra_Builder_Helper::$design_tab_config : Astra_Builder_Helper::$general_tab,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[header-main-rt-section]',
|
||||
'operator' => '!=',
|
||||
'value' => array( 'none' ),
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]',
|
||||
'operator' => '!=',
|
||||
'value' => array( '1' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
'priority' => 40,
|
||||
'title' => __( 'Menu Label', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'text',
|
||||
'partial' => array(
|
||||
'selector' => '.ast-button-wrap',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Customizer_Partials::mobile_toggle_menu',
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle Button Style
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-btn-style' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'title' => __( 'Toggle Button Style', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'priority' => 42,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[disable-primary-nav]',
|
||||
'operator' => '!=',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'choices' => array(
|
||||
'fill' => __( 'Fill', 'astra' ),
|
||||
'outline' => __( 'Outline', 'astra' ),
|
||||
'minimal' => __( 'Minimal', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle Button Color
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style-color]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-btn-style-color' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_alpha_color' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-menu-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'no-toggle',
|
||||
),
|
||||
),
|
||||
'title' => __( 'Toggle Button Color', 'astra' ),
|
||||
'section' => 'section-primary-menu',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 42,
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Border Radius
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-border-radius]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-btn-border-radius' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'section' => 'section-primary-menu',
|
||||
'title' => __( 'Border Radius', 'astra' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-btn-style]',
|
||||
'operator' => '!=',
|
||||
'value' => 'minimal',
|
||||
),
|
||||
),
|
||||
'priority' => 42,
|
||||
'suffix' => 'px',
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 100,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Toggle on click of button or link.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-toggle-target]',
|
||||
'default' => astra_get_option( 'mobile-header-toggle-target' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-select',
|
||||
'section' => 'section-primary-menu',
|
||||
'priority' => 42,
|
||||
'title' => __( 'Dropdown Target', 'astra' ),
|
||||
'suffix' => '',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'choices' => array(
|
||||
'icon' => __( 'Icon', 'astra' ),
|
||||
'link' => __( 'Link', 'astra' ),
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
// Learn More link if Astra Pro is not activated.
|
||||
if ( ! defined( 'ASTRA_EXT_VER' ) ) {
|
||||
|
||||
$config = array(
|
||||
|
||||
/**
|
||||
* Option: Learn More about Mobile Header
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-more-feature-description]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-header',
|
||||
'priority' => 999,
|
||||
'title' => '',
|
||||
'help' => '<p>' . __( 'More Options Available in Astra Pro!', 'astra' ) . '</p><a href="' . ASTRA_PRO_CUSTOMIZER_UPGRADE_URL . '" class="button button-secondary" target="_blank" rel="noopener">' . __( 'Learn More', 'astra' ) . '</a>',
|
||||
'settings' => array(),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $config );
|
||||
}
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
new Astra_Header_Layout_Configs();
|
||||
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* Bottom Footer Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Sidebar_Layout_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Astra Sidebar Layout Configurations.
|
||||
*/
|
||||
class Astra_Sidebar_Layout_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Astra Sidebar Layout Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Default Sidebar Position
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-layout]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'section' => 'section-sidebars',
|
||||
'default' => astra_get_option( 'site-sidebar-layout' ),
|
||||
'priority' => 5,
|
||||
'description' => __( 'Sidebar will only apply when container layout is set to normal.', 'astra' ),
|
||||
'title' => __( 'Default Layout', 'astra' ),
|
||||
'choices' => array(
|
||||
'no-sidebar' => array(
|
||||
'label' => __( 'No Sidebar', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'no-sidebar', false ) : '',
|
||||
),
|
||||
'left-sidebar' => array(
|
||||
'label' => __( 'Left Sidebar', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'left-sidebar', false ) : '',
|
||||
),
|
||||
'right-sidebar' => array(
|
||||
'label' => __( 'Right Sidebar', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'right-sidebar', false ) : '',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Site Sidebar Style.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-style]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-sidebars',
|
||||
'default' => astra_get_option( 'site-sidebar-style', 'unboxed' ),
|
||||
'priority' => 9,
|
||||
'title' => __( 'Sidebar Style', 'astra' ),
|
||||
'choices' => array(
|
||||
'unboxed' => __( 'Unboxed', 'astra' ),
|
||||
'boxed' => __( 'Boxed', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
'divider' => array( 'ast_class' => 'ast-top-divider ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Primary Content Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'default' => astra_get_option( 'site-sidebar-width' ),
|
||||
'section' => 'section-sidebars',
|
||||
'priority' => 15,
|
||||
'title' => __( 'Sidebar Width', 'astra' ),
|
||||
'suffix' => '%',
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'min' => 15,
|
||||
'step' => 1,
|
||||
'max' => 50,
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-sidebar-width-description]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-sidebars',
|
||||
'priority' => 15,
|
||||
'title' => '',
|
||||
'help' => __( 'Sidebar width will apply only when one of the above sidebar is set.', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'settings' => array(),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Sticky Sidebar
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-sticky-sidebar]',
|
||||
'default' => astra_get_option( 'site-sticky-sidebar' ),
|
||||
'type' => 'control',
|
||||
'section' => 'section-sidebars',
|
||||
'title' => __( 'Enable Sticky Sidebar', 'astra' ),
|
||||
'priority' => 15,
|
||||
'control' => 'ast-toggle-control',
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
|
||||
// Learn More link if Astra Pro is not activated.
|
||||
if ( astra_showcase_upgrade_notices() ) {
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-sidebar-pro-items]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-upgrade',
|
||||
'campaign' => 'sidebar',
|
||||
'renderAs' => 'list',
|
||||
'choices' => array(
|
||||
'one' => array(
|
||||
'title' => __( 'Sidebar spacing', 'astra' ),
|
||||
),
|
||||
'two' => array(
|
||||
'title' => __( 'Sidebar color options', 'astra' ),
|
||||
),
|
||||
'three' => array(
|
||||
'title' => __( 'Widget color options', 'astra' ),
|
||||
),
|
||||
'four' => array(
|
||||
'title' => __( 'Widget title typography', 'astra' ),
|
||||
),
|
||||
'five' => array(
|
||||
'title' => __( 'Widget content typography', 'astra' ),
|
||||
),
|
||||
),
|
||||
'section' => 'section-sidebars',
|
||||
'default' => '',
|
||||
'priority' => 999,
|
||||
'title' => __( 'Make sidebars work harder to engage with Astra Pro', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
);
|
||||
}
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
new Astra_Sidebar_Layout_Configs();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
/**
|
||||
* General Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Site_Container_Layout_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Astra Site Container Layout Customizer Configurations.
|
||||
*/
|
||||
class Astra_Site_Container_Layout_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Astra Site Container Layout Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_section = 'section-colors-background';
|
||||
|
||||
if ( class_exists( 'Astra_Ext_Extension' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) && ! astra_has_gcp_typo_preset_compatibility() ) {
|
||||
$_section = 'section-colors-body';
|
||||
}
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Global Revamped Container Layouts.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-site-content-layout]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-radio-image',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_choices' ),
|
||||
'section' => 'section-container-layout',
|
||||
'default' => astra_get_option( 'ast-site-content-layout', 'normal-width-container' ),
|
||||
'priority' => 9,
|
||||
'title' => __( 'Container Layout', 'astra' ),
|
||||
'transport' => 'refresh',
|
||||
'choices' => array(
|
||||
'normal-width-container' => array(
|
||||
'label' => __( 'Normal', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'normal-width-container', false ) : '',
|
||||
),
|
||||
'narrow-width-container' => array(
|
||||
'label' => __( 'Narrow', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'narrow-width-container', false ) : '',
|
||||
),
|
||||
'full-width-container' => array(
|
||||
'label' => __( 'Full Width', 'astra' ),
|
||||
'path' => ( class_exists( 'Astra_Builder_UI_Controller' ) ) ? Astra_Builder_UI_Controller::fetch_svg_icon( 'full-width-container', false ) : '',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing ast-bottom-spacing ast-bottom-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Global Content Style.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-content-style]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-selector',
|
||||
'section' => 'section-container-layout',
|
||||
'default' => astra_get_option( 'site-content-style', 'boxed' ),
|
||||
'priority' => 9,
|
||||
'description' => __( 'Container style will apply only when layout is set to either normal or narrow.', 'astra' ),
|
||||
'title' => __( 'Container Style', 'astra' ),
|
||||
'choices' => array(
|
||||
'unboxed' => __( 'Unboxed', 'astra' ),
|
||||
'boxed' => __( 'Boxed', 'astra' ),
|
||||
),
|
||||
'responsive' => false,
|
||||
'renderAs' => 'text',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Theme color heading
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[surface-colors-title]',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Surface Color', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-group-title',
|
||||
'priority' => 25,
|
||||
'responsive' => true,
|
||||
'settings' => array(),
|
||||
'input_attrs' => array(
|
||||
'reset_linked_controls' => array(
|
||||
'site-layout-outside-bg-obj-responsive',
|
||||
'content-bg-obj-responsive',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Body Background
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-layout-outside-bg-obj-responsive]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'default' => astra_get_option( 'site-layout-outside-bg-obj-responsive' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 25,
|
||||
'input_attrs' => array(
|
||||
'ignore_responsive_btns' => true,
|
||||
),
|
||||
'title' => __( 'Site Background', 'astra' ),
|
||||
),
|
||||
);
|
||||
|
||||
$section_content_bg_obj = ( class_exists( 'Astra_Ext_Extension' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ) ? 'section-colors-body' : 'section-colors-background';
|
||||
|
||||
if ( astra_has_gcp_typo_preset_compatibility() ) {
|
||||
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[content-bg-obj-responsive]',
|
||||
'default' => astra_get_option( 'content-bg-obj-responsive' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-background',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Content Background', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'input_attrs' => array(
|
||||
'ignore_responsive_btns' => true,
|
||||
),
|
||||
'priority' => 25,
|
||||
'divider' => defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'colors-and-background' ) ? array( 'ast_class' => 'ast-bottom-section-divider' ) : array(),
|
||||
);
|
||||
}
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
// Learn More link if Astra Pro is not activated.
|
||||
if ( astra_showcase_upgrade_notices() ) {
|
||||
$config = array(
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-site-layout-button-link]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-upgrade',
|
||||
'campaign' => 'global',
|
||||
'renderAs' => 'list',
|
||||
'choices' => array(
|
||||
'one' => array(
|
||||
'title' => __( 'Full Width layout', 'astra' ),
|
||||
),
|
||||
'two' => array(
|
||||
'title' => __( 'Padded layout', 'astra' ),
|
||||
),
|
||||
'three' => array(
|
||||
'title' => __( 'Fluid layout', 'astra' ),
|
||||
),
|
||||
'four' => array(
|
||||
'title' => __( 'Container spacings', 'astra' ),
|
||||
),
|
||||
),
|
||||
'section' => 'section-container-layout',
|
||||
'default' => '',
|
||||
'priority' => 999,
|
||||
'title' => __( 'Use containers to their maximum potential with Astra Pro', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
);
|
||||
|
||||
$configurations = array_merge( $configurations, $config );
|
||||
}
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Site_Container_Layout_Configs();
|
||||
@@ -0,0 +1,655 @@
|
||||
<?php
|
||||
/**
|
||||
* Bottom Footer Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Site_Identity_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Astra Customizerr Site identity Customizer Configurations.
|
||||
*/
|
||||
class Astra_Site_Identity_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Astra Customizerr Site identity Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_section = 'title_tagline';
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Notice for Colors - Transparent header enabled on page.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-logo]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => $_section,
|
||||
'priority' => 1,
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'active_callback' => array( $this, 'is_transparent_header_enabled' ),
|
||||
'help' => $this->get_help_text_notice( 'transparent-header' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Transparent Header Section - Link.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-logo-link]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => $_section,
|
||||
'priority' => 1,
|
||||
'link_type' => 'control',
|
||||
'linked' => ASTRA_THEME_SETTINGS . '[transparent-header-logo]',
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[different-transparent-logo]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
),
|
||||
'link_text' => '<u>' . __( 'Customize Transparent Header.', 'astra' ) . '</u>',
|
||||
'active_callback' => array( $this, 'is_transparent_header_enabled' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Different retina logo
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[different-retina-logo]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => $_section,
|
||||
'title' => __( 'Different Logo For Retina Devices?', 'astra' ),
|
||||
'default' => astra_get_option( 'different-retina-logo' ),
|
||||
'priority' => 5,
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'partial' => array(
|
||||
'selector' => '.site-branding',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Builder_Header::site_identity',
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Retina logo selector
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-header-retina-logo]',
|
||||
'default' => astra_get_option( 'ast-header-retina-logo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'image',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'section' => 'title_tagline',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[different-retina-logo]',
|
||||
'operator' => '!=',
|
||||
'value' => 0,
|
||||
),
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
'priority' => 5.5,
|
||||
'title' => __( 'Retina Logo', 'astra' ),
|
||||
'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.site-branding',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Builder_Header::site_identity',
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Inherit Desktop logo
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[different-mobile-logo]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'default' => astra_get_option( 'different-mobile-logo' ),
|
||||
'section' => 'title_tagline',
|
||||
'title' => __( 'Different Logo For Mobile Devices?', 'astra' ),
|
||||
'priority' => 5.5,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => 'ast_selected_device',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'tablet', 'mobile' ),
|
||||
),
|
||||
),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.site-branding',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Builder_Header::site_identity',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Mobile header logo
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[mobile-header-logo]',
|
||||
'default' => astra_get_option( 'mobile-header-logo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'image',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'section' => 'title_tagline',
|
||||
'priority' => 6,
|
||||
'title' => __( 'Mobile Logo (optional)', 'astra' ),
|
||||
'library_filter' => array( 'gif', 'jpg', 'jpeg', 'png', 'ico' ),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[different-mobile-logo]',
|
||||
'operator' => '==',
|
||||
'value' => '1',
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => 'ast_selected_device',
|
||||
'operator' => 'in',
|
||||
'value' => array( 'tablet', 'mobile' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Use Logo SVG Icon.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[use-logo-svg-icon]',
|
||||
'default' => astra_get_option( 'use-logo-svg-icon' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Use Logo SVG Icon', 'astra' ),
|
||||
'priority' => 6,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.site-branding',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => 'Astra_Builder_UI_Controller::render_site_identity',
|
||||
'fallback_refresh' => false,
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Logo SVG Icon
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[logo-svg-icon]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-logo-svg-icon',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_logo_svg_icon' ),
|
||||
'section' => $_section,
|
||||
'default' => astra_get_option( 'logo-svg-icon' ),
|
||||
'description' => __( 'When using Custom SVG code, do not include few attributes such as "width", "height", and "fill" in your custom svg code to utilize existing customizer controls.', 'astra' ),
|
||||
'priority' => 6,
|
||||
'title' => __( 'Logo SVG Icon', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.site-branding',
|
||||
'container_inclusive' => true,
|
||||
'render_callback' => 'Astra_Builder_UI_Controller::render_site_identity',
|
||||
'fallback_refresh' => false,
|
||||
),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[use-logo-svg-icon]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Logo SVG Gap
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[logo-svg-site-title-gap]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'logo-svg-site-title-gap' ),
|
||||
'priority' => 7,
|
||||
'title' => __( 'Logo SVG Gap', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[use-logo-svg-icon]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Logo Width
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-header-responsive-logo-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'ast-header-responsive-logo-width' ),
|
||||
'priority' => 7,
|
||||
'title' => __( 'Logo Width', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 600,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[display-site-title-responsive]',
|
||||
'default' => astra_get_option( 'display-site-title-responsive' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-multi-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 8,
|
||||
'title' => __( 'Site Title Visibility', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'desktop' => 'customizer-desktop',
|
||||
'tablet' => 'customizer-tablet',
|
||||
'mobile' => 'customizer-mobile',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider ast-bottom-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Display Tagline
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[display-site-tagline-responsive]',
|
||||
'default' => astra_get_option( 'display-site-tagline-responsive' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-multi-selector',
|
||||
'section' => $_section,
|
||||
'priority' => 12,
|
||||
'title' => __( 'Site Tagline Visibility', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$general_tab,
|
||||
'transport' => 'postMessage',
|
||||
'choices' => array(
|
||||
'desktop' => 'customizer-desktop',
|
||||
'tablet' => 'customizer-tablet',
|
||||
'mobile' => 'customizer-mobile',
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Logo inline title.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[logo-title-inline]',
|
||||
'default' => astra_get_option( 'logo-title-inline' ),
|
||||
'type' => 'control',
|
||||
'context' => array( Astra_Builder_Helper::$general_tab_config ),
|
||||
'control' => 'ast-toggle-control',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
'section' => $_section,
|
||||
'title' => __( 'Inline Logo & Site Title', 'astra' ),
|
||||
'priority' => 8,
|
||||
'transport' => 'postMessage',
|
||||
'partial' => array(
|
||||
'selector' => '.site-branding',
|
||||
'container_inclusive' => false,
|
||||
'render_callback' => 'Astra_Builder_Header::site_identity',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge(
|
||||
$_configs,
|
||||
array(
|
||||
// Color Group control for site title colors.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]',
|
||||
'default' => astra_get_option( 'site-identity-title-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => Astra_Builder_Helper::$is_header_footer_builder_active ? __( 'Title Color', 'astra' ) : __( 'Colors', 'astra' ),
|
||||
'section' => $_section,
|
||||
'responsive' => false,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 8,
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '',
|
||||
),
|
||||
|
||||
// Option: Site Title Color.
|
||||
array(
|
||||
'name' => 'header-color-site-title',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]',
|
||||
'section' => 'title_tagline',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 5,
|
||||
'default' => astra_get_option( 'header-color-site-title' ),
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Color Group control for Logo SVG Icon Colors.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[logo-svg-icon-color-group]',
|
||||
'default' => astra_get_option( 'logo-svg-icon-color-group' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color-group',
|
||||
'title' => __( 'Logo SVG Icon Color', 'astra' ),
|
||||
'section' => $_section,
|
||||
'responsive' => false,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 8,
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[use-logo-svg-icon]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Logo SVG Icon Color.
|
||||
array(
|
||||
'name' => 'logo-svg-icon-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[logo-svg-icon-color-group]',
|
||||
'section' => 'title_tagline',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 5,
|
||||
'default' => astra_get_option( 'logo-svg-icon-color' ),
|
||||
'title' => __( 'Normal', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[use-logo-svg-icon]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Logo SVG Icon Hover Color.
|
||||
array(
|
||||
'name' => 'logo-svg-icon-hover-color',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[logo-svg-icon-color-group]',
|
||||
'section' => 'title_tagline',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 10,
|
||||
'default' => astra_get_option( 'logo-svg-icon-hover-color' ),
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => 'custom_logo',
|
||||
'operator' => '==',
|
||||
'value' => false,
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[use-logo-svg-icon]',
|
||||
'operator' => '==',
|
||||
'value' => true,
|
||||
),
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
),
|
||||
),
|
||||
|
||||
// Option: Site Title Hover Color.
|
||||
array(
|
||||
'name' => 'header-color-h-site-title',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[site-identity-title-color-group]',
|
||||
'section' => 'title_tagline',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-color',
|
||||
'priority' => 10,
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-color-h-site-title' ),
|
||||
'title' => __( 'Hover', 'astra' ),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
),
|
||||
|
||||
// Option: Site Tagline Color.
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[header-color-site-tagline]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-color',
|
||||
'transport' => 'postMessage',
|
||||
'default' => astra_get_option( 'header-color-site-tagline' ),
|
||||
'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Tagline', 'astra' ) : __( 'Color', 'astra' ),
|
||||
'section' => 'title_tagline',
|
||||
'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 8 : 12,
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '',
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-section-divider' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {
|
||||
|
||||
$_configs = array_merge(
|
||||
$_configs,
|
||||
array(
|
||||
/**
|
||||
* Notice - Transparent meta header enabled on page.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-meta-enabled]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-description',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'priority' => 1,
|
||||
'active_callback' => array( $this, 'is_transparent_header_enabled' ),
|
||||
'help' => $this->get_help_text_notice( 'transparent-meta' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Notice Link - Transparent meta header enabled on page.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-callback-notice-header-transparent-header-meta-link]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => 'section-header-builder-layout',
|
||||
'priority' => 1,
|
||||
'link_type' => 'section',
|
||||
'linked' => 'section-transparent-header',
|
||||
'link_text' => '<u>' . __( 'Customize Transparent Header.', 'astra' ) . '</u>',
|
||||
'active_callback' => array( $this, 'is_transparent_header_enabled' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Link to the site icon.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-icon-link]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-customizer-link',
|
||||
'section' => 'title_tagline',
|
||||
'priority' => 340,
|
||||
'link_type' => 'control',
|
||||
'is_button_link' => true,
|
||||
'linked' => 'site_icon',
|
||||
'link_text' => __( 'Site Icon', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-divider' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'typography' ) ) {
|
||||
|
||||
$new_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Header Site Title.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-title-typography]',
|
||||
'default' => astra_get_option( 'site-title-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Title Font', 'astra' ) : __( 'Typography', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 16 : 8,
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '',
|
||||
),
|
||||
|
||||
/**
|
||||
* Options: Site Tagline.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-tagline-typography]',
|
||||
'default' => astra_get_option( 'site-tagline-typography' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? __( 'Tagline Font', 'astra' ) : __( 'Typography', 'astra' ),
|
||||
'section' => $_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? 20 : 11,
|
||||
'context' => ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) ? array( Astra_Builder_Helper::$design_tab_config ) : '',
|
||||
),
|
||||
);
|
||||
|
||||
$_configs = array_merge( $_configs, $new_configs );
|
||||
}
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
return $configurations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if transparent header is enabled on the page being previewed.
|
||||
*
|
||||
* @since 2.4.5
|
||||
* @return boolean True - If Transparent Header is enabled, False if not.
|
||||
*/
|
||||
public function is_transparent_header_enabled() {
|
||||
$status = Astra_Ext_Transparent_Header_Markup::is_transparent_header();
|
||||
return ( true === $status ? true : false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Help notice message to be displayed when the page that is being previewed has Logo set from Transparent Header.
|
||||
*
|
||||
* @since 2.4.5
|
||||
* @param String $context Type of notice message to be returned.
|
||||
* @return String HTML Markup for the help notice.
|
||||
*/
|
||||
private function get_help_text_notice( $context ) {
|
||||
|
||||
switch ( $context ) {
|
||||
case 'transparent-header':
|
||||
$notice = '<div class="ast-customizer-notice wp-ui-highlight"><p>' . __( 'The Logo on this page is set from the Transparent Header Section. Please click the link below to customize Transparent Header Logo.', 'astra' ) . '</p></div>';
|
||||
break;
|
||||
case 'transparent-meta':
|
||||
$notice = '<div class="ast-customizer-notice wp-ui-highlight"><p>' . __( 'The header on this page is set from the Transparent Header.', 'astra' ) . '</p> <p> ' . __( 'Please click the link below to customize Transparent Header', 'astra' ) . ' </p></div>';
|
||||
break;
|
||||
default:
|
||||
$notice = '';
|
||||
}
|
||||
return $notice;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
new Astra_Site_Identity_Configs();
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* Site Layout Option for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Site_Layout_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Register Site Layout Customizer Configurations.
|
||||
*/
|
||||
class Astra_Site_Layout_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Site Layout Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[site-content-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'default' => astra_get_option( 'site-content-width' ),
|
||||
'section' => 'section-container-layout',
|
||||
'priority' => 10,
|
||||
'title' => __( 'Container Width', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
'context' => ( defined( 'ASTRA_EXT_VER' ) && Astra_Ext_Extension::is_active( 'site-layouts' ) ) ? array(
|
||||
Astra_Builder_Helper::$general_tab_config,
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[site-layout]',
|
||||
'operator' => '==',
|
||||
'value' => 'ast-full-width-layout',
|
||||
),
|
||||
) : array(),
|
||||
'suffix' => 'px',
|
||||
'input_attrs' => array(
|
||||
'min' => 768,
|
||||
'step' => 1,
|
||||
'max' => 1920,
|
||||
),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[narrow-container-max-width]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'default' => astra_get_option( 'narrow-container-max-width' ),
|
||||
'section' => 'section-container-layout',
|
||||
'priority' => 10,
|
||||
'title' => __( 'Narrow Container Width', 'astra' ),
|
||||
'suffix' => 'px',
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-spacing' ),
|
||||
'input_attrs' => array(
|
||||
'min' => 400,
|
||||
'step' => 1,
|
||||
'max' => 1000,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
new Astra_Site_Layout_Configs();
|
||||
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.15
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Archive_Typo_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class Astra_Archive_Typo_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Archive Typography Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array();
|
||||
|
||||
// Learn More link if Astra Pro is not activated.
|
||||
if ( astra_showcase_upgrade_notices() ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Astra Pro items for blog pro.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-blog-pro-items]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-upgrade',
|
||||
'campaign' => 'blog-archive',
|
||||
'renderAs' => 'list',
|
||||
'choices' => array(
|
||||
'one' => array(
|
||||
'title' => __( 'Posts Filter', 'astra' ),
|
||||
),
|
||||
'eleven' => array(
|
||||
'title' => __( 'Posts Reveal Effect', 'astra' ),
|
||||
),
|
||||
'two' => array(
|
||||
'title' => __( 'Grid, Masonry layout', 'astra' ),
|
||||
),
|
||||
'twelve' => array(
|
||||
'title' => __( 'Extended Meta Style Options', 'astra' ),
|
||||
),
|
||||
'three' => array(
|
||||
'title' => __( 'Custom featured images size', 'astra' ),
|
||||
),
|
||||
'four' => array(
|
||||
'title' => __( 'Archive pagination options', 'astra' ),
|
||||
),
|
||||
'six' => array(
|
||||
'title' => __( 'Extended typography options', 'astra' ),
|
||||
),
|
||||
'seven' => array(
|
||||
'title' => __( 'Extended spacing options', 'astra' ),
|
||||
),
|
||||
'eight' => array(
|
||||
'title' => __( 'Archive read time', 'astra' ),
|
||||
),
|
||||
'nine' => array(
|
||||
'title' => __( 'Archive excerpt options', 'astra' ),
|
||||
),
|
||||
),
|
||||
'section' => 'section-blog',
|
||||
'default' => '',
|
||||
'priority' => 999,
|
||||
'context' => array(),
|
||||
'title' => __( 'Take your blog to the next level with powerful design features.', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! defined( 'ASTRA_EXT_VER' ) || ( defined( 'ASTRA_EXT_VER' ) && ! Astra_Ext_Extension::is_active( 'typography' ) ) ) {
|
||||
$new_configs = array(
|
||||
/**
|
||||
* Option: Blog - Post Title Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[font-size-page-title]',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => 'section-blog',
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Post Title Size', 'astra' ),
|
||||
'priority' => 140,
|
||||
'default' => astra_get_option( 'font-size-page-title' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[font-size-post-meta]',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => 'section-blog',
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Meta Font Size', 'astra' ),
|
||||
'priority' => 140,
|
||||
'default' => astra_get_option( 'font-size-post-meta' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'context' => Astra_Builder_Helper::$design_tab,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[font-size-post-tax]',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => 'section-blog',
|
||||
'type' => 'control',
|
||||
'transport' => 'postMessage',
|
||||
'title' => __( 'Taxonomy Font', 'astra' ),
|
||||
'priority' => 140,
|
||||
'default' => astra_get_option( 'font-size-post-tax' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'context' => array(
|
||||
Astra_Builder_Helper::$design_tab_config,
|
||||
array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'operator' => 'contains',
|
||||
'value' => 'category',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-post-structure]',
|
||||
'operator' => 'contains',
|
||||
'value' => 'tag',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-meta]',
|
||||
'operator' => 'contains',
|
||||
'value' => 'category',
|
||||
),
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[blog-meta]',
|
||||
'operator' => 'contains',
|
||||
'value' => 'tag',
|
||||
),
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
);
|
||||
$_configs = array_merge( $_configs, $new_configs );
|
||||
}
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Archive_Typo_Configs();
|
||||
@@ -0,0 +1,413 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.15
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Body_Typo_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class Astra_Body_Typo_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Body Typography Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$typo_section = astra_has_gcp_typo_preset_compatibility() ? 'section-typography' : 'section-body-typo';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Divider.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-body-font-settings-divider]',
|
||||
'section' => $typo_section,
|
||||
'title' => __( 'Base Font', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 6,
|
||||
'settings' => array(),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Body font family.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-body-font-settings]',
|
||||
'default' => astra_get_option( 'ast-body-font-settings' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Body Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 6,
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'body-font-family',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-body-font-settings]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'ast_inherit' => __( 'Default System Font', 'astra' ),
|
||||
'default' => astra_get_option( 'body-font-family' ),
|
||||
'section' => $typo_section,
|
||||
'priority' => 6,
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[body-font-weight]',
|
||||
'variant' => ASTRA_THEME_SETTINGS . '[body-font-variant]',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Variant
|
||||
*/
|
||||
array(
|
||||
'name' => 'body-font-variant',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-body-font-settings]',
|
||||
'control' => 'ast-font-variant',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_variant' ),
|
||||
'default' => astra_get_option( 'body-font-variant' ),
|
||||
'ast_inherit' => __( 'Default', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'priority' => 15,
|
||||
'title' => '',
|
||||
'variant' => ASTRA_THEME_SETTINGS . '[body-font-family]',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[body-font-family]',
|
||||
'operator' => '!=',
|
||||
'value' => 'inherit',
|
||||
),
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'body-font-weight',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-body-font-settings]',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'body-font-weight' ),
|
||||
'ast_inherit' => __( 'Default', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'priority' => 14,
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'connect' => 'body-font-family',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Body Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-size-body',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-body-font-settings]',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'section' => $typo_section,
|
||||
'default' => astra_get_option( 'font-size-body' ),
|
||||
'priority' => 15,
|
||||
'lazy' => true,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Body Font Height
|
||||
*/
|
||||
array(
|
||||
'name' => 'body-font-extras',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-body-font-settings]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => $typo_section,
|
||||
'priority' => 25,
|
||||
'default' => astra_get_option( 'body-font-extras' ),
|
||||
'title' => __( 'Font Extras', 'astra' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Headings font family.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-headings-font-settings]',
|
||||
'default' => astra_get_option( 'ast-headings-font-settings' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'Headings Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 10,
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider ast-bottom-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Divider.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-headings-font-settings-divider]',
|
||||
'section' => $typo_section,
|
||||
'title' => __( 'Heading Font', 'astra' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-heading',
|
||||
'priority' => 10,
|
||||
'settings' => array(),
|
||||
'divider' => array( 'ast_class' => 'ast-bottom-spacing' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Headings Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'headings-font-family',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-headings-font-settings]',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'default' => astra_get_option( 'headings-font-family' ),
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'priority' => 26,
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[headings-font-weight]',
|
||||
'variant' => ASTRA_THEME_SETTINGS . '[headings-font-variant]',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Headings Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'headings-font-weight',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-headings-font-settings]',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'headings-font-weight' ),
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'priority' => 26,
|
||||
'connect' => 'headings-font-family',
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Font Variant
|
||||
*/
|
||||
array(
|
||||
'name' => 'headings-font-variant',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-headings-font-settings]',
|
||||
'control' => 'ast-font-variant',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_variant' ),
|
||||
'default' => astra_get_option( 'headings-font-variant' ),
|
||||
'ast_inherit' => __( 'Default', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'priority' => 26,
|
||||
'variant' => ASTRA_THEME_SETTINGS . '[headings-font-family]',
|
||||
'context' => array(
|
||||
array(
|
||||
'setting' => ASTRA_THEME_SETTINGS . '[headings-font-family]',
|
||||
'operator' => '!=',
|
||||
'value' => 'inherit',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading Font Height
|
||||
*/
|
||||
array(
|
||||
'name' => 'headings-font-extras',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-headings-font-settings]',
|
||||
'control' => 'ast-font-extras',
|
||||
'transport' => 'postMessage',
|
||||
'section' => $typo_section,
|
||||
'priority' => 26,
|
||||
'default' => astra_get_option( 'headings-font-height-settings' ),
|
||||
'title' => __( 'Font Extras', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-sub-top-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Paragraph Margin Bottom
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[para-margin-bottom]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-slider',
|
||||
'default' => astra_get_option( 'para-margin-bottom' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_number_n_blank' ),
|
||||
'transport' => 'postMessage',
|
||||
'section' => $typo_section,
|
||||
'priority' => 31,
|
||||
'title' => __( 'Paragraph Margin Bottom', 'astra' ),
|
||||
'suffix' => 'em',
|
||||
'lazy' => true,
|
||||
'input_attrs' => array(
|
||||
'min' => 0.5,
|
||||
'step' => 0.01,
|
||||
'max' => 5,
|
||||
),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Underline links in entry-content.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[underline-content-links]',
|
||||
'default' => astra_get_option( 'underline-content-links' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-toggle-control',
|
||||
'section' => $typo_section,
|
||||
'priority' => 32,
|
||||
'divider' => array( 'ast_class' => 'ast-top-dotted-divider' ),
|
||||
'title' => __( 'Underline Content Links', 'astra' ),
|
||||
'transport' => 'postMessage',
|
||||
),
|
||||
);
|
||||
|
||||
if ( astra_has_gcp_typo_preset_compatibility() ) {
|
||||
|
||||
/**
|
||||
* Option: H1 Typography Section.
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-heading-h1-typo]',
|
||||
'default' => astra_get_option( 'ast-heading-h1-typo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'H1 Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 30,
|
||||
);
|
||||
|
||||
/**
|
||||
* Option: H2 Typography Section.
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-heading-h2-typo]',
|
||||
'default' => astra_get_option( 'ast-heading-h2-typo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'H2 Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 30,
|
||||
);
|
||||
|
||||
/**
|
||||
* Option: H3 Typography Section.
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-heading-h3-typo]',
|
||||
'default' => astra_get_option( 'ast-heading-h3-typo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'H3 Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 30,
|
||||
);
|
||||
|
||||
/**
|
||||
* Option: H4 Typography Section.
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-heading-h4-typo]',
|
||||
'default' => astra_get_option( 'ast-heading-h4-typo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'H4 Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 30,
|
||||
);
|
||||
|
||||
/**
|
||||
* Option: H5 Typography Section.
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-heading-h5-typo]',
|
||||
'default' => astra_get_option( 'ast-heading-h5-typo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'H5 Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 30,
|
||||
);
|
||||
|
||||
/**
|
||||
* Option: H6 Typography Section.
|
||||
*/
|
||||
$_configs[] = array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-heading-h6-typo]',
|
||||
'default' => astra_get_option( 'ast-heading-h6-typo' ),
|
||||
'type' => 'control',
|
||||
'control' => 'ast-settings-group',
|
||||
'title' => __( 'H6 Font', 'astra' ),
|
||||
'section' => $typo_section,
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 30,
|
||||
);
|
||||
}
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Body_Typo_Configs();
|
||||
@@ -0,0 +1,487 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 3.7.0
|
||||
*/
|
||||
|
||||
/** @psalm-suppress ParadoxicalCondition **/ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class Astra_Global_Typo_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Body Typography Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'astra-typography-presets',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-typography-presets',
|
||||
'default' => astra_get_typography_presets(),
|
||||
'options' => array(
|
||||
'typo-preset-01' => array(
|
||||
'body-font-family' => "'Open Sans', sans-serif",
|
||||
'body-font-variant' => '400',
|
||||
'body-font-weight' => '400',
|
||||
'font-size-body' => array(
|
||||
'desktop' => 16,
|
||||
'tablet' => 16,
|
||||
'mobile' => 16,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h1' => array(
|
||||
'desktop' => 54,
|
||||
'tablet' => 45,
|
||||
'mobile' => 32,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h2' => array(
|
||||
'desktop' => 42,
|
||||
'tablet' => 32,
|
||||
'mobile' => 28,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h3' => array(
|
||||
'desktop' => 36,
|
||||
'tablet' => 26,
|
||||
'mobile' => 22,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h4' => array(
|
||||
'desktop' => 25,
|
||||
'tablet' => 22,
|
||||
'mobile' => 20,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h5' => array(
|
||||
'desktop' => 20,
|
||||
'tablet' => 18,
|
||||
'mobile' => 20,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h6' => array(
|
||||
'desktop' => 15,
|
||||
'tablet' => 15,
|
||||
'mobile' => 15,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'body-line-height' => 1.7,
|
||||
'headings-font-family' => "'Playfair Display', serif",
|
||||
'headings-font-weight' => '700',
|
||||
'headings-line-height' => '',
|
||||
'headings-font-variant' => '700',
|
||||
'line-height-h1' => 1.2,
|
||||
'line-height-h2' => 1.2,
|
||||
'line-height-h3' => 1.2,
|
||||
'line-height-h4' => 1.2,
|
||||
'line-height-h5' => 1.2,
|
||||
'line-height-h6' => 1.2,
|
||||
),
|
||||
'typo-preset-02' => array(
|
||||
'body-font-family' => "'Lora', serif",
|
||||
'body-font-variant' => '400',
|
||||
'body-font-weight' => '400',
|
||||
'font-size-body' => array(
|
||||
'desktop' => 16,
|
||||
'tablet' => 16,
|
||||
'mobile' => 16,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h1' => array(
|
||||
'desktop' => 54,
|
||||
'tablet' => 45,
|
||||
'mobile' => 32,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h2' => array(
|
||||
'desktop' => 42,
|
||||
'tablet' => 32,
|
||||
'mobile' => 28,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h3' => array(
|
||||
'desktop' => 32,
|
||||
'tablet' => 28,
|
||||
'mobile' => 22,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h4' => array(
|
||||
'desktop' => 24,
|
||||
'tablet' => 22,
|
||||
'mobile' => 20,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h5' => array(
|
||||
'desktop' => 20,
|
||||
'tablet' => 18,
|
||||
'mobile' => 17,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h6' => array(
|
||||
'desktop' => 15,
|
||||
'tablet' => 15,
|
||||
'mobile' => 15,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'body-line-height' => '',
|
||||
'headings-font-family' => "'Lato', sans-serif",
|
||||
'headings-font-weight' => '700',
|
||||
'headings-line-height' => '',
|
||||
'headings-font-variant' => '700',
|
||||
'line-height-h1' => 1.2,
|
||||
'line-height-h2' => 1.2,
|
||||
'line-height-h3' => 1.2,
|
||||
'line-height-h4' => 1.2,
|
||||
'line-height-h5' => 1.2,
|
||||
'line-height-h6' => 1.2,
|
||||
),
|
||||
'typo-preset-03' => array(
|
||||
'body-font-family' => "'Roboto', sans-serif",
|
||||
'body-font-variant' => '400',
|
||||
'body-font-weight' => '400',
|
||||
'font-size-body' => array(
|
||||
'desktop' => 17,
|
||||
'tablet' => 17,
|
||||
'mobile' => 17,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h1' => array(
|
||||
'desktop' => 48,
|
||||
'tablet' => 40,
|
||||
'mobile' => 32,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h2' => array(
|
||||
'desktop' => 38,
|
||||
'tablet' => 32,
|
||||
'mobile' => 25,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h3' => array(
|
||||
'desktop' => 30,
|
||||
'tablet' => 26,
|
||||
'mobile' => 22,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h4' => array(
|
||||
'desktop' => 24,
|
||||
'tablet' => 20,
|
||||
'mobile' => 18,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h5' => array(
|
||||
'desktop' => 20,
|
||||
'tablet' => 17,
|
||||
'mobile' => 15,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h6' => array(
|
||||
'desktop' => 17,
|
||||
'tablet' => 15,
|
||||
'mobile' => 13,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'body-line-height' => '',
|
||||
'headings-font-family' => "'Barlow Semi Condensed', sans-serif",
|
||||
'headings-font-weight' => '600',
|
||||
'headings-line-height' => '',
|
||||
'headings-font-variant' => '600',
|
||||
'line-height-h1' => 1.2,
|
||||
'line-height-h2' => 1.2,
|
||||
'line-height-h3' => 1.4,
|
||||
'line-height-h4' => 1.2,
|
||||
'line-height-h5' => 1.2,
|
||||
'line-height-h6' => 1.2,
|
||||
),
|
||||
'typo-preset-04' => array(
|
||||
'body-font-family' => "'Source Sans Pro', sans-serif",
|
||||
'body-font-variant' => '400',
|
||||
'body-font-weight' => '400',
|
||||
'font-size-body' => array(
|
||||
'desktop' => 17,
|
||||
'tablet' => 17,
|
||||
'mobile' => 17,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h1' => array(
|
||||
'desktop' => 48,
|
||||
'tablet' => 36,
|
||||
'mobile' => 32,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h2' => array(
|
||||
'desktop' => 40,
|
||||
'tablet' => 30,
|
||||
'mobile' => 26,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h3' => array(
|
||||
'desktop' => 32,
|
||||
'tablet' => 25,
|
||||
'mobile' => 22,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h4' => array(
|
||||
'desktop' => 24,
|
||||
'tablet' => 20,
|
||||
'mobile' => 18,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h5' => array(
|
||||
'desktop' => 20,
|
||||
'tablet' => 17,
|
||||
'mobile' => 15,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h6' => array(
|
||||
'desktop' => 17,
|
||||
'tablet' => 15,
|
||||
'mobile' => 13,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'body-line-height' => '1.7',
|
||||
'headings-font-family' => "'Montserrat', sans-serif",
|
||||
'headings-font-weight' => '700',
|
||||
'headings-line-height' => '',
|
||||
'headings-font-variant' => '700',
|
||||
'line-height-h1' => 1.3,
|
||||
'line-height-h2' => 1.3,
|
||||
'line-height-h3' => 1.3,
|
||||
'line-height-h4' => 1.3,
|
||||
'line-height-h5' => 1.3,
|
||||
'line-height-h6' => 1.3,
|
||||
),
|
||||
'typo-preset-05' => array(
|
||||
'body-font-family' => "'Karla', sans-serif",
|
||||
'body-font-variant' => '400',
|
||||
'body-font-weight' => '400',
|
||||
'font-size-body' => array(
|
||||
'desktop' => 17,
|
||||
'tablet' => 17,
|
||||
'mobile' => 17,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h1' => array(
|
||||
'desktop' => 48,
|
||||
'tablet' => 40,
|
||||
'mobile' => 36,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h2' => array(
|
||||
'desktop' => 38,
|
||||
'tablet' => 32,
|
||||
'mobile' => 28,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h3' => array(
|
||||
'desktop' => 30,
|
||||
'tablet' => 26,
|
||||
'mobile' => 22,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h4' => array(
|
||||
'desktop' => 24,
|
||||
'tablet' => 20,
|
||||
'mobile' => 18,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h5' => array(
|
||||
'desktop' => 21,
|
||||
'tablet' => 17,
|
||||
'mobile' => 15,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h6' => array(
|
||||
'desktop' => 17,
|
||||
'tablet' => 15,
|
||||
'mobile' => 14,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'body-line-height' => '',
|
||||
'headings-font-family' => "'Rubik', sans-serif",
|
||||
'headings-font-weight' => '500',
|
||||
'headings-line-height' => '',
|
||||
'headings-font-variant' => '500',
|
||||
'line-height-h1' => 1.3,
|
||||
'line-height-h2' => 1.3,
|
||||
'line-height-h3' => 1.3,
|
||||
'line-height-h4' => 1.3,
|
||||
'line-height-h5' => 1.3,
|
||||
'line-height-h6' => 1.3,
|
||||
),
|
||||
'typo-preset-06' => array(
|
||||
'body-font-family' => "'Work Sans', sans-serif",
|
||||
'body-font-variant' => '400',
|
||||
'body-font-weight' => '400',
|
||||
'font-size-body' => array(
|
||||
'desktop' => 16,
|
||||
'tablet' => 16,
|
||||
'mobile' => 16,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h1' => array(
|
||||
'desktop' => 48,
|
||||
'tablet' => 40,
|
||||
'mobile' => 36,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h2' => array(
|
||||
'desktop' => 38,
|
||||
'tablet' => 32,
|
||||
'mobile' => 28,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h3' => array(
|
||||
'desktop' => 30,
|
||||
'tablet' => 26,
|
||||
'mobile' => 22,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h4' => array(
|
||||
'desktop' => 24,
|
||||
'tablet' => 20,
|
||||
'mobile' => 18,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h5' => array(
|
||||
'desktop' => 21,
|
||||
'tablet' => 17,
|
||||
'mobile' => 15,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'font-size-h6' => array(
|
||||
'desktop' => 17,
|
||||
'tablet' => 15,
|
||||
'mobile' => 14,
|
||||
'desktop-unit' => 'px',
|
||||
'tablet-unit' => 'px',
|
||||
'mobile-unit' => 'px',
|
||||
),
|
||||
'body-line-height' => '',
|
||||
'headings-font-family' => "'DM Serif Display', serif",
|
||||
'headings-font-weight' => '400',
|
||||
'headings-line-height' => '',
|
||||
'headings-font-variant' => '400',
|
||||
'line-height-h1' => 1.2,
|
||||
'line-height-h2' => 1.2,
|
||||
'line-height-h3' => 1.2,
|
||||
'line-height-h4' => 1.2,
|
||||
'line-height-h5' => 1.2,
|
||||
'line-height-h6' => 1.2,
|
||||
),
|
||||
),
|
||||
'section' => astra_has_gcp_typo_preset_compatibility() ? 'section-typography' : 'section-body-typo',
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 5,
|
||||
'title' => __( 'Presets', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-section-spacing' ),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Global_Typo_Configs();
|
||||
@@ -0,0 +1,583 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 3.7.0
|
||||
*/
|
||||
|
||||
/** @psalm-suppress ParadoxicalCondition **/ // phpcs:ignore Generic.Commenting.DocComment.MissingShort
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer Sanitizes Initial setup
|
||||
*/
|
||||
class Astra_Headings_Typo_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register headings Typography Customizer Configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 3.7.0
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$section = 'section-typography';
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Heading Typography starts here - h1 - h3
|
||||
*/
|
||||
|
||||
/**
|
||||
* Option: Heading <H1> Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-family-h1',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h1-typo]',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'default' => astra_get_option( 'font-family-h1' ),
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h1]',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Heading <H1> Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-weight-h1',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h1-typo]',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'font-weight-h1' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => 'font-family-h1',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading 1 (H1) Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'font-size-h1',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h1-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-size-h1' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 28,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading H1 Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-h1',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h1-typo]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'default' => astra_get_option( 'font-extras-h1' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Heading <H2> Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-family-h2',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h2-typo]',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'default' => astra_get_option( 'font-family-h2' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h2]',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H2> Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-weight-h2',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h2-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-weight-h2' ),
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'priority' => 28,
|
||||
'connect' => 'font-family-h2',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading 2 (H2) Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'font-size-h2',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h2-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-size-h2' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 28,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading H2 Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-h2',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h2-typo]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'default' => astra_get_option( 'font-extras-h2' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H3> Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-family-h3',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h3-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'default' => astra_get_option( 'font-family-h3' ),
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h3]',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H3> Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-weight-h3',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h3-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'font-weight-h3' ),
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => 'font-family-h3',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading 3 (H3) Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'font-size-h3',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h3-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-size-h3' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 28,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading H3 Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-h3',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h3-typo]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'default' => astra_get_option( 'font-extras-h3' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H4> Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-family-h4',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h4-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'default' => astra_get_option( 'font-family-h4' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h4]',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H4> Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-weight-h4',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h4-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'default' => astra_get_option( 'font-weight-h4' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => 'font-family-h4',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading 4 (H4) Font Size
|
||||
*/
|
||||
|
||||
array(
|
||||
'name' => 'font-size-h4',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h4-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-size-h4' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 28,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading H4 Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-h4',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h4-typo]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'default' => astra_get_option( 'font-extras-h4' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H5> Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-family-h5',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h5-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'default' => astra_get_option( 'font-family-h5' ),
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h5]',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H5> Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-weight-h5',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h5-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-weight-h5' ),
|
||||
'priority' => 28,
|
||||
'connect' => 'font-family-h5',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
|
||||
/**
|
||||
* Option: Heading 5 (H5) Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-size-h5',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h5-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-size-h5' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 28,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading H5 Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-h5',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h5-typo]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'default' => astra_get_option( 'font-extras-h5' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H6> Font Family
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-family-h6',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h6-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-family',
|
||||
'default' => astra_get_option( 'font-family-h6' ),
|
||||
'title' => __( 'Font Family', 'astra' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => ASTRA_THEME_SETTINGS . '[font-weight-h6]',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading <H6> Font Weight
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-weight-h6',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h6-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-font',
|
||||
'font_type' => 'ast-font-weight',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_font_weight' ),
|
||||
'default' => astra_get_option( 'font-weight-h6' ),
|
||||
'title' => __( 'Font Weight', 'astra' ),
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'connect' => 'font-family-h6',
|
||||
'transport' => 'postMessage',
|
||||
'divider' => array( 'ast_class' => 'ast-sub-bottom-dotted-divider' ),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading 6 (H6) Font Size
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-size-h6',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h6-typo]',
|
||||
'type' => 'sub-control',
|
||||
'control' => 'ast-responsive-slider',
|
||||
'sanitize_callback' => array( 'Astra_Customizer_Sanitizes', 'sanitize_responsive_slider' ),
|
||||
'section' => $section,
|
||||
'default' => astra_get_option( 'font-size-h6' ),
|
||||
'transport' => 'postMessage',
|
||||
'priority' => 28,
|
||||
'title' => __( 'Font Size', 'astra' ),
|
||||
'suffix' => array( 'px', 'em', 'vw', 'rem' ),
|
||||
'input_attrs' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'step' => 1,
|
||||
'max' => 200,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.01,
|
||||
'max' => 20,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 25,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0,
|
||||
'step' => 0.1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/**
|
||||
* Option: Heading H6 Font Extras
|
||||
*/
|
||||
array(
|
||||
'name' => 'font-extras-h6',
|
||||
'type' => 'sub-control',
|
||||
'parent' => ASTRA_THEME_SETTINGS . '[ast-heading-h6-typo]',
|
||||
'control' => 'ast-font-extras',
|
||||
'section' => $section,
|
||||
'priority' => 28,
|
||||
'default' => astra_get_option( 'font-extras-h6' ),
|
||||
),
|
||||
);
|
||||
return array_merge( $configurations, $_configs );
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Headings_Typo_Configs();
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* Styling Options for Astra Theme.
|
||||
*
|
||||
* @package Astra
|
||||
* @link https://wpastra.com/
|
||||
* @since Astra 1.0.15
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Astra_Single_Typo_Configs' ) ) {
|
||||
|
||||
/**
|
||||
* Customizer Single Typography Configurations.
|
||||
*
|
||||
* @since 1.4.3
|
||||
*/
|
||||
class Astra_Single_Typo_Configs extends Astra_Customizer_Config_Base {
|
||||
|
||||
/**
|
||||
* Register Single Typography configurations.
|
||||
*
|
||||
* @param Array $configurations Astra Customizer Configurations.
|
||||
* @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager.
|
||||
* @since 1.4.3
|
||||
* @return Array Astra Customizer Configurations with updated configurations.
|
||||
*/
|
||||
public function register_configuration( $configurations, $wp_customize ) {
|
||||
|
||||
$_configs = array();
|
||||
|
||||
// Learn More link if Astra Pro is not activated.
|
||||
if ( astra_showcase_upgrade_notices() ) {
|
||||
|
||||
$_configs = array(
|
||||
|
||||
/**
|
||||
* Option: Astra Pro blog single post's options.
|
||||
*/
|
||||
array(
|
||||
'name' => ASTRA_THEME_SETTINGS . '[ast-single-post-items]',
|
||||
'type' => 'control',
|
||||
'control' => 'ast-upgrade',
|
||||
'campaign' => 'blog-single',
|
||||
'renderAs' => 'list',
|
||||
'choices' => array(
|
||||
'one' => array(
|
||||
'title' => __( 'Author Box with Social Share', 'astra' ),
|
||||
),
|
||||
'two' => array(
|
||||
'title' => __( 'Auto load previous posts', 'astra' ),
|
||||
),
|
||||
'three' => array(
|
||||
'title' => __( 'Single post navigation control', 'astra' ),
|
||||
),
|
||||
'four' => array(
|
||||
'title' => __( 'Custom featured images size', 'astra' ),
|
||||
),
|
||||
'seven' => array(
|
||||
'title' => __( 'Single post read time', 'astra' ),
|
||||
),
|
||||
'five' => array(
|
||||
'title' => __( 'Extended typography options', 'astra' ),
|
||||
),
|
||||
'six' => array(
|
||||
'title' => __( 'Extended spacing options', 'astra' ),
|
||||
),
|
||||
'eight' => array(
|
||||
'title' => __( 'Social sharing options', 'astra' ),
|
||||
),
|
||||
),
|
||||
'section' => 'section-blog-single',
|
||||
'default' => '',
|
||||
'priority' => 999,
|
||||
'context' => array(),
|
||||
'title' => __( 'Extensive range of tools to help blog pages stand out.', 'astra' ),
|
||||
'divider' => array( 'ast_class' => 'ast-top-section-divider' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$configurations = array_merge( $configurations, $_configs );
|
||||
|
||||
return $configurations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
new Astra_Single_Typo_Configs();
|
||||
Reference in New Issue
Block a user