<?php
/*theme customizer*/
function magazina_customize_register( $wp_customize ) {
            $obj = New Magazina_Popup();
class Magazina_Content_Control extends WP_Customize_Control{
    public function render_content() {
        switch ( $this->type ) {
            default:

            case 'heading':
                echo '<span class="customize-control-title">' . $this->title . '</span>';
                break;

            case 'custom_message' :
                echo '<p class="description">' . $this->description . '</p>';
                break;

            case 'hr' :
                echo '<hr />';
                break;
        }
    }
}

           
//  =============================
//  = Home Page Settings  =
//  =============================
 $wp_customize->add_section('section_default_home', array(
        'title'    => __('One click Homepage Setup', 'magazina'),
        'priority' => 1,
    ));
   $wp_customize->add_setting('default_home', array(
        'sanitize_callback' => 'sanitize_text_field',
    ));
   $wp_customize->add_control( new Magazina_Content_Control( $wp_customize, 'default_home',
            array(
        'section'  => 'section_default_home',
        'type'        => 'custom_message',
        'description' => wp_kses_post( 'Click button to set theme default home page. You can modify this page from customize panel. Check this doc : <a target="_blank" href="//blogwings.com/docs/magazina/"> View Documentation</a>. <a class="activate-now button-primary button-large flactvate">Activating homepage...</a><div class="loader"></div><strong class="flactvate-activating">It may take few seconds...</strong>','oneline-lite' ).$obj->active_plugin()
    )));


//  =============================
//  = Genral Settings     =
//  =============================
$wp_customize->get_section('title_tagline')->title = esc_html__('Site Identity', 'magazina');
$wp_customize->get_section('title_tagline')->priority =2;
    //  =============================
    //  = Footer Settings      =
    //  =============================
    $wp_customize->add_section('footer_option', array(
        'title'    => __('Footer Option', 'magazina'),
        'priority' => 5,
    ));
    $wp_customize->add_setting('copyright_textbox', array(
        'default'           => '',
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('copyright_textbox', array(
        'settings'=> 'copyright_textbox',
        'label'   => esc_html__('Copyright Text', 'magazina'),
        'section' => 'footer_option',
        'type'    => 'text',
    ) );

// wordpress-default-option
$wp_customize->add_section( 'header_image', array(
  'title'          => __( 'Header Background Image', 'magazina' ),
  'theme_supports' => 'custom-header',
  'priority'       => 40,
  
) );
// custom color
 $wp_customize->get_section('colors')->title = esc_html__('Body Background Color', 'magazina');
 $wp_customize->get_section('colors')->priority = 60;
    
// custom background
$wp_customize->add_section( 'background_image', array(
  'title'          => __( 'Body Background Image', 'magazina' ),
  'theme_supports' => 'custom-background',
  'priority'       => 80,
 
) );  
}
add_action('customize_register','magazina_customize_register');