Make WordPress Themes


Ignore:
Timestamp:
05/26/2023 11:22:59 AM (3 years ago)
Author:
themedropbox
Message:

New version of Motivational Speaker - 2.2

Location:
motivational-speaker/2.2
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • motivational-speaker/2.2/inc/customizer.php

    r190420 r192632  
    1616
    1717    // Add custom control.
    18     require get_parent_theme_file_path( 'inc/customize/customize_toggle.php' );
    19 
    20     // Register the custom control type.
    21     $wp_customize->register_control_type( 'motivational_speaker_Toggle_Control' );
     18    require get_parent_theme_file_path( 'inc/switch/control_switch.php' );
    2219
    2320    $wp_customize->add_section( 'motivational_speaker_typography_settings', array(
     
    6057        );
    6158
     59    $wp_customize->add_setting( 'motivational_speaker_section_typo_heading', array(
     60            'default'           => '',
     61            'transport'         => 'refresh',
     62            'sanitize_callback' => 'sanitize_text_field',
     63        ) );
     64        $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_typo_heading', array(
     65            'label'       => esc_html__( 'Typography Settings', 'motivational-speaker' ),
     66            'section'     => 'motivational_speaker_typography_settings',
     67            'settings'    => 'motivational_speaker_section_typo_heading',
     68        ) ) );
     69
    6270
    6371    $wp_customize->add_setting( 'motivational_speaker_headings_text', array(
     
    108116        ));
    109117
    110     $wp_customize->add_setting( 'motivational_speaker_logo_title', array(
    111         'default'           => true,
    112         'transport'         => 'refresh',
    113         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    114     ) );
    115     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_logo_title', array(
    116         'label'       => esc_html__( 'Show Site Title', 'motivational-speaker' ),
    117         'section'     => 'title_tagline',
    118         'type'        => 'toggle',
    119         'settings'    => 'motivational_speaker_logo_title',
    120     ) ) );
    121 
    122     $wp_customize->add_setting( 'motivational_speaker_logo_text', array(
    123         'default'           => false,
    124         'transport'         => 'refresh',
    125         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    126     ) );
    127     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_logo_text', array(
    128         'label'       => esc_html__( 'Show Site Tagline', 'motivational-speaker' ),
    129         'section'     => 'title_tagline',
    130         'type'        => 'toggle',
    131         'settings'    => 'motivational_speaker_logo_text',
    132     ) ) );
     118        $wp_customize->add_setting('motivational_speaker_logo_title',
     119        array(
     120            'type'                 => 'option',
     121            'capability'           => 'edit_theme_options',
     122            'theme_supports'       => '',
     123            'default'              => '1',
     124            'transport'            => 'refresh',
     125            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     126        )
     127    );
     128    $wp_customize->add_control(new Motivational_Speaker_Customizer_Customcontrol_Switch(
     129            $wp_customize,
     130            'motivational_speaker_logo_title',
     131            array(
     132                'settings'        => 'motivational_speaker_logo_title',
     133                'section'         => 'title_tagline',
     134                'label'           => __( 'Show Site Title', 'motivational-speaker' ),               
     135                'choices'         => array(
     136                    '1'      => __( 'On', 'motivational-speaker' ),
     137                    'off'    => __( 'Off', 'motivational-speaker' ),
     138                ),
     139                'active_callback' => '',
     140            )
     141        )
     142    );
     143
     144    $wp_customize->add_setting('motivational_speaker_logo_text',
     145        array(
     146            'type'                 => 'option',
     147            'capability'           => 'edit_theme_options',
     148            'theme_supports'       => '',
     149            'default'              => '1',
     150            'transport'            => 'refresh',
     151            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     152        )
     153    );
     154    $wp_customize->add_control(new Motivational_Speaker_Customizer_Customcontrol_Switch(
     155            $wp_customize,
     156            'motivational_speaker_logo_text',
     157            array(
     158                'settings'        => 'motivational_speaker_logo_text',
     159                'section'         => 'title_tagline',
     160                'label'           => __( 'Show Site Tagline', 'motivational-speaker' ),             
     161                'choices'         => array(
     162                    '1'      => __( 'On', 'motivational-speaker' ),
     163                    'off'    => __( 'Off', 'motivational-speaker' ),
     164                ),
     165                'active_callback' => '',
     166            )
     167        )
     168    );
    133169
    134170    // Theme General Settings
     
    138174    ) );
    139175
    140     $wp_customize->add_setting( 'motivational_speaker_sticky_header', array(
    141         'default'           => false,
     176    $wp_customize->add_setting(
     177        'motivational_speaker_sticky_header',
     178        array(
     179            'type'                 => 'option',
     180            'capability'           => 'edit_theme_options',
     181            'theme_supports'       => '',
     182            'default'              => '1',
     183            'transport'            => 'refresh',
     184            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     185        )
     186    );
     187    $wp_customize->add_control(
     188        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     189            $wp_customize,
     190            'motivational_speaker_sticky_header',
     191            array(
     192                'settings'        => 'motivational_speaker_sticky_header',
     193                'section'         => 'motivational_speaker_theme_settings',
     194                'label'           => __( 'Show Sticky Header', 'motivational-speaker' ),               
     195                'choices'         => array(
     196                    '1'      => __( 'On', 'motivational-speaker' ),
     197                    'off'    => __( 'Off', 'motivational-speaker' ),
     198                ),
     199                'active_callback' => '',
     200            )
     201        )
     202    );
     203
     204    $wp_customize->add_setting(
     205        'motivational_speaker_theme_loader',
     206        array(
     207            'type'                 => 'option',
     208            'capability'           => 'edit_theme_options',
     209            'theme_supports'       => '',
     210            'default'              => '',
     211            'transport'            => 'refresh',
     212            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     213        )
     214    );
     215    $wp_customize->add_control(
     216        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     217            $wp_customize,
     218            'motivational_speaker_theme_loader',
     219            array(
     220                'settings'        => 'motivational_speaker_theme_loader',
     221                'section'         => 'motivational_speaker_theme_settings',
     222                'label'           => __( 'Show Site Loader', 'motivational-speaker' ),             
     223                'choices'         => array(
     224                    '1'      => __( 'On', 'motivational-speaker' ),
     225                    'off'    => __( 'Off', 'motivational-speaker' ),
     226                ),
     227                'active_callback' => '',
     228            )
     229        )
     230    );
     231
     232    $wp_customize->add_setting('motivational_speaker_menu_text_transform',array(
     233        'default' => 'CAPITALISE',
     234        'sanitize_callback' => 'motivational_speaker_sanitize_choices'
     235    ));
     236    $wp_customize->add_control('motivational_speaker_menu_text_transform',array(
     237        'type' => 'select',
     238        'label' => __('Menus Text Transform','motivational-speaker'),
     239        'section' => 'motivational_speaker_theme_settings',
     240        'choices' => array(
     241            'CAPITALISE' => __('CAPITALISE','motivational-speaker'),
     242            'UPPERCASE' => __('UPPERCASE','motivational-speaker'),
     243            'LOWERCASE' => __('LOWERCASE','motivational-speaker'),
     244        ),
     245    ) );
     246
     247    $wp_customize->add_setting( 'motivational_speaker_section_scroll_heading', array(
     248        'default'           => '',
    142249        'transport'         => 'refresh',
    143         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    144     ) );
    145     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_sticky_header', array(
    146         'label'       => esc_html__( 'Show Sticky Header', 'motivational-speaker' ),
     250        'sanitize_callback' => 'sanitize_text_field',
     251    ) );
     252    $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_scroll_heading', array(
     253        'label'       => esc_html__( 'Scroll Top Settings', 'motivational-speaker' ),
    147254        'section'     => 'motivational_speaker_theme_settings',
    148         'type'        => 'toggle',
    149         'settings'    => 'motivational_speaker_sticky_header',
     255        'settings'    => 'motivational_speaker_section_scroll_heading',
    150256    ) ) );
    151257
    152     $wp_customize->add_setting( 'motivational_speaker_theme_loader', array(
    153         'default'           => true,
    154         'transport'         => 'refresh',
    155         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    156     ) );
    157     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_theme_loader', array(
    158         'label'       => esc_html__( 'Show Site Loader', 'motivational-speaker' ),
    159         'section'     => 'motivational_speaker_theme_settings',
    160         'type'        => 'toggle',
    161         'settings'    => 'motivational_speaker_theme_loader',
    162     ) ) );
    163 
    164     $wp_customize->add_setting( 'motivational_speaker_scroll_enable', array(
    165         'default'           => false,
    166         'transport'         => 'refresh',
    167         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    168     ) );
    169     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_scroll_enable', array(
    170         'label'       => esc_html__( 'Show Scroll Top', 'motivational-speaker' ),
    171         'section'     => 'motivational_speaker_theme_settings',
    172         'type'        => 'toggle',
    173         'settings'    => 'motivational_speaker_scroll_enable',
    174     ) ) );
     258    $wp_customize->add_setting(
     259        'motivational_speaker_scroll_enable',
     260        array(
     261            'type'                 => 'option',
     262            'capability'           => 'edit_theme_options',
     263            'theme_supports'       => '',
     264            'default'              => '1',
     265            'transport'            => 'refresh',
     266            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     267        )
     268    );
     269    $wp_customize->add_control(
     270        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     271            $wp_customize,
     272            'motivational_speaker_scroll_enable',
     273            array(
     274                'settings'        => 'motivational_speaker_scroll_enable',
     275                'section'         => 'motivational_speaker_theme_settings',
     276                'label'           => __( 'Show Scroll Top', 'motivational-speaker' ),               
     277                'choices'         => array(
     278                    '1'      => __( 'On', 'motivational-speaker' ),
     279                    'off'    => __( 'Off', 'motivational-speaker' ),
     280                ),
     281                'active_callback' => '',
     282            )
     283        )
     284    );
    175285
    176286    $wp_customize->add_setting('motivational_speaker_scroll_options',array(
     
    202312    )));
    203313
    204     $wp_customize->add_setting('motivational_speaker_menu_text_transform',array(
    205         'default' => 'CAPITALISE',
    206         'sanitize_callback' => 'motivational_speaker_sanitize_choices'
    207     ));
    208     $wp_customize->add_control('motivational_speaker_menu_text_transform',array(
    209         'type' => 'select',
    210         'label' => __('Menus Text Transform','motivational-speaker'),
    211         'section' => 'motivational_speaker_theme_settings',
    212         'choices' => array(
    213             'CAPITALISE' => __('CAPITALISE','motivational-speaker'),
    214             'UPPERCASE' => __('UPPERCASE','motivational-speaker'),
    215             'LOWERCASE' => __('LOWERCASE','motivational-speaker'),
    216         ),
    217     ) );
    218 
    219     $wp_customize->add_setting( 'motivational_speaker_shop_page_sidebar', array(
    220         'default'           => true,
     314    $wp_customize->add_setting( 'motivational_speaker_section_shoppage_heading', array(
     315        'default'           => '',
    221316        'transport'         => 'refresh',
    222         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    223     ) );
    224     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_shop_page_sidebar', array(
    225         'label'       => esc_html__( 'Show Shop Page Sidebar', 'motivational-speaker' ),
     317        'sanitize_callback' => 'sanitize_text_field',
     318    ) );
     319    $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_shoppage_heading', array(
     320        'label'       => esc_html__( 'Shop Page Settings', 'motivational-speaker' ),
    226321        'section'     => 'motivational_speaker_theme_settings',
    227         'type'        => 'toggle',
    228         'settings'    => 'motivational_speaker_shop_page_sidebar',
     322        'settings'    => 'motivational_speaker_section_shoppage_heading',
    229323    ) ) );
    230324
    231     $wp_customize->add_setting( 'motivational_speaker_wocommerce_single_page_sidebar', array(
    232         'default'           => true,
    233         'transport'         => 'refresh',
    234         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    235     ) );
    236     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_wocommerce_single_page_sidebar', array(
    237         'label'       => esc_html__( 'Show Single Product Page Sidebar', 'motivational-speaker' ),
    238         'section'     => 'motivational_speaker_theme_settings',
    239         'type'        => 'toggle',
    240         'settings'    => 'motivational_speaker_wocommerce_single_page_sidebar',
    241     ) ) );
     325    $wp_customize->add_setting(
     326        'motivational_speaker_shop_page_sidebar',
     327        array(
     328            'type'                 => 'option',
     329            'capability'           => 'edit_theme_options',
     330            'theme_supports'       => '',
     331            'default'              => '1',
     332            'transport'            => 'refresh',
     333            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     334        )
     335    );
     336    $wp_customize->add_control(
     337        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     338            $wp_customize,
     339            'motivational_speaker_shop_page_sidebar',
     340            array(
     341                'settings'        => 'motivational_speaker_shop_page_sidebar',
     342                'section'         => 'motivational_speaker_theme_settings',
     343                'label'           => __( 'Show Shop Page Sidebar', 'motivational-speaker' ),               
     344                'choices'         => array(
     345                    '1'      => __( 'On', 'motivational-speaker' ),
     346                    'off'    => __( 'Off', 'motivational-speaker' ),
     347                ),
     348                'active_callback' => '',
     349            )
     350        )
     351    );
     352
     353    $wp_customize->add_setting(
     354        'motivational_speaker_wocommerce_single_page_sidebar',
     355        array(
     356            'type'                 => 'option',
     357            'capability'           => 'edit_theme_options',
     358            'theme_supports'       => '',
     359            'default'              => '1',
     360            'transport'            => 'refresh',
     361            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     362        )
     363    );
     364    $wp_customize->add_control(
     365        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     366            $wp_customize,
     367            'motivational_speaker_wocommerce_single_page_sidebar',
     368            array(
     369                'settings'        => 'motivational_speaker_wocommerce_single_page_sidebar',
     370                'section'         => 'motivational_speaker_theme_settings',
     371                'label'           => __( 'Show Single Product Page Sidebar', 'motivational-speaker' ),             
     372                'choices'         => array(
     373                    '1'      => __( 'On', 'motivational-speaker' ),
     374                    'off'    => __( 'Off', 'motivational-speaker' ),
     375                ),
     376                'active_callback' => '',
     377            )
     378        )
     379    );
    242380
    243381    //theme width
     
    265403    $wp_customize->add_section('motivational_speaker_layout',array(
    266404        'title' => __('Post Layout', 'motivational-speaker'),
    267         'description' => __( 'Change the post layout from below options', 'motivational-speaker' ),
    268405        'priority' => 1
    269406    ) );
    270407
    271     $wp_customize->add_setting( 'motivational_speaker_post_sidebar', array(
    272         'default'           => false,
     408    $wp_customize->add_setting( 'motivational_speaker_section_post_heading', array(
     409        'default'           => '',
    273410        'transport'         => 'refresh',
    274         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    275     ) );
    276     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_post_sidebar', array(
    277         'label'       => esc_html__( 'Show Fullwidth', 'motivational-speaker' ),
     411        'sanitize_callback' => 'sanitize_text_field',
     412    ) );
     413    $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_post_heading', array(
     414        'label'       => esc_html__( 'Page Structure', 'motivational-speaker' ),
     415         'description' => __( 'Change the post layout from below options', 'motivational-speaker' ),
    278416        'section'     => 'motivational_speaker_layout',
    279         'type'        => 'toggle',
    280         'settings'    => 'motivational_speaker_post_sidebar',
     417        'settings'    => 'motivational_speaker_section_post_heading',
    281418    ) ) );
    282419
    283     $wp_customize->add_setting( 'motivational_speaker_single_post_sidebar', array(
    284         'default'           => false,
    285         'transport'         => 'refresh',
    286         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    287     ) );
    288     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_single_post_sidebar', array(
    289         'label'       => esc_html__( 'Show Single Post Fullwidth', 'motivational-speaker' ),
    290         'section'     => 'motivational_speaker_layout',
    291         'type'        => 'toggle',
    292         'settings'    => 'motivational_speaker_single_post_sidebar',
    293     ) ) );
     420    $wp_customize->add_setting(
     421        'motivational_speaker_post_sidebar',
     422        array(
     423            'type'                 => 'option',
     424            'capability'           => 'edit_theme_options',
     425            'theme_supports'       => '',
     426            'default'              => '',
     427            'transport'            => 'refresh',
     428            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     429        )
     430    );
     431    $wp_customize->add_control(
     432        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     433            $wp_customize,
     434            'motivational_speaker_post_sidebar',
     435            array(
     436                'settings'        => 'motivational_speaker_post_sidebar',
     437                'section'         => 'motivational_speaker_layout',
     438                'label'           => __( 'Show Fullwidth', 'motivational-speaker' ),               
     439                'choices'         => array(
     440                    '1'      => __( 'On', 'motivational-speaker' ),
     441                    'off'    => __( 'Off', 'motivational-speaker' ),
     442                ),
     443                'active_callback' => '',
     444            )
     445        )
     446    );
     447
     448    $wp_customize->add_setting(
     449        'motivational_speaker_single_post_sidebar',
     450        array(
     451            'type'                 => 'option',
     452            'capability'           => 'edit_theme_options',
     453            'theme_supports'       => '',
     454            'default'              => '',
     455            'transport'            => 'refresh',
     456            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     457        )
     458    );
     459    $wp_customize->add_control(
     460        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     461            $wp_customize,
     462            'motivational_speaker_single_post_sidebar',
     463            array(
     464                'settings'        => 'motivational_speaker_single_post_sidebar',
     465                'section'         => 'motivational_speaker_layout',
     466                'label'           => __( 'Show Single Post Fullwidth', 'motivational-speaker' ),               
     467                'choices'         => array(
     468                    '1'      => __( 'On', 'motivational-speaker' ),
     469                    'off'    => __( 'Off', 'motivational-speaker' ),
     470                ),
     471                'active_callback' => '',
     472            )
     473        )
     474    );
    294475
    295476    $wp_customize->add_setting('motivational_speaker_post_option',array(
     
    326507    ));
    327508
    328     $wp_customize->add_setting( 'motivational_speaker_date', array(
    329         'default'           => true,
    330         'transport'         => 'refresh',
    331         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    332     ) );
    333     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_date', array(
    334         'label'       => esc_html__( 'Hide Date', 'motivational-speaker' ),
    335         'section'     => 'motivational_speaker_layout',
    336         'type'        => 'toggle',
    337         'settings'    => 'motivational_speaker_date',
    338     ) ) );
    339 
    340     $wp_customize->add_setting( 'motivational_speaker_admin', array(
    341         'default'           => true,
    342         'transport'         => 'refresh',
    343         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    344     ) );
    345     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_admin', array(
    346         'label'       => esc_html__( 'Hide Author/Admin', 'motivational-speaker' ),
    347         'section'     => 'motivational_speaker_layout',
    348         'type'        => 'toggle',
    349         'settings'    => 'motivational_speaker_admin',
    350     ) ) );
    351 
    352     $wp_customize->add_setting( 'motivational_speaker_comment', array(
    353         'default'           => true,
    354         'transport'         => 'refresh',
    355         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    356     ) );
    357     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_comment', array(
    358         'label'       => esc_html__( 'Hide Comment', 'motivational-speaker' ),
    359         'section'     => 'motivational_speaker_layout',
    360         'type'        => 'toggle',
    361         'settings'    => 'motivational_speaker_comment',
    362     ) ) );
     509    $wp_customize->add_setting('motivational_speaker_date',
     510        array(
     511            'type'                 => 'option',
     512            'capability'           => 'edit_theme_options',
     513            'theme_supports'       => '',
     514            'default'              => '1',
     515            'transport'            => 'refresh',
     516            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     517        )
     518    );
     519    $wp_customize->add_control(new Motivational_Speaker_Customizer_Customcontrol_Switch(
     520            $wp_customize,
     521            'motivational_speaker_date',
     522            array(
     523                'settings'        => 'motivational_speaker_date',
     524                'section'         => 'motivational_speaker_layout',
     525                'label'           => __( 'Show Date', 'motivational-speaker' ),             
     526                'choices'         => array(
     527                    '1'      => __( 'On', 'motivational-speaker' ),
     528                    'off'    => __( 'Off', 'motivational-speaker' ),
     529                ),
     530                'active_callback' => '',
     531            )
     532        )
     533    );
     534
     535    $wp_customize->selective_refresh->add_partial( 'motivational_speaker_date', array(
     536        'selector' => '.date-box',
     537        'render_callback' => 'motivational_speaker_customize_partial_motivational_speaker_date',
     538    ) );
     539
     540    $wp_customize->add_setting('motivational_speaker_admin',
     541        array(
     542            'type'                 => 'option',
     543            'capability'           => 'edit_theme_options',
     544            'theme_supports'       => '',
     545            'default'              => '1',
     546            'transport'            => 'refresh',
     547            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     548        )
     549    );
     550    $wp_customize->add_control(new Motivational_Speaker_Customizer_Customcontrol_Switch(
     551            $wp_customize,
     552            'motivational_speaker_admin',
     553            array(
     554                'settings'        => 'motivational_speaker_admin',
     555                'section'         => 'motivational_speaker_layout',
     556                'label'           => __( 'Show Author/Admin', 'motivational-speaker' ),             
     557                'choices'         => array(
     558                    '1'      => __( 'On', 'motivational-speaker' ),
     559                    'off'    => __( 'Off', 'motivational-speaker' ),
     560                ),
     561                'active_callback' => '',
     562            )
     563        )
     564    );
     565
     566    $wp_customize->selective_refresh->add_partial( 'motivational_speaker_admin', array(
     567        'selector' => '.entry-author',
     568        'render_callback' => 'motivational_speaker_customize_partial_motivational_speaker_admin',
     569    ) );
     570
     571    $wp_customize->add_setting('motivational_speaker_comment',
     572        array(
     573            'type'                 => 'option',
     574            'capability'           => 'edit_theme_options',
     575            'theme_supports'       => '',
     576            'default'              => '1',
     577            'transport'            => 'refresh',
     578            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     579        )
     580    );
     581    $wp_customize->add_control(new Motivational_Speaker_Customizer_Customcontrol_Switch(
     582            $wp_customize,
     583            'motivational_speaker_comment',
     584            array(
     585                'settings'        => 'motivational_speaker_comment',
     586                'section'         => 'motivational_speaker_layout',
     587                'label'           => __( 'Show Comment', 'motivational-speaker' ),             
     588                'choices'         => array(
     589                    '1'      => __( 'On', 'motivational-speaker' ),
     590                    'off'    => __( 'Off', 'motivational-speaker' ),
     591                ),
     592                'active_callback' => '',
     593            )
     594        )
     595    );
     596
     597    $wp_customize->selective_refresh->add_partial( 'motivational_speaker_comment', array(
     598        'selector' => '.entry-comments',
     599        'render_callback' => 'motivational_speaker_customize_partial_motivational_speaker_comment',
     600    ) );
    363601
    364602    // Top Header
     
    368606    ) );
    369607
     608    $wp_customize->add_setting( 'motivational_speaker_section_contact_heading', array(
     609            'default'           => '',
     610            'transport'         => 'refresh',
     611            'sanitize_callback' => 'sanitize_text_field',
     612    ) );
     613    $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_contact_heading', array(
     614        'label'       => esc_html__( 'Contact Settings', 'motivational-speaker' ), 
     615        'description' => __( 'Add contact info in the below feilds', 'motivational-speaker' ),     
     616        'section'     => 'motivational_speaker_top',
     617        'settings'    => 'motivational_speaker_section_contact_heading',
     618    ) ) );
     619
    370620    $wp_customize->add_setting('motivational_speaker_call_text',array(
    371621        'default' => '',
     
    418668    ) );
    419669
    420     $wp_customize->add_setting( 'motivational_speaker_social_enable', array(
    421         'default'           => false,
    422         'transport'         => 'refresh',
    423         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    424     ) );
    425     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_social_enable', array(
    426         'label'       => esc_html__( 'Check to show social links', 'motivational-speaker' ),
    427         'section'     => 'motivational_speaker_social_media',
    428         'type'        => 'toggle',
    429         'settings'    => 'motivational_speaker_social_enable',
     670    $wp_customize->add_setting( 'motivational_speaker_section_social_heading', array(
     671            'default'           => '',
     672            'transport'         => 'refresh',
     673            'sanitize_callback' => 'sanitize_text_field',
     674        ) );
     675    $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_social_heading', array(
     676        'label'       => esc_html__( 'Social Media Settings', 'motivational-speaker' ),
     677        'description' => __( 'Add social media links in the below feilds', 'motivational-speaker' ),           
     678        'section'     => 'motivational_speaker_urls',
     679        'settings'    => 'motivational_speaker_section_social_heading',
    430680    ) ) );
     681
     682    $wp_customize->add_setting(
     683        'motivational_speaker_social_enable',
     684        array(
     685            'type'                 => 'option',
     686            'capability'           => 'edit_theme_options',
     687            'theme_supports'       => '',
     688            'default'              => '1',
     689            'transport'            => 'refresh',
     690            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     691        )
     692    );
     693    $wp_customize->add_control(
     694        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     695            $wp_customize,
     696            'motivational_speaker_social_enable',
     697            array(
     698                'settings'        => 'motivational_speaker_social_enable',
     699                'section'         => 'motivational_speaker_social_media',
     700                'label'           => __( 'Check to show social fields', 'motivational-speaker' ),               
     701                'choices'         => array(
     702                    '1'      => __( 'On', 'motivational-speaker' ),
     703                    'off'    => __( 'Off', 'motivational-speaker' ),
     704                ),
     705                'active_callback' => '',
     706            )
     707        )
     708    );
    431709
    432710    $wp_customize->add_setting('motivational_speaker_facebook_icon',array(
     
    456734    ));
    457735
    458 
    459     $wp_customize->add_setting('motivational_speaker_header_fb_target',
    460     array(
    461         'default' => true,
    462         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    463     )
    464     );
    465     $wp_customize->add_control(new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_header_fb_target',
    466         array(
    467             'label' => esc_html__('Open link in a new tab', 'motivational-speaker'),
    468             'type' => 'toggle',
    469             'section' => 'motivational_speaker_social_media',
    470             'active_callback' => 'motivational_speaker_social_dropdown'
    471         )
    472     )); 
     736    $wp_customize->add_setting(
     737        'motivational_speaker_header_fb_target',
     738        array(
     739            'type'                 => 'option',
     740            'capability'           => 'edit_theme_options',
     741            'theme_supports'       => '',
     742            'default'              => '1',
     743            'transport'            => 'refresh',
     744            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     745        )
     746    );
     747    $wp_customize->add_control(
     748        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     749            $wp_customize,
     750            'motivational_speaker_header_fb_target',
     751            array(
     752                'settings'        => 'motivational_speaker_header_fb_target',
     753                'section'         => 'motivational_speaker_social_media',
     754                'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),               
     755                'choices'         => array(
     756                    '1'      => __( 'On', 'motivational-speaker' ),
     757                    'off'    => __( 'Off', 'motivational-speaker' ),
     758                ),
     759                'active_callback' => 'motivational_speaker_social_dropdown',
     760            )
     761        )
     762    );
    473763
    474764    $wp_customize->add_setting('motivational_speaker_twitter_icon',array(
     
    498788    ));
    499789
    500     $wp_customize->add_setting('motivational_speaker_header_twt_target',
    501     array(
    502         'default' => true,
    503         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    504     )
    505     );
    506     $wp_customize->add_control(new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_header_twt_target',
    507         array(
    508             'label' => esc_html__('Open link in a new tab', 'motivational-speaker'),
    509             'type' => 'toggle',
    510             'section' => 'motivational_speaker_social_media',
    511             'active_callback' => 'motivational_speaker_social_dropdown'
    512         )
    513     ));
     790    $wp_customize->add_setting(
     791        'motivational_speaker_header_twt_target',
     792        array(
     793            'type'                 => 'option',
     794            'capability'           => 'edit_theme_options',
     795            'theme_supports'       => '',
     796            'default'              => '1',
     797            'transport'            => 'refresh',
     798            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     799        )
     800    );
     801    $wp_customize->add_control(
     802        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     803            $wp_customize,
     804            'motivational_speaker_header_twt_target',
     805            array(
     806                'settings'        => 'motivational_speaker_header_twt_target',
     807                'section'         => 'motivational_speaker_social_media',
     808                'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),               
     809                'choices'         => array(
     810                    '1'      => __( 'On', 'motivational-speaker' ),
     811                    'off'    => __( 'Off', 'motivational-speaker' ),
     812                ),
     813                'active_callback' => 'motivational_speaker_social_dropdown',
     814            )
     815        )
     816    );
    514817
    515818    $wp_customize->add_setting('motivational_speaker_youtube_icon',array(
     
    539842    ));
    540843
    541     $wp_customize->add_setting('motivational_speaker_header_ut_target',
    542     array(
    543         'default' => true,
    544         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    545     )
    546     );
    547     $wp_customize->add_control(new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_header_ut_target',
    548         array(
    549             'label' => esc_html__('Open link in a new tab', 'motivational-speaker'),
    550             'type' => 'toggle',
    551             'section' => 'motivational_speaker_social_media',
    552             'active_callback' => 'motivational_speaker_social_dropdown'
    553         )
    554     ));
     844    $wp_customize->add_setting(
     845        'motivational_speaker_header_ut_target',
     846        array(
     847            'type'                 => 'option',
     848            'capability'           => 'edit_theme_options',
     849            'theme_supports'       => '',
     850            'default'              => '1',
     851            'transport'            => 'refresh',
     852            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     853        )
     854    );
     855    $wp_customize->add_control(
     856        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     857            $wp_customize,
     858            'motivational_speaker_header_ut_target',
     859            array(
     860                'settings'        => 'motivational_speaker_header_ut_target',
     861                'section'         => 'motivational_speaker_social_media',
     862                'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),               
     863                'choices'         => array(
     864                    '1'      => __( 'On', 'motivational-speaker' ),
     865                    'off'    => __( 'Off', 'motivational-speaker' ),
     866                ),
     867                'active_callback' => 'motivational_speaker_social_dropdown',
     868            )
     869        )
     870    );
    555871
    556872    $wp_customize->add_setting('motivational_speaker_instagram_icon',array(
     
    580896    ));
    581897
    582     $wp_customize->add_setting('motivational_speaker_header_ins_target',
    583     array(
    584         'default' => true,
    585         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    586     )
    587     );
    588     $wp_customize->add_control(new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_header_ins_target',
    589         array(
    590             'label' => esc_html__('Open link in a new tab', 'motivational-speaker'),
    591             'type' => 'toggle',
    592             'section' => 'motivational_speaker_social_media',
    593             'active_callback' => 'motivational_speaker_social_dropdown'
    594         )
    595     ));
     898    $wp_customize->add_setting(
     899        'motivational_speaker_header_ins_target',
     900        array(
     901            'type'                 => 'option',
     902            'capability'           => 'edit_theme_options',
     903            'theme_supports'       => '',
     904            'default'              => '1',
     905            'transport'            => 'refresh',
     906            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     907        )
     908    );
     909    $wp_customize->add_control(
     910        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     911            $wp_customize,
     912            'motivational_speaker_header_ins_target',
     913            array(
     914                'settings'        => 'motivational_speaker_header_ins_target',
     915                'section'         => 'motivational_speaker_social_media',
     916                'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),               
     917                'choices'         => array(
     918                    '1'      => __( 'On', 'motivational-speaker' ),
     919                    'off'    => __( 'Off', 'motivational-speaker' ),
     920                ),
     921                'active_callback' => 'motivational_speaker_social_dropdown',
     922            )
     923        )
     924    );
    596925
    597926    //Slider
    598927    $wp_customize->add_section( 'motivational_speaker_slider_section' , array(
    599928        'title'      => __( 'Slider Settings', 'motivational-speaker' ),
    600         'description' => __('Slider Image Dimension ( 600px x 700px )','motivational-speaker'),
    601         'priority'   => 3,
    602     ) );
    603 
    604     $wp_customize->add_setting( 'motivational_speaker_slider_arrows', array(
    605         'default'           => false,
    606         'transport'         => 'refresh',
    607         'sanitize_callback' => 'motivational_speaker_sanitize_checkbox',
    608     ) );
    609     $wp_customize->add_control( new motivational_speaker_Toggle_Control( $wp_customize, 'motivational_speaker_slider_arrows', array(
    610         'label'       => esc_html__( 'Check to show slider', 'motivational-speaker' ),
     929        'priority'   => 3,
     930    ) );
     931
     932    $wp_customize->add_setting( 'motivational_speaker_section_slide_heading', array(
     933            'default'           => '',
     934            'transport'         => 'refresh',
     935            'sanitize_callback' => 'sanitize_text_field',
     936    ) );
     937    $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_slide_heading', array(
     938        'label'       => esc_html__( 'Slider Settings', 'motivational-speaker' ),
     939        'description' => __( 'Slider Image Dimension ( 600px x 700px )', 'motivational-speaker' ),     
    611940        'section'     => 'motivational_speaker_slider_section',
    612         'type'        => 'toggle',
    613         'settings'    => 'motivational_speaker_slider_arrows',
     941        'settings'    => 'motivational_speaker_section_slide_heading',
    614942    ) ) );
     943
     944    $wp_customize->add_setting(
     945        'motivational_speaker_slider_arrows',
     946        array(
     947            'type'                 => 'option',
     948            'capability'           => 'edit_theme_options',
     949            'theme_supports'       => '',
     950            'default'              => '',
     951            'transport'            => 'refresh',
     952            'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
     953        )
     954    );
     955    $wp_customize->add_control(
     956        new Motivational_Speaker_Customizer_Customcontrol_Switch(
     957            $wp_customize,
     958            'motivational_speaker_slider_arrows',
     959            array(
     960                'settings'        => 'motivational_speaker_slider_arrows',
     961                'section'         => 'motivational_speaker_slider_section',
     962                'label'           => __( 'Check To Show Slider', 'motivational-speaker' ),             
     963                'choices'         => array(
     964                    '1'      => __( 'On', 'motivational-speaker' ),
     965                    'off'    => __( 'Off', 'motivational-speaker' ),
     966                ),
     967                'active_callback' => '',
     968            )
     969        )
     970    );
    615971
    616972    $args = array('numberposts' => -1);
     
    6951051        'priority' => 6
    6961052    ) );
     1053
     1054    $wp_customize->add_setting( 'motivational_speaker_section_footer_heading', array(
     1055            'default'           => '',
     1056            'transport'         => 'refresh',
     1057            'sanitize_callback' => 'sanitize_text_field',
     1058        ) );
     1059        $wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_footer_heading', array(
     1060            'label'       => esc_html__( 'Footer Settings', 'motivational-speaker' ),       
     1061            'section'     => 'motivational_speaker_footer_copyright',
     1062            'settings'    => 'motivational_speaker_section_footer_heading',
     1063        ) ) );
     1064
    6971065
    6981066    $wp_customize->add_setting('motivational_speaker_footer_text',array(
Note: See TracChangeset for help on using the changeset viewer.