@@ -109,12 +109,26 @@ function shapely_customizer( $wp_customize ) {
109109 'sanitize_callback ' => 'shapely_sanitize_checkbox ' ,
110110 ) );
111111
112- $ wp_customize ->add_control ( 'top_callout ' , array (
113- 'label ' => esc_html__ ( 'check to show title in top call out box ' , 'shapely ' ),
114- 'section ' => 'shapely_main_section ' ,
115- 'priority ' => 20 ,
116- 'type ' => 'checkbox ' ,
117- ) );
112+ if (class_exists ('Epsilon_Control_Toggle ' )){
113+ $ wp_customize ->add_control ( new Epsilon_Control_Toggle (
114+ $ wp_customize ,
115+ 'top_callout ' ,
116+ array (
117+ 'type ' => 'mte-toggle ' ,
118+ 'label ' => esc_html__ ( 'Show title in top call out box ' , 'newsmag ' ),
119+ 'section ' => 'shapely_main_section ' ,
120+ 'priority ' => 20
121+ )
122+ )
123+ );
124+ } else {
125+ $ wp_customize ->add_control ( 'top_callout ' , array (
126+ 'label ' => esc_html__ ( 'check to show title in top call out box ' , 'shapely ' ),
127+ 'section ' => 'shapely_main_section ' ,
128+ 'priority ' => 20 ,
129+ 'type ' => 'checkbox ' ,
130+ ) );
131+ }
118132
119133 $ wp_customize ->add_setting ( 'blog_name ' , array (
120134 'default ' => '' ,
@@ -190,7 +204,7 @@ function shapely_customizer( $wp_customize ) {
190204
191205 $ wp_customize ->add_control ( 'shapely_footer_copyright ' , array (
192206 'type ' => 'textarea ' ,
193- 'label ' => __ ('Copyright Text ' , 'shapely ' ),
207+ 'label ' => __ ( 'Copyright Text ' , 'shapely ' ),
194208 'section ' => 'shapely_footer_section ' ,
195209 ) );
196210
@@ -206,13 +220,13 @@ function shapely_sanitize_strip_slashes( $input ) {
206220}
207221
208222/**
209- * Sanitzie checkbox for WordPress customizer.
223+ * Sanitize checkbox for WordPress customizer.
210224 */
211225function shapely_sanitize_checkbox ( $ input ) {
212226 if ( $ input == 1 ) {
213- return 1 ;
227+ return true ;
214228 } else {
215- return '' ;
229+ return false ;
216230 }
217231}
218232
0 commit comments