remove_setting( 'construction_hub_slider_arrow' );
$wp_customize->remove_control( 'construction_hub_slider_arrow' );
}
add_action( 'customize_register', 'building_constructor_remove_customize_register', 11 );
if ( ! defined( 'BUILDING_CONSTRUCTOR_TEXT' ) ) {
define( 'BUILDING_CONSTRUCTOR_TEXT', __( 'Construction Renovation Pro','building-constructor' ));
}
if ( ! defined( 'BUILDING_CONSTRUCTOR_BUY_TEXT' ) ) {
define( 'BUILDING_CONSTRUCTOR_BUY_TEXT', __( 'Upgrade Pro','building-constructor' ));
}
add_action( 'customize_register', function( $manager ) {
// Load custom sections.
load_template( trailingslashit( get_template_directory() ) . '/inc/section-pro.php' );
$manager->register_section_type( Construction_Hub_Button::class );
$manager->add_section(
new Construction_Hub_Button( $manager, 'construction_hub_pro', [
'title' => esc_html( BUILDING_CONSTRUCTOR_TEXT,'building-constructor' ),
'priority' => 0,
'button_text' => __( 'GET PREMIUM', 'building-constructor' ),
'button_url' => esc_url( CONSTRUCTION_HUB_PRO_THEME_URL )
] )
);
} );
function building_constructor_customize_register( $wp_customize ) {
// Register the custom control type.
$wp_customize->register_control_type( 'Building_Constructor_Toggle_Control' );
// Pro Version
class Building_Constructor_Customize_Pro_Version extends WP_Customize_Control {
public $type = 'pro_options';
public function render_content() {
echo 'Unlock Premium '. esc_html( $this->label ) .'? ';
echo '';
echo '';
echo ' '. esc_html( BUILDING_CONSTRUCTOR_BUY_TEXT,'building-constructor' ) .'';
echo '';
}
}
// Custom Controls
function building_constructor_sanitize_custom_control( $input ) {
return $input;
}
//Social Media
$wp_customize->add_section( 'building_constructor_social_media', array(
'title' => __( 'Social Media Links', 'building-constructor' ),
'priority' => 7,
'description' => __( 'Add your Social Links', 'building-constructor' ),
'panel' => 'construction_hub_panel_id'
) );
$wp_customize->add_setting('building_constructor_facebook_url',array(
'default'=> '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('building_constructor_facebook_url',array(
'label' => __('Facebook Link','building-constructor'),
'section'=> 'building_constructor_social_media',
'type'=> 'url'
));
$wp_customize->add_setting('building_constructor_twitter_url',array(
'default'=> '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('building_constructor_twitter_url',array(
'label' => __('Twitter Link','building-constructor'),
'section'=> 'building_constructor_social_media',
'type'=> 'url'
));
$wp_customize->add_setting('building_constructor_instagram_url',array(
'default'=> '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('building_constructor_instagram_url',array(
'label' => __('Instagram Link','building-constructor'),
'section'=> 'building_constructor_social_media',
'type'=> 'url'
));
$wp_customize->add_setting('building_constructor_youtube_url',array(
'default'=> '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('building_constructor_youtube_url',array(
'label' => __('YouTube Link','building-constructor'),
'section'=> 'building_constructor_social_media',
'type'=> 'url'
));
$wp_customize->add_setting('building_constructor_pint_url',array(
'default'=> '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control('building_constructor_pint_url',array(
'label' => __('Pinterest Link','building-constructor'),
'section'=> 'building_constructor_social_media',
'type'=> 'url'
));
$wp_customize->add_setting('building_constructor_social_icon_fontsize',array(
'default'=> '14',
'sanitize_callback' => 'building_constructor_sanitize_number_absint'
));
$wp_customize->add_control('building_constructor_social_icon_fontsize',array(
'label' => __('Social Icons Font Size in PX','building-constructor'),
'type'=> 'number',
'section'=> 'building_constructor_social_media',
'input_attrs' => array(
'step' => 1,
'min' => 0,
'max' => 30,
),
));
// Pro Version
$wp_customize->add_setting( 'building_constructor_social_media_pro_version_logo', array(
'sanitize_callback' => 'building_constructor_sanitize_custom_control'
));
$wp_customize->add_control( new Building_Constructor_Customize_Pro_Version ( $wp_customize,'building_constructor_social_media_pro_version_logo', array(
'section' => 'building_constructor_social_media',
'type' => 'pro_options',
'label' => esc_html__( 'Features ', 'building-constructor' ),
'description' => esc_url( CONSTRUCTION_HUB_PRO_THEME_URL ),
'priority' => 10,
)));
$wp_customize->add_setting( 'building_constructor_slider_show_hide', array(
'default' => true,
'transport' => 'refresh',
'sanitize_callback' => 'construction_hub_sanitize_checkbox',
) );
$wp_customize->add_control( new Building_Constructor_Toggle_Control( $wp_customize, 'building_constructor_slider_show_hide', array(
'label' => esc_html__( 'Show / Hide Slider section', 'building-constructor' ),
'priority' => 1,
'section' => 'construction_hub_slider_section',
'type' => 'toggle',
'settings' => 'building_constructor_slider_show_hide',
) ) );
//About Section
$wp_customize->add_section('building_constructor_about_section',array(
'title' => __('About Section','building-constructor'),
'panel' => 'construction_hub_panel_id',
'priority' => 9,
));
$wp_customize->add_setting( 'building_constructor_about_show_hide', array(
'default' => true,
'transport' => 'refresh',
'sanitize_callback' => 'construction_hub_sanitize_checkbox',
) );
$wp_customize->add_control( new Building_Constructor_Toggle_Control( $wp_customize, 'building_constructor_about_show_hide', array(
'label' => esc_html__( 'Show / Hide section', 'building-constructor' ),
'section' => 'building_constructor_about_section',
'type' => 'toggle',
'settings' => 'building_constructor_about_show_hide',
) ) );
$wp_customize->add_setting( 'building_constructor_about_page', array(
'default' => '',
'sanitize_callback' => 'construction_hub_sanitize_dropdown_pages'
) );
$wp_customize->add_control( 'building_constructor_about_page', array(
'label' => __( 'Select About Page', 'building-constructor' ),
'section' => 'building_constructor_about_section',
'type' => 'dropdown-pages'
) );
$wp_customize->add_setting('building_constructor_about_tittle',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('building_constructor_about_tittle',array(
'label' => __('Quote Line','building-constructor'),
'section' => 'building_constructor_about_section',
'type' => 'text'
));
$wp_customize->add_setting('building_constructor_slider_top',array(
'default'=> '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('building_constructor_slider_top',array(
'label' => esc_html__('Add Slider Top Text','building-constructor'),
'section'=> 'construction_hub_slider_section',
'type'=> 'text'
));
// Pro Version
$wp_customize->add_setting( 'building_constructor_services_pro_version_logo', array(
'sanitize_callback' => 'building_constructor_sanitize_custom_control'
));
$wp_customize->add_control( new Building_Constructor_Customize_Pro_Version ( $wp_customize,'building_constructor_services_pro_version_logo', array(
'section' => 'building_constructor_about_section',
'type' => 'pro_options',
'label' => esc_html__( 'Features ', 'building-constructor' ),
'description' => esc_url( CONSTRUCTION_HUB_PRO_THEME_URL ),
'priority' => 10,
)));
}
add_action( 'customize_register', 'building_constructor_customize_register' );