@@ -109,7 +109,7 @@ function shapely_customizer( $wp_customize ) {
109109 'sanitize_callback ' => 'shapely_sanitize_checkbox ' ,
110110 ) );
111111
112- if ( class_exists ('Epsilon_Control_Toggle ' )) {
112+ if ( class_exists ( 'Epsilon_Control_Toggle ' ) ) {
113113 $ wp_customize ->add_control ( new Epsilon_Control_Toggle (
114114 $ wp_customize ,
115115 'top_callout ' ,
@@ -135,22 +135,22 @@ function shapely_customizer( $wp_customize ) {
135135 'sanitize_callback ' => 'shapely_sanitize_checkbox ' ,
136136 ) );
137137
138- if ( class_exists ('Epsilon_Control_Toggle ' )) {
138+ if ( class_exists ( 'Epsilon_Control_Toggle ' ) ) {
139139 $ wp_customize ->add_control ( new Epsilon_Control_Toggle (
140140 $ wp_customize ,
141141 'hide_post_title ' ,
142142 array (
143- 'type ' => 'mte-toggle ' ,
144- 'label ' => esc_html__ ( 'Title in blog post ' , 'shapely ' ),
145- 'section ' => 'wpseo_breadcrumbs_customizer_section ' ,
143+ 'type ' => 'mte-toggle ' ,
144+ 'label ' => esc_html__ ( 'Title in blog post ' , 'shapely ' ),
145+ 'section ' => 'wpseo_breadcrumbs_customizer_section ' ,
146146 )
147147 )
148148 );
149149 } else {
150150 $ wp_customize ->add_control ( 'hide_post_title ' , array (
151- 'label ' => esc_html__ ( 'Title in blog post ' , 'shapely ' ),
152- 'section ' => 'wpseo_breadcrumbs_customizer_section ' ,
153- 'type ' => 'checkbox ' ,
151+ 'label ' => esc_html__ ( 'Title in blog post ' , 'shapely ' ),
152+ 'section ' => 'wpseo_breadcrumbs_customizer_section ' ,
153+ 'type ' => 'checkbox ' ,
154154 ) );
155155 }
156156
@@ -232,6 +232,66 @@ function shapely_customizer( $wp_customize ) {
232232 'section ' => 'shapely_footer_section ' ,
233233 ) );
234234
235+ if ( class_exists ( 'Epsilon_Control_Color_Scheme ' ) ) {
236+ $ wp_customize ->add_setting ( 'shapely_color_scheme ' ,
237+ array (
238+ 'sanitize_callback ' => 'sanitize_text_field ' ,
239+ 'default ' => 'default ' ,
240+ 'transport ' => 'postMessage ' ,
241+ ) );
242+
243+ $ wp_customize ->add_control ( new Epsilon_Control_Color_Scheme (
244+ $ wp_customize ,
245+ 'shapely_color_scheme ' ,
246+ array (
247+ 'label ' => esc_html__ ( 'Color scheme ' , 'newsmag-pro ' ),
248+ 'description ' => esc_html__ ( 'Select a color scheme ' , 'newsmag-pro ' ),
249+ 'choices ' => array (
250+ array (
251+ 'id ' => 'purple ' ,
252+ 'name ' => 'Default ' ,
253+ 'colors ' => array (
254+ 'accent ' => '#745cf9 ' ,
255+ 'text ' => '#666666 ' ,
256+ 'content-widget-title ' => '#0e1015 ' ,
257+ 'footer-bg ' => '#0e1015 ' ,
258+ 'footer-widget-title ' => '#ffffff ' ,
259+ 'footer-links ' => '#ffffff '
260+ ),
261+ ),
262+ array (
263+ 'id ' => 'yellow ' ,
264+ 'name ' => 'Yellow ' ,
265+ 'colors ' => array (
266+ 'accent ' => '#FFC107 ' ,
267+ 'text ' => '#666666 ' ,
268+ 'content-widget-title ' => '#0e1015 ' ,
269+ 'footer-bg ' => '#0e1015 ' ,
270+ 'footer-widget-title ' => '#ffffff ' ,
271+ 'footer-links ' => '#ffffff '
272+ ),
273+ ),
274+ array (
275+ 'id ' => 'green ' ,
276+ 'name ' => 'Green ' ,
277+ 'colors ' => array (
278+ 'accent ' => '#2ecc71 ' ,
279+ 'text ' => '#666666 ' ,
280+ 'content-widget-title ' => '#0e1015 ' ,
281+ 'footer-bg ' => '#0e1015 ' ,
282+ 'footer-widget-title ' => '#ffffff ' ,
283+ 'footer-links ' => '#ffffff '
284+ ),
285+ ),
286+ ),
287+ 'priority ' => 0 ,
288+ 'default ' => 'purple ' ,
289+ 'section ' => 'colors ' ,
290+ )
291+ )
292+ );
293+ }
294+
235295}
236296
237297add_action ( 'customize_register ' , 'shapely_customizer ' );
@@ -277,16 +337,6 @@ function shapely_sanitize_hexcolor( $color ) {
277337 return $ color ;
278338}
279339
280-
281- /**
282- * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
283- */
284- function shapely_customize_preview_js () {
285- wp_enqueue_script ( 'shapely_customizer ' , get_template_directory_uri () . '/js/customizer.js ' , array ( 'customize-preview ' ), false , true );
286- }
287-
288- add_action ( 'customize_preview_init ' , 'shapely_customize_preview_js ' );
289-
290340/**
291341 * Add CSS for custom controls.
292342 */
0 commit comments