D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
themes
/
aeen
/
inc
/
customizer
/
settings
/
Filename :
case-study.php
back
Copy
<?php /** * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\aeen\Customizer\Settings; use radiustheme\aeen\Customizer\RDTheme_Customizer; use radiustheme\aeen\Customizer\Controls\Customizer_Switch_Control; use radiustheme\aeen\Customizer\Controls\Customizer_Separator_Control; use radiustheme\aeen\Customizer\Controls\Customizer_Image_Radio_Control; use WP_Customize_Media_Control; use WP_Customize_Color_Control; /** * Adds the individual sections, settings, and controls to the theme customizer */ class RDTheme_Case_Archive_Settings extends RDTheme_Customizer { public function __construct() { parent::instance(); $this->populated_default_data(); // Add Controls add_action( 'customize_register', array( $this, 'register_case_archive_controls' ) ); } /** * Case Post Controls */ public function register_case_archive_controls( $wp_customize ) { $wp_customize->add_setting( 'case_study_style', array( 'default' => $this->defaults['case_study_style'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_radio_sanitization' ) ); $wp_customize->add_control( new Customizer_Image_Radio_Control( $wp_customize, 'case_study_style', array( 'label' => __( 'Layout', 'aeen' ), 'description' => esc_html__( 'Select the case study layout for case study page', 'aeen' ), 'section' => 'case_archive_section', 'choices' => array( '1' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'assets/img/grid.png', 'name' => __( 'Grid Layout', 'aeen' ) ), '2' => array( 'image' => trailingslashit( get_template_directory_uri() ) . 'assets/img/proof.png', 'name' => __( 'Full Width Layout', 'aeen' ) ) ) ) ) ); /** * Separator */ $wp_customize->add_setting('separator_scase_page', array( 'default' => '', 'sanitize_callback' => 'esc_html', )); $wp_customize->add_control(new Customizer_Separator_Control($wp_customize, 'separator_scase_page', array( 'settings' => 'separator_scase_page', 'section' => 'case_archive_section', ))); $wp_customize->add_setting( 'scase_page_banner', array( 'default' => $this->defaults['scase_page_banner'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'scase_page_banner', array( 'label' => __( 'Banner', 'aeen' ), 'section' => 'case_archive_section', ) ) ); // Banner BG Type $wp_customize->add_setting( 'scase_page_banner_bg_type', array( 'default' => $this->defaults['scase_page_banner_bg_type'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_radio_sanitization', 'active_callback' => 'rttheme_is_scase_banner_enabled', ) ); $wp_customize->add_control( 'scase_page_banner_bg_type', array( 'label' => __( 'Banner Background Type', 'aeen' ), 'section' => 'case_archive_section', 'description' => esc_html__( 'This is banner background type.', 'aeen' ), 'type' => 'select', 'choices' => array( 'bgimg' => esc_html__( 'BG Image', 'aeen' ), 'bgcolor' => esc_html__( 'BG Color', 'aeen' ), ), 'active_callback' => 'rttheme_is_scase_banner_enabled', ) ); $wp_customize->add_setting( 'scase_page_banner_bgimg', array( 'default' => $this->defaults['scase_page_banner_bgimg'], 'transport' => 'refresh', 'sanitize_callback' => 'absint', 'active_callback' => 'rttheme_scase_banner_bgimg_type_condition', ) ); $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'scase_page_banner_bgimg', array( 'label' => __( 'Banner Background Image', 'aeen' ), 'description' => esc_html__( 'This is the description for the Media Control', 'aeen' ), 'section' => 'case_archive_section', 'mime_type' => 'image', 'button_labels' => array( 'select' => __( 'Select File', 'aeen' ), 'change' => __( 'Change File', 'aeen' ), 'default' => __( 'Default', 'aeen' ), 'remove' => __( 'Remove', 'aeen' ), 'placeholder' => __( 'No file selected', 'aeen' ), 'frame_title' => __( 'Select File', 'aeen' ), 'frame_button' => __( 'Choose File', 'aeen' ), ), 'active_callback' => 'rttheme_scase_banner_bgimg_type_condition', ) ) ); // Banner background image overlay $wp_customize->add_setting('scase_page_banner_bgimage_overlay', array( 'default' => 'rgba(0, 0, 0, 0.5)', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', 'active_callback' => 'rttheme_scase_banner_bgimg_type_condition', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'scase_page_banner_bgimage_overlay', array( 'label' => esc_html__('Banner Background Overlay Color', 'aeen'), 'settings' => 'scase_page_banner_bgimage_overlay', 'priority' => 10, 'section' => 'case_archive_section', 'active_callback' => 'rttheme_scase_banner_bgimg_type_condition', ) )); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'scase_page_banner_bgimage_overlay', array( 'label' => esc_html__('Banner Background Overlay Color', 'aeen'), 'settings' => 'scase_page_banner_bgimage_overlay', 'priority' => 10, 'section' => 'case_archive_section', 'active_callback' => 'rttheme_scase_banner_bgimg_type_condition', ) )); // Banner background color opacity $wp_customize->add_setting( 'scase_page_overlay_opacity', array( 'default' => $this->defaults['scase_page_overlay_opacity'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_sanitize_integer', 'active_callback' => 'rttheme_scase_banner_bgimg_type_condition', ) ); $wp_customize->add_control( 'scase_page_overlay_opacity', array( 'label' => __( 'Overlay Opacity', 'aeen' ), 'section' => 'case_archive_section', 'type' => 'number', 'active_callback' => 'rttheme_scase_banner_bgimg_type_condition', ) ); // Banner background color $wp_customize->add_setting('scase_page_banner_bgcolor', array( 'default' => 'rgba(19, 21, 32, 1)', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color', 'active_callback' => 'rttheme_scase_banner_bgcolor_type_condition', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'scase_page_banner_bgcolor', array( 'label' => esc_html__('Banner Background Color', 'aeen'), 'settings' => 'scase_page_banner_bgcolor', 'priority' => 10, 'section' => 'case_archive_section', 'active_callback' => 'rttheme_scase_banner_bgcolor_type_condition', ) )); /** * Separator */ $wp_customize->add_setting('separator_scase_page_breadcrumb', array( 'default' => '', 'sanitize_callback' => 'esc_html', )); $wp_customize->add_control(new Customizer_Separator_Control($wp_customize, 'separator_scase_page_breadcrumb', array( 'settings' => 'separator_scase_page_breadcrumb', 'section' => 'case_archive_section', ))); $wp_customize->add_setting( 'scase_page_breadcrumb', array( 'default' => $this->defaults['scase_page_breadcrumb'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_switch_sanitization', ) ); $wp_customize->add_control( new Customizer_Switch_Control( $wp_customize, 'scase_page_breadcrumb', array( 'label' => __( 'Breadcrumb', 'aeen' ), 'section' => 'case_archive_section', ) ) ); // Single Case Slug $wp_customize->add_setting( 'single_case_slug', array( 'default' => $this->defaults['single_case_slug'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_text_sanitization' ) ); $wp_customize->add_control( 'single_case_slug', array( 'label' => __( 'Single Case Slug', 'aeen' ), 'section' => 'case_archive_section', 'type' => 'text' ) ); // Banner padding top $wp_customize->add_setting( 'case_sin_inner_padding_top', array( 'default' => $this->defaults['case_sin_inner_padding_top'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_sanitize_integer', 'active_callback' => 'rttheme_is_single_case_banner_enabled', ) ); $wp_customize->add_control( 'case_sin_inner_padding_top', array( 'label' => __( 'Banner Padding Top', 'aeen' ), 'section' => 'case_archive_section', 'type' => 'number', 'active_callback' => 'rttheme_is_single_case_banner_enabled', ) ); // Banner padding bottom $wp_customize->add_setting( 'case_sin_inner_padding_bottom', array( 'default' => $this->defaults['case_sin_inner_padding_bottom'], 'transport' => 'refresh', 'sanitize_callback' => 'rttheme_sanitize_integer', 'active_callback' => 'rttheme_is_single_case_banner_enabled', ) ); $wp_customize->add_control( 'case_sin_inner_padding_bottom', array( 'label' => __( 'Banner Padding Top', 'aeen' ), 'section' => 'case_archive_section', 'type' => 'number', 'active_callback' => 'rttheme_is_single_case_banner_enabled', ) ); } } /** * Initialise our Customizer settings only when they're required */ if ( class_exists( 'WP_Customize_Control' ) ) { new RDTheme_Case_Archive_Settings(); }