@@ -44,9 +44,12 @@ |
||
| 44 | 44 | |
| 45 | 45 | <?php lsx_paging_nav(); ?> |
| 46 | 46 | |
| 47 | - <?php else : ?> |
|
| 47 | + <?php else { |
|
| 48 | + : ?> |
|
| 48 | 49 | |
| 49 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 50 | + <?php get_template_part( 'content', 'none' ); |
|
| 51 | +} |
|
| 52 | +?> |
|
| 50 | 53 | |
| 51 | 54 | <?php endif; ?> |
| 52 | 55 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | <?php lsx_content_wrap_before(); ?> |
| 13 | 13 | |
| 14 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 14 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 15 | 15 | |
| 16 | 16 | <?php lsx_content_before(); ?> |
| 17 | 17 | |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | <?php lsx_content_top(); ?> |
| 21 | 21 | |
| 22 | - <?php if ( have_posts() ) : ?> |
|
| 22 | + <?php if (have_posts()) : ?> |
|
| 23 | 23 | |
| 24 | 24 | <?php |
| 25 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 26 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 27 | - if('1c' === $layout && !is_post_type_archive('tribe_events')){ |
|
| 25 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 26 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 27 | + if ('1c' === $layout && ! is_post_type_archive('tribe_events')) { |
|
| 28 | 28 | lsx_breadcrumbs(); |
| 29 | 29 | } |
| 30 | 30 | ?> |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | ?> |
| 34 | 34 | |
| 35 | 35 | <?php /* Start the Loop */ ?> |
| 36 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 36 | + <?php while (have_posts()) : the_post(); ?> |
|
| 37 | 37 | |
| 38 | 38 | <?php |
| 39 | 39 | /* Include the Post-Format-specific template for the content. |
| 40 | 40 | * If you want to override this in a child theme, then include a file |
| 41 | 41 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
| 42 | 42 | */ |
| 43 | - get_template_part( 'content', get_post_format() ); |
|
| 43 | + get_template_part('content', get_post_format()); |
|
| 44 | 44 | ?> |
| 45 | 45 | |
| 46 | 46 | <?php endwhile; ?> |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | <?php else : ?> |
| 51 | 51 | |
| 52 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 52 | + <?php get_template_part('content', 'none'); ?> |
|
| 53 | 53 | |
| 54 | 54 | <?php endif; ?> |
| 55 | 55 | |
@@ -44,9 +44,12 @@ |
||
| 44 | 44 | |
| 45 | 45 | <?php lsx_paging_nav(); ?> |
| 46 | 46 | |
| 47 | - <?php else : ?> |
|
| 47 | + <?php else { |
|
| 48 | + : ?> |
|
| 48 | 49 | |
| 49 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 50 | + <?php get_template_part( 'content', 'none' ); |
|
| 51 | +} |
|
| 52 | +?> |
|
| 50 | 53 | |
| 51 | 54 | <?php endif; ?> |
| 52 | 55 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | <?php lsx_content_wrap_before(); ?> |
| 17 | 17 | |
| 18 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 18 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 19 | 19 | |
| 20 | 20 | <?php lsx_content_before(); ?> |
| 21 | 21 | |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | <?php lsx_content_top(); ?> |
| 25 | 25 | |
| 26 | - <?php if ( have_posts() ) : ?> |
|
| 26 | + <?php if (have_posts()) : ?> |
|
| 27 | 27 | |
| 28 | 28 | <?php /* Start the Loop */ ?> |
| 29 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 29 | + <?php while (have_posts()) : the_post(); ?> |
|
| 30 | 30 | |
| 31 | 31 | <?php |
| 32 | 32 | /* Include the Post-Format-specific template for the content. |
| 33 | 33 | * If you want to override this in a child theme, then include a file |
| 34 | 34 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
| 35 | 35 | */ |
| 36 | - get_template_part( 'content', get_post_format() ); |
|
| 36 | + get_template_part('content', get_post_format()); |
|
| 37 | 37 | ?> |
| 38 | 38 | |
| 39 | 39 | <?php endwhile; ?> |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | <?php else : ?> |
| 44 | 44 | |
| 45 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 45 | + <?php get_template_part('content', 'none'); ?> |
|
| 46 | 46 | |
| 47 | 47 | <?php endif; ?> |
| 48 | 48 | |
@@ -56,5 +56,5 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | <?php lsx_content_wrap_after(); ?> |
| 58 | 58 | |
| 59 | -<?php get_sidebar( 'sidebar' ); ?> |
|
| 59 | +<?php get_sidebar('sidebar'); ?> |
|
| 60 | 60 | <?php get_footer(); |
| 61 | 61 | \ No newline at end of file |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,71 +1,71 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | global $customizer_colour_names; |
| 5 | 5 | global $customizer_colour_choices; |
| 6 | 6 | |
| 7 | -$customizer_colour_names = apply_filters( 'lsx_customizer_colour_names', array( |
|
| 8 | - 'button_background_color' => esc_html__( 'BUTTON: Background', 'lsx' ), |
|
| 9 | - 'button_background_hover_color' => esc_html__( 'BUTTON: Background (hover)', 'lsx' ), |
|
| 10 | - 'button_text_color' => esc_html__( 'BUTTON: Text', 'lsx' ), |
|
| 11 | - 'button_text_color_hover' => esc_html__( 'BUTTON: Text (hover)', 'lsx' ), |
|
| 7 | +$customizer_colour_names = apply_filters('lsx_customizer_colour_names', array( |
|
| 8 | + 'button_background_color' => esc_html__('BUTTON: Background', 'lsx'), |
|
| 9 | + 'button_background_hover_color' => esc_html__('BUTTON: Background (hover)', 'lsx'), |
|
| 10 | + 'button_text_color' => esc_html__('BUTTON: Text', 'lsx'), |
|
| 11 | + 'button_text_color_hover' => esc_html__('BUTTON: Text (hover)', 'lsx'), |
|
| 12 | 12 | |
| 13 | - 'button_cta_background_color' => esc_html__( 'BUTTON CTA: Background', 'lsx' ), |
|
| 14 | - 'button_cta_background_hover_color' => esc_html__( 'BUTTON CTA: Background (hover)', 'lsx' ), |
|
| 15 | - 'button_cta_text_color' => esc_html__( 'BUTTON CTA: Text', 'lsx' ), |
|
| 16 | - 'button_cta_text_color_hover' => esc_html__( 'BUTTON CTA: Text (hover)', 'lsx' ), |
|
| 13 | + 'button_cta_background_color' => esc_html__('BUTTON CTA: Background', 'lsx'), |
|
| 14 | + 'button_cta_background_hover_color' => esc_html__('BUTTON CTA: Background (hover)', 'lsx'), |
|
| 15 | + 'button_cta_text_color' => esc_html__('BUTTON CTA: Text', 'lsx'), |
|
| 16 | + 'button_cta_text_color_hover' => esc_html__('BUTTON CTA: Text (hover)', 'lsx'), |
|
| 17 | 17 | |
| 18 | - 'top_menu_background_color' => esc_html__( 'TOP MENU: Background', 'lsx' ), |
|
| 19 | - 'top_menu_text_color' => esc_html__( 'TOP MENU: Text', 'lsx' ), |
|
| 20 | - 'top_menu_text_hover_color' => esc_html__( 'TOP MENU: Text (hover)', 'lsx' ), |
|
| 18 | + 'top_menu_background_color' => esc_html__('TOP MENU: Background', 'lsx'), |
|
| 19 | + 'top_menu_text_color' => esc_html__('TOP MENU: Text', 'lsx'), |
|
| 20 | + 'top_menu_text_hover_color' => esc_html__('TOP MENU: Text (hover)', 'lsx'), |
|
| 21 | 21 | |
| 22 | - 'header_background_color' => esc_html__( 'HEADER: Background', 'lsx' ), |
|
| 23 | - 'header_title_color' => esc_html__( 'HEADER: Title', 'lsx' ), |
|
| 24 | - 'header_title_hover_color' => esc_html__( 'HEADER: Title (hover)', 'lsx' ), |
|
| 25 | - 'header_description_color' => esc_html__( 'HEADER: Description', 'lsx' ), |
|
| 22 | + 'header_background_color' => esc_html__('HEADER: Background', 'lsx'), |
|
| 23 | + 'header_title_color' => esc_html__('HEADER: Title', 'lsx'), |
|
| 24 | + 'header_title_hover_color' => esc_html__('HEADER: Title (hover)', 'lsx'), |
|
| 25 | + 'header_description_color' => esc_html__('HEADER: Description', 'lsx'), |
|
| 26 | 26 | |
| 27 | - 'main_menu_background_hover1_color' => esc_html__( 'MENU: Background (L1 hover)', 'lsx' ), |
|
| 28 | - 'main_menu_background_hover2_color' => esc_html__( 'MENU: Background (L2 hover)', 'lsx' ), |
|
| 29 | - 'main_menu_text_color' => esc_html__( 'MENU: Text (L1)', 'lsx' ), |
|
| 30 | - 'main_menu_text_hover1_color' => esc_html__( 'MENU: Text (L1 hover)', 'lsx' ), |
|
| 31 | - 'main_menu_text_hover2_color' => esc_html__( 'MENU: Text (L2 hover)', 'lsx' ), |
|
| 27 | + 'main_menu_background_hover1_color' => esc_html__('MENU: Background (L1 hover)', 'lsx'), |
|
| 28 | + 'main_menu_background_hover2_color' => esc_html__('MENU: Background (L2 hover)', 'lsx'), |
|
| 29 | + 'main_menu_text_color' => esc_html__('MENU: Text (L1)', 'lsx'), |
|
| 30 | + 'main_menu_text_hover1_color' => esc_html__('MENU: Text (L1 hover)', 'lsx'), |
|
| 31 | + 'main_menu_text_hover2_color' => esc_html__('MENU: Text (L2 hover)', 'lsx'), |
|
| 32 | 32 | |
| 33 | - 'banner_background_color' => esc_html__( 'BANNER: Background', 'lsx' ), |
|
| 34 | - 'banner_text_color' => esc_html__( 'BANNER: Text', 'lsx' ), |
|
| 35 | - 'banner_text_image_color' => esc_html__( 'BANNER: Text (over image)', 'lsx' ), |
|
| 33 | + 'banner_background_color' => esc_html__('BANNER: Background', 'lsx'), |
|
| 34 | + 'banner_text_color' => esc_html__('BANNER: Text', 'lsx'), |
|
| 35 | + 'banner_text_image_color' => esc_html__('BANNER: Text (over image)', 'lsx'), |
|
| 36 | 36 | |
| 37 | - 'body_background_color' => esc_html__( 'BODY: Background', 'lsx' ), |
|
| 38 | - 'body_line_color' => esc_html__( 'BODY: Line', 'lsx' ), |
|
| 39 | - 'body_text_heading_color' => esc_html__( 'BODY: Text (heading)', 'lsx' ), |
|
| 40 | - 'body_text_color' => esc_html__( 'BODY: Text', 'lsx' ), |
|
| 41 | - 'body_link_color' => esc_html__( 'BODY: Link', 'lsx' ), |
|
| 42 | - 'body_link_hover_color' => esc_html__( 'BODY: Link (hover)', 'lsx' ), |
|
| 37 | + 'body_background_color' => esc_html__('BODY: Background', 'lsx'), |
|
| 38 | + 'body_line_color' => esc_html__('BODY: Line', 'lsx'), |
|
| 39 | + 'body_text_heading_color' => esc_html__('BODY: Text (heading)', 'lsx'), |
|
| 40 | + 'body_text_color' => esc_html__('BODY: Text', 'lsx'), |
|
| 41 | + 'body_link_color' => esc_html__('BODY: Link', 'lsx'), |
|
| 42 | + 'body_link_hover_color' => esc_html__('BODY: Link (hover)', 'lsx'), |
|
| 43 | 43 | |
| 44 | - 'footer_cta_background_color' => esc_html__( 'FOOTER CTA: Background', 'lsx' ), |
|
| 45 | - 'footer_cta_text_color' => esc_html__( 'FOOTER CTA: Text', 'lsx' ), |
|
| 46 | - 'footer_cta_link_color' => esc_html__( 'FOOTER CTA: Link', 'lsx' ), |
|
| 47 | - 'footer_cta_link_hover_color' => esc_html__( 'FOOTER CTA: Link (hover)', 'lsx' ), |
|
| 44 | + 'footer_cta_background_color' => esc_html__('FOOTER CTA: Background', 'lsx'), |
|
| 45 | + 'footer_cta_text_color' => esc_html__('FOOTER CTA: Text', 'lsx'), |
|
| 46 | + 'footer_cta_link_color' => esc_html__('FOOTER CTA: Link', 'lsx'), |
|
| 47 | + 'footer_cta_link_hover_color' => esc_html__('FOOTER CTA: Link (hover)', 'lsx'), |
|
| 48 | 48 | |
| 49 | - 'footer_widgets_background_color' => esc_html__( 'FOOTER WIDGETS: Background', 'lsx' ), |
|
| 50 | - 'footer_widgets_text_color' => esc_html__( 'FOOTER WIDGETS: Text', 'lsx' ), |
|
| 51 | - 'footer_widgets_link_color' => esc_html__( 'FOOTER WIDGETS: Link', 'lsx' ), |
|
| 52 | - 'footer_widgets_link_hover_color' => esc_html__( 'FOOTER WIDGETS: Link (hover)', 'lsx' ), |
|
| 49 | + 'footer_widgets_background_color' => esc_html__('FOOTER WIDGETS: Background', 'lsx'), |
|
| 50 | + 'footer_widgets_text_color' => esc_html__('FOOTER WIDGETS: Text', 'lsx'), |
|
| 51 | + 'footer_widgets_link_color' => esc_html__('FOOTER WIDGETS: Link', 'lsx'), |
|
| 52 | + 'footer_widgets_link_hover_color' => esc_html__('FOOTER WIDGETS: Link (hover)', 'lsx'), |
|
| 53 | 53 | |
| 54 | - 'footer_background_color' => esc_html__( 'FOOTER: Background', 'lsx' ), |
|
| 55 | - 'footer_text_color' => esc_html__( 'FOOTER: Text', 'lsx' ), |
|
| 56 | - 'footer_link_color' => esc_html__( 'FOOTER: Link', 'lsx' ), |
|
| 57 | - 'footer_link_hover_color' => esc_html__( 'FOOTER: Link (hover)', 'lsx' ), |
|
| 54 | + 'footer_background_color' => esc_html__('FOOTER: Background', 'lsx'), |
|
| 55 | + 'footer_text_color' => esc_html__('FOOTER: Text', 'lsx'), |
|
| 56 | + 'footer_link_color' => esc_html__('FOOTER: Link', 'lsx'), |
|
| 57 | + 'footer_link_hover_color' => esc_html__('FOOTER: Link (hover)', 'lsx'), |
|
| 58 | 58 | |
| 59 | - 'body_section_full_background_color' => esc_html__( 'BODY: Section full (background)', 'lsx' ), |
|
| 60 | - 'body_section_full_text_color' => esc_html__( 'BODY: Section full (text)', 'lsx' ), |
|
| 61 | - 'body_section_full_cta_background_color' => esc_html__( 'BODY: Section full CTA (background)', 'lsx' ), |
|
| 62 | - 'body_section_full_cta_text_color' => esc_html__( 'BODY: Section full CTA (text)', 'lsx' ), |
|
| 63 | -) ); |
|
| 59 | + 'body_section_full_background_color' => esc_html__('BODY: Section full (background)', 'lsx'), |
|
| 60 | + 'body_section_full_text_color' => esc_html__('BODY: Section full (text)', 'lsx'), |
|
| 61 | + 'body_section_full_cta_background_color' => esc_html__('BODY: Section full CTA (background)', 'lsx'), |
|
| 62 | + 'body_section_full_cta_text_color' => esc_html__('BODY: Section full CTA (text)', 'lsx'), |
|
| 63 | +)); |
|
| 64 | 64 | |
| 65 | -$customizer_colour_choices = apply_filters( 'lsx_customizer_colour_choices', array( |
|
| 65 | +$customizer_colour_choices = apply_filters('lsx_customizer_colour_choices', array( |
|
| 66 | 66 | 'default' => array( |
| 67 | - 'label' => __( 'Default', 'lsx' ), |
|
| 68 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_default', array( |
|
| 67 | + 'label' => __('Default', 'lsx'), |
|
| 68 | + 'colors' => apply_filters('lsx_customizer_colour_choices_default', array( |
|
| 69 | 69 | // Button |
| 70 | 70 | '#428bca', '#2a6496', '#ffffff', '#ffffff', |
| 71 | 71 | // Button CTA |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | '#232222', '#ffffff', '#337ab7', '#969696', |
| 89 | 89 | // Body section full |
| 90 | 90 | '#428bca', '#ffffff', '#333333', '#ffffff' |
| 91 | - ) ) |
|
| 91 | + )) |
|
| 92 | 92 | ), |
| 93 | 93 | 'red' => array( |
| 94 | - 'label' => __( 'Red', 'lsx' ), |
|
| 95 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_red', array( |
|
| 94 | + 'label' => __('Red', 'lsx'), |
|
| 95 | + 'colors' => apply_filters('lsx_customizer_colour_choices_red', array( |
|
| 96 | 96 | // Button |
| 97 | 97 | '#b64d3f', '#87291c', '#ffffff', '#ffffff', |
| 98 | 98 | // Button CTA |
@@ -115,11 +115,11 @@ discard block |
||
| 115 | 115 | '#232222', '#ffffff', '#b64d3f', '#969696', |
| 116 | 116 | // Body section full |
| 117 | 117 | '#b64d3f', '#ffffff', '#333333', '#ffffff' |
| 118 | - ) ) |
|
| 118 | + )) |
|
| 119 | 119 | ), |
| 120 | 120 | 'orange' => array( |
| 121 | - 'label' => __( 'Orange', 'lsx' ), |
|
| 122 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_orange', array( |
|
| 121 | + 'label' => __('Orange', 'lsx'), |
|
| 122 | + 'colors' => apply_filters('lsx_customizer_colour_choices_orange', array( |
|
| 123 | 123 | // Button |
| 124 | 124 | '#fbaf3f', '#e49435', '#260e03', '#260e03', |
| 125 | 125 | // Button CTA |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | '#232222', '#ffffff', '#e4701e', '#969696', |
| 143 | 143 | // Body section full |
| 144 | 144 | '#fbaf3f', '#ffffff', '#333333', '#ffffff' |
| 145 | - ) ) |
|
| 145 | + )) |
|
| 146 | 146 | ), |
| 147 | 147 | 'green' => array( |
| 148 | - 'label' => __( 'Green', 'lsx' ), |
|
| 149 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_green', array( |
|
| 148 | + 'label' => __('Green', 'lsx'), |
|
| 149 | + 'colors' => apply_filters('lsx_customizer_colour_choices_green', array( |
|
| 150 | 150 | // Button |
| 151 | 151 | '#596b46', '#3d4a30', '#ffffff', '#ffffff', |
| 152 | 152 | // Button CTA |
@@ -169,11 +169,11 @@ discard block |
||
| 169 | 169 | '#232222', '#ffffff', '#596b46', '#969696', |
| 170 | 170 | // Body section full |
| 171 | 171 | '#596b46', '#ffffff', '#333333', '#ffffff' |
| 172 | - ) ) |
|
| 172 | + )) |
|
| 173 | 173 | ), |
| 174 | 174 | 'brown' => array( |
| 175 | - 'label' => __( 'Brown', 'lsx' ), |
|
| 176 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_brown', array( |
|
| 175 | + 'label' => __('Brown', 'lsx'), |
|
| 176 | + 'colors' => apply_filters('lsx_customizer_colour_choices_brown', array( |
|
| 177 | 177 | // Button |
| 178 | 178 | '#8c6a45', '#5b452e', '#ffffff', '#ffffff', |
| 179 | 179 | // Button CTA |
@@ -196,6 +196,6 @@ discard block |
||
| 196 | 196 | '#232222', '#ffffff', '#8c6a45', '#969696', |
| 197 | 197 | // Body section full |
| 198 | 198 | '#8c6a45', '#ffffff', '#333333', '#ffffff' |
| 199 | - ) ) |
|
| 199 | + )) |
|
| 200 | 200 | ) |
| 201 | -) ); |
|
| 201 | +)); |
|
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customize Swatch Control Class |
| 6 | 6 | * |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | */ |
| 9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 10 | 10 | return; |
| 11 | 11 | } |
| 12 | 12 | class LSX_Customize_Core_Control extends WP_Customize_Control { |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | public function render_content() { |
| 23 | 23 | ?> |
| 24 | 24 | <label> |
| 25 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 26 | - <span class="customize-control-title"><?php echo esc_html( $this->label ) ?></span> |
|
| 25 | + <?php if ( ! empty($this->label)) { ?> |
|
| 26 | + <span class="customize-control-title"><?php echo esc_html($this->label) ?></span> |
|
| 27 | 27 | <?php } |
| 28 | - if ( ! empty( $this->description ) ) { ?> |
|
| 29 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ) ?></span> |
|
| 28 | + if ( ! empty($this->description)) { ?> |
|
| 29 | + <span class="description customize-control-description"><?php echo esc_html($this->description) ?></span> |
|
| 30 | 30 | <?php } ?> |
| 31 | - <input <?php $this->link() ?> type="checkbox" value="<?php echo esc_attr( $this->value() ) ?>" <?php $this->input_attrs() ?>> |
|
| 31 | + <input <?php $this->link() ?> type="checkbox" value="<?php echo esc_attr($this->value()) ?>" <?php $this->input_attrs() ?>> |
|
| 32 | 32 | </label> |
| 33 | 33 | <?php |
| 34 | 34 | } |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customizer Header Fixed Class |
| 6 | 6 | * |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | */ |
| 9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 10 | 10 | return; |
| 11 | 11 | } |
| 12 | 12 | class LSX_Customize_Header_Fixed_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * @param string $id |
| 39 | 39 | * @param array $args |
| 40 | 40 | */ |
| 41 | - public function __construct( $manager, $id, $args = array() ) { |
|
| 42 | - parent::__construct( $manager, $id, $args ); |
|
| 43 | - if( !empty( $args['choices'] ) ){ |
|
| 41 | + public function __construct($manager, $id, $args = array()) { |
|
| 42 | + parent::__construct($manager, $id, $args); |
|
| 43 | + if ( ! empty($args['choices'])) { |
|
| 44 | 44 | $this->layouts = $args['choices']; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function enqueue() { |
| 54 | 54 | // |
| 55 | - wp_enqueue_script( 'lsx-header-fixed-control', get_template_directory_uri() .'/js/customizer-header-fixed.js', array('jquery'), null, true ); |
|
| 55 | + wp_enqueue_script('lsx-header-fixed-control', get_template_directory_uri() . '/js/customizer-header-fixed.js', array('jquery'), null, true); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -62,21 +62,21 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function render_content() { |
| 64 | 64 | |
| 65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
| 65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
| 66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
| 67 | 67 | $value = $this->value(); |
| 68 | 68 | |
| 69 | 69 | ?> |
| 70 | 70 | <label> |
| 71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
| 71 | + <?php if ( ! empty($this->label)) { ?> |
|
| 72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
| 73 | 73 | <?php } |
| 74 | - if ( ! empty( $this->description ) ) { ?> |
|
| 75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
| 74 | + if ( ! empty($this->description)) { ?> |
|
| 75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
| 76 | 76 | <?php } ?> |
| 77 | 77 | <div class="header-fixed"> |
| 78 | 78 | <label> |
| 79 | - <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr( $post_id ); ?>" class="header-fixed <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
| 79 | + <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr($post_id); ?>" class="header-fixed <?php echo esc_attr($class); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
| 80 | 80 | </label> |
| 81 | 81 | </div> |
| 82 | 82 | </label> |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,22 +1,22 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Transform SCSS to CSS |
| 6 | 6 | */ |
| 7 | -function lsx_customizer_colour__scss_to_css( $scss ) { |
|
| 7 | +function lsx_customizer_colour__scss_to_css($scss) { |
|
| 8 | 8 | $css = ''; |
| 9 | - $scssphp_file = get_template_directory() .'/vendor/leafo/scssphp/scss.inc.php'; |
|
| 9 | + $scssphp_file = get_template_directory() . '/vendor/leafo/scssphp/scss.inc.php'; |
|
| 10 | 10 | |
| 11 | - if ( ! empty( $scss ) && file_exists( $scssphp_file ) ) { |
|
| 11 | + if ( ! empty($scss) && file_exists($scssphp_file)) { |
|
| 12 | 12 | require_once $scssphp_file; |
| 13 | 13 | |
| 14 | 14 | $compiler = new \Leafo\ScssPhp\Compiler(); |
| 15 | - $compiler->setFormatter( 'Leafo\ScssPhp\Formatter\Compact' ); |
|
| 15 | + $compiler->setFormatter('Leafo\ScssPhp\Formatter\Compact'); |
|
| 16 | 16 | |
| 17 | 17 | try { |
| 18 | - $css = $compiler->compile( $scss ); |
|
| 19 | - } catch ( Exception $e ) { |
|
| 18 | + $css = $compiler->compile($scss); |
|
| 19 | + } catch (Exception $e) { |
|
| 20 | 20 | $error = $e->getMessage(); |
| 21 | 21 | return "/*\n\n\$error:\n\n{$error}\n\n\$scss:\n\n{$scss} */"; |
| 22 | 22 | } |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | */ |
| 31 | 31 | function lsx_customizer_colour__add_footer_styles() { |
| 32 | - wp_enqueue_style( 'lsx_customizer_colour', get_stylesheet_uri() ); |
|
| 32 | + wp_enqueue_style('lsx_customizer_colour', get_stylesheet_uri()); |
|
| 33 | 33 | } |
| 34 | -add_action( 'wp_footer', 'lsx_customizer_colour__add_footer_styles', 11 ); |
|
| 34 | +add_action('wp_footer', 'lsx_customizer_colour__add_footer_styles', 11); |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Outputs an Underscore template for generating CSS for the color scheme. |
@@ -41,28 +41,28 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $colors = array(); |
| 43 | 43 | |
| 44 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 45 | - $colors[$key] = 'unquote("{{ data.'.$key.' }}")'; |
|
| 44 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 45 | + $colors[$key] = 'unquote("{{ data.' . $key . ' }}")'; |
|
| 46 | 46 | } |
| 47 | 47 | ?> |
| 48 | 48 | <script type="text/html" id="tmpl-lsx-color-scheme"> |
| 49 | - <?php echo esc_html( lsx_customizer_colour__top_menu_get_css( $colors ) ) ?> |
|
| 50 | - <?php echo esc_html( lsx_customizer_colour__header_get_css( $colors ) ) ?> |
|
| 51 | - <?php echo esc_html( lsx_customizer_colour__main_menu_get_css( $colors ) ) ?> |
|
| 49 | + <?php echo esc_html(lsx_customizer_colour__top_menu_get_css($colors)) ?> |
|
| 50 | + <?php echo esc_html(lsx_customizer_colour__header_get_css($colors)) ?> |
|
| 51 | + <?php echo esc_html(lsx_customizer_colour__main_menu_get_css($colors)) ?> |
|
| 52 | 52 | |
| 53 | - <?php echo esc_html( lsx_customizer_colour__banner_get_css( $colors ) ) ?> |
|
| 54 | - <?php echo esc_html( lsx_customizer_colour__body_get_css( $colors ) ) ?> |
|
| 53 | + <?php echo esc_html(lsx_customizer_colour__banner_get_css($colors)) ?> |
|
| 54 | + <?php echo esc_html(lsx_customizer_colour__body_get_css($colors)) ?> |
|
| 55 | 55 | |
| 56 | - <?php echo esc_html( lsx_customizer_colour__footer_cta_get_css( $colors ) ) ?> |
|
| 57 | - <?php echo esc_html( lsx_customizer_colour__footer_widgets_get_css( $colors ) ) ?> |
|
| 58 | - <?php echo esc_html( lsx_customizer_colour__footer_get_css( $colors ) ) ?> |
|
| 56 | + <?php echo esc_html(lsx_customizer_colour__footer_cta_get_css($colors)) ?> |
|
| 57 | + <?php echo esc_html(lsx_customizer_colour__footer_widgets_get_css($colors)) ?> |
|
| 58 | + <?php echo esc_html(lsx_customizer_colour__footer_get_css($colors)) ?> |
|
| 59 | 59 | |
| 60 | - <?php echo esc_html( lsx_customizer_colour__button_get_css( $colors ) ) ?> |
|
| 61 | - <?php echo esc_html( lsx_customizer_colour__button_cta_get_css( $colors ) ) ?> |
|
| 60 | + <?php echo esc_html(lsx_customizer_colour__button_get_css($colors)) ?> |
|
| 61 | + <?php echo esc_html(lsx_customizer_colour__button_cta_get_css($colors)) ?> |
|
| 62 | 62 | </script> |
| 63 | 63 | <?php |
| 64 | 64 | } |
| 65 | -add_action( 'customize_controls_print_footer_scripts', 'lsx_customizer_colour__color_scheme_css_template' ); |
|
| 65 | +add_action('customize_controls_print_footer_scripts', 'lsx_customizer_colour__color_scheme_css_template'); |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Retrieves the current color scheme. |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | function lsx_customizer_colour__get_color_scheme() { |
| 71 | 71 | global $customizer_colour_choices; |
| 72 | 72 | |
| 73 | - $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); |
|
| 73 | + $color_scheme_option = get_theme_mod('color_scheme', 'default'); |
|
| 74 | 74 | $color_schemes = $customizer_colour_choices; |
| 75 | 75 | |
| 76 | - if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { |
|
| 77 | - return $color_schemes[ $color_scheme_option ]['colors']; |
|
| 76 | + if (array_key_exists($color_scheme_option, $color_schemes)) { |
|
| 77 | + return $color_schemes[$color_scheme_option]['colors']; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | return $color_schemes['default']['colors']; |
@@ -83,22 +83,22 @@ discard block |
||
| 83 | 83 | /** |
| 84 | 84 | * Converts a HEX value to RGB. |
| 85 | 85 | */ |
| 86 | -function lsx_customizer_colour__hex2rgb( $color ) { |
|
| 87 | - $color = trim( $color, '#' ); |
|
| 88 | - |
|
| 89 | - if ( strlen( $color ) === 3 ) { |
|
| 90 | - $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) ); |
|
| 91 | - $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) ); |
|
| 92 | - $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) ); |
|
| 93 | - } else if ( strlen( $color ) === 6 ) { |
|
| 94 | - $r = hexdec( substr( $color, 0, 2 ) ); |
|
| 95 | - $g = hexdec( substr( $color, 2, 2 ) ); |
|
| 96 | - $b = hexdec( substr( $color, 4, 2 ) ); |
|
| 86 | +function lsx_customizer_colour__hex2rgb($color) { |
|
| 87 | + $color = trim($color, '#'); |
|
| 88 | + |
|
| 89 | + if (strlen($color) === 3) { |
|
| 90 | + $r = hexdec(substr($color, 0, 1) . substr($color, 0, 1)); |
|
| 91 | + $g = hexdec(substr($color, 1, 1) . substr($color, 1, 1)); |
|
| 92 | + $b = hexdec(substr($color, 2, 1) . substr($color, 2, 1)); |
|
| 93 | + } else if (strlen($color) === 6) { |
|
| 94 | + $r = hexdec(substr($color, 0, 2)); |
|
| 95 | + $g = hexdec(substr($color, 2, 2)); |
|
| 96 | + $b = hexdec(substr($color, 4, 2)); |
|
| 97 | 97 | } else { |
| 98 | 98 | return array(); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - return array( 'red' => $r, 'green' => $g, 'blue' => $b ); |
|
| 101 | + return array('red' => $r, 'green' => $g, 'blue' => $b); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /* ################################################################################# */ |
@@ -109,33 +109,33 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | function lsx_customizer_colour__button_set_theme_mod() { |
| 111 | 111 | $theme_mods = lsx_customizer_colour__button_get_theme_mods(); |
| 112 | - $styles = lsx_customizer_colour__button_get_css( $theme_mods ); |
|
| 112 | + $styles = lsx_customizer_colour__button_get_css($theme_mods); |
|
| 113 | 113 | |
| 114 | - set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles ); |
|
| 114 | + set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles); |
|
| 115 | 115 | } |
| 116 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__button_set_theme_mod' ); |
|
| 117 | -add_action( 'customize_save_after', 'lsx_customizer_colour__button_set_theme_mod' ); |
|
| 116 | +add_action('after_switch_theme', 'lsx_customizer_colour__button_set_theme_mod'); |
|
| 117 | +add_action('customize_save_after', 'lsx_customizer_colour__button_set_theme_mod'); |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * Enqueues front-end CSS for the button. |
| 121 | 121 | */ |
| 122 | 122 | function lsx_customizer_colour__button_css() { |
| 123 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_theme_mod' ); |
|
| 123 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_theme_mod'); |
|
| 124 | 124 | |
| 125 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 125 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 126 | 126 | $theme_mods = lsx_customizer_colour__button_get_theme_mods(); |
| 127 | - $styles = lsx_customizer_colour__button_get_css( $theme_mods ); |
|
| 127 | + $styles = lsx_customizer_colour__button_get_css($theme_mods); |
|
| 128 | 128 | |
| 129 | - if ( false === $styles_from_theme_mod ) { |
|
| 130 | - set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles ); |
|
| 129 | + if (false === $styles_from_theme_mod) { |
|
| 130 | + set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles); |
|
| 131 | 131 | } |
| 132 | 132 | } else { |
| 133 | 133 | $styles = $styles_from_theme_mod; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 136 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 137 | 137 | } |
| 138 | -add_action( 'wp_footer', 'lsx_customizer_colour__button_css', 12 ); |
|
| 138 | +add_action('wp_footer', 'lsx_customizer_colour__button_css', 12); |
|
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | 141 | * Get button CSS theme mods. |
@@ -147,32 +147,32 @@ discard block |
||
| 147 | 147 | $colors = array(); |
| 148 | 148 | $counter = 0; |
| 149 | 149 | |
| 150 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 150 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 151 | 151 | $colors[$key] = $color_scheme[$counter]; |
| 152 | 152 | $counter++; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | return array( |
| 156 | - 'button_background_color' => get_theme_mod( 'button_background_color', $colors['button_background_color'] ), |
|
| 157 | - 'button_background_hover_color' => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ), |
|
| 158 | - 'button_text_color' => get_theme_mod( 'button_text_color', $colors['button_text_color'] ), |
|
| 159 | - 'button_text_color_hover' => get_theme_mod( 'button_text_color_hover', $colors['button_text_color_hover'] ) |
|
| 156 | + 'button_background_color' => get_theme_mod('button_background_color', $colors['button_background_color']), |
|
| 157 | + 'button_background_hover_color' => get_theme_mod('button_background_hover_color', $colors['button_background_hover_color']), |
|
| 158 | + 'button_text_color' => get_theme_mod('button_text_color', $colors['button_text_color']), |
|
| 159 | + 'button_text_color_hover' => get_theme_mod('button_text_color_hover', $colors['button_text_color_hover']) |
|
| 160 | 160 | ); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | 164 | * Returns CSS for the button. |
| 165 | 165 | */ |
| 166 | -function lsx_customizer_colour__button_get_css( $colors ) { |
|
| 166 | +function lsx_customizer_colour__button_get_css($colors) { |
|
| 167 | 167 | global $customizer_colour_names; |
| 168 | 168 | |
| 169 | 169 | $colors_template = array(); |
| 170 | 170 | |
| 171 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 171 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 172 | 172 | $colors_template[$key] = ''; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 175 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 176 | 176 | |
| 177 | 177 | $css = <<<CSS |
| 178 | 178 | /* |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | CSS; |
| 371 | 371 | |
| 372 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button', $css, $colors ); |
|
| 373 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 372 | + $css = apply_filters('lsx_customizer_colour_selectors_button', $css, $colors); |
|
| 373 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 374 | 374 | return $css; |
| 375 | 375 | } |
| 376 | 376 | |
@@ -383,33 +383,33 @@ discard block |
||
| 383 | 383 | */ |
| 384 | 384 | function lsx_customizer_colour__button_cta_set_theme_mod() { |
| 385 | 385 | $theme_mods = lsx_customizer_colour__button_cta_get_theme_mods(); |
| 386 | - $styles = lsx_customizer_colour__button_cta_get_css( $theme_mods ); |
|
| 386 | + $styles = lsx_customizer_colour__button_cta_get_css($theme_mods); |
|
| 387 | 387 | |
| 388 | - set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles ); |
|
| 388 | + set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles); |
|
| 389 | 389 | } |
| 390 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__button_cta_set_theme_mod' ); |
|
| 391 | -add_action( 'customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod' ); |
|
| 390 | +add_action('after_switch_theme', 'lsx_customizer_colour__button_cta_set_theme_mod'); |
|
| 391 | +add_action('customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod'); |
|
| 392 | 392 | |
| 393 | 393 | /** |
| 394 | 394 | * Enqueues front-end CSS for the button cta. |
| 395 | 395 | */ |
| 396 | 396 | function lsx_customizer_colour__button_cta_css() { |
| 397 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod' ); |
|
| 397 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_cta_theme_mod'); |
|
| 398 | 398 | |
| 399 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 399 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 400 | 400 | $theme_mods = lsx_customizer_colour__button_cta_get_theme_mods(); |
| 401 | - $styles = lsx_customizer_colour__button_cta_get_css( $theme_mods ); |
|
| 401 | + $styles = lsx_customizer_colour__button_cta_get_css($theme_mods); |
|
| 402 | 402 | |
| 403 | - if ( false === $styles_from_theme_mod ) { |
|
| 404 | - set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles ); |
|
| 403 | + if (false === $styles_from_theme_mod) { |
|
| 404 | + set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles); |
|
| 405 | 405 | } |
| 406 | 406 | } else { |
| 407 | 407 | $styles = $styles_from_theme_mod; |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 410 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 411 | 411 | } |
| 412 | -add_action( 'wp_footer', 'lsx_customizer_colour__button_cta_css', 12 ); |
|
| 412 | +add_action('wp_footer', 'lsx_customizer_colour__button_cta_css', 12); |
|
| 413 | 413 | |
| 414 | 414 | /** |
| 415 | 415 | * Get button cta CSS theme mods. |
@@ -421,32 +421,32 @@ discard block |
||
| 421 | 421 | $colors = array(); |
| 422 | 422 | $counter = 0; |
| 423 | 423 | |
| 424 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 424 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 425 | 425 | $colors[$key] = $color_scheme[$counter]; |
| 426 | 426 | $counter++; |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | return array( |
| 430 | - 'button_cta_background_color' => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ), |
|
| 431 | - 'button_cta_background_hover_color' => get_theme_mod( 'button_cta_background_hover_color', $colors['button_cta_background_hover_color'] ), |
|
| 432 | - 'button_cta_text_color' => get_theme_mod( 'button_cta_text_color', $colors['button_cta_text_color'] ), |
|
| 433 | - 'button_cta_text_color_hover' => get_theme_mod( 'button_cta_text_color_hover', $colors['button_cta_text_color_hover'] ) |
|
| 430 | + 'button_cta_background_color' => get_theme_mod('button_cta_background_color', $colors['button_cta_background_color']), |
|
| 431 | + 'button_cta_background_hover_color' => get_theme_mod('button_cta_background_hover_color', $colors['button_cta_background_hover_color']), |
|
| 432 | + 'button_cta_text_color' => get_theme_mod('button_cta_text_color', $colors['button_cta_text_color']), |
|
| 433 | + 'button_cta_text_color_hover' => get_theme_mod('button_cta_text_color_hover', $colors['button_cta_text_color_hover']) |
|
| 434 | 434 | ); |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | /** |
| 438 | 438 | * Returns CSS for the button cta. |
| 439 | 439 | */ |
| 440 | -function lsx_customizer_colour__button_cta_get_css( $colors ) { |
|
| 440 | +function lsx_customizer_colour__button_cta_get_css($colors) { |
|
| 441 | 441 | global $customizer_colour_names; |
| 442 | 442 | |
| 443 | 443 | $colors_template = array(); |
| 444 | 444 | |
| 445 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 445 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 446 | 446 | $colors_template[$key] = ''; |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 449 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 450 | 450 | |
| 451 | 451 | $css = <<<CSS |
| 452 | 452 | /* |
@@ -541,8 +541,8 @@ discard block |
||
| 541 | 541 | } |
| 542 | 542 | CSS; |
| 543 | 543 | |
| 544 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button_cta', $css, $colors ); |
|
| 545 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 544 | + $css = apply_filters('lsx_customizer_colour_selectors_button_cta', $css, $colors); |
|
| 545 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 546 | 546 | return $css; |
| 547 | 547 | } |
| 548 | 548 | |
@@ -555,33 +555,33 @@ discard block |
||
| 555 | 555 | */ |
| 556 | 556 | function lsx_customizer_colour__top_menu_set_theme_mod() { |
| 557 | 557 | $theme_mods = lsx_customizer_colour__top_menu_get_theme_mods(); |
| 558 | - $styles = lsx_customizer_colour__top_menu_get_css( $theme_mods ); |
|
| 558 | + $styles = lsx_customizer_colour__top_menu_get_css($theme_mods); |
|
| 559 | 559 | |
| 560 | - set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles ); |
|
| 560 | + set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles); |
|
| 561 | 561 | } |
| 562 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__top_menu_set_theme_mod' ); |
|
| 563 | -add_action( 'customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod' ); |
|
| 562 | +add_action('after_switch_theme', 'lsx_customizer_colour__top_menu_set_theme_mod'); |
|
| 563 | +add_action('customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod'); |
|
| 564 | 564 | |
| 565 | 565 | /** |
| 566 | 566 | * Enqueues front-end CSS for the top menu. |
| 567 | 567 | */ |
| 568 | 568 | function lsx_customizer_colour__top_menu_css() { |
| 569 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod' ); |
|
| 569 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__top_menu_theme_mod'); |
|
| 570 | 570 | |
| 571 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 571 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 572 | 572 | $theme_mods = lsx_customizer_colour__top_menu_get_theme_mods(); |
| 573 | - $styles = lsx_customizer_colour__top_menu_get_css( $theme_mods ); |
|
| 573 | + $styles = lsx_customizer_colour__top_menu_get_css($theme_mods); |
|
| 574 | 574 | |
| 575 | - if ( false === $styles_from_theme_mod ) { |
|
| 576 | - set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles ); |
|
| 575 | + if (false === $styles_from_theme_mod) { |
|
| 576 | + set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles); |
|
| 577 | 577 | } |
| 578 | 578 | } else { |
| 579 | 579 | $styles = $styles_from_theme_mod; |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 582 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 583 | 583 | } |
| 584 | -add_action( 'wp_footer', 'lsx_customizer_colour__top_menu_css', 12 ); |
|
| 584 | +add_action('wp_footer', 'lsx_customizer_colour__top_menu_css', 12); |
|
| 585 | 585 | |
| 586 | 586 | /** |
| 587 | 587 | * Get top menu CSS theme mods. |
@@ -593,31 +593,31 @@ discard block |
||
| 593 | 593 | $colors = array(); |
| 594 | 594 | $counter = 0; |
| 595 | 595 | |
| 596 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 596 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 597 | 597 | $colors[$key] = $color_scheme[$counter]; |
| 598 | 598 | $counter++; |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | return array( |
| 602 | - 'top_menu_background_color' => get_theme_mod( 'top_menu_background_color', $colors['top_menu_background_color'] ), |
|
| 603 | - 'top_menu_text_color' => get_theme_mod( 'top_menu_text_color', $colors['top_menu_text_color'] ), |
|
| 604 | - 'top_menu_text_hover_color' => get_theme_mod( 'top_menu_text_hover_color', $colors['top_menu_text_hover_color'] ) |
|
| 602 | + 'top_menu_background_color' => get_theme_mod('top_menu_background_color', $colors['top_menu_background_color']), |
|
| 603 | + 'top_menu_text_color' => get_theme_mod('top_menu_text_color', $colors['top_menu_text_color']), |
|
| 604 | + 'top_menu_text_hover_color' => get_theme_mod('top_menu_text_hover_color', $colors['top_menu_text_hover_color']) |
|
| 605 | 605 | ); |
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | /** |
| 609 | 609 | * Returns CSS for the top menu. |
| 610 | 610 | */ |
| 611 | -function lsx_customizer_colour__top_menu_get_css( $colors ) { |
|
| 611 | +function lsx_customizer_colour__top_menu_get_css($colors) { |
|
| 612 | 612 | global $customizer_colour_names; |
| 613 | 613 | |
| 614 | 614 | $colors_template = array(); |
| 615 | 615 | |
| 616 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 616 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 617 | 617 | $colors_template[$key] = ''; |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 620 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 621 | 621 | |
| 622 | 622 | $css = <<<CSS |
| 623 | 623 | /* |
@@ -657,8 +657,8 @@ discard block |
||
| 657 | 657 | } |
| 658 | 658 | CSS; |
| 659 | 659 | |
| 660 | - $css = apply_filters( 'lsx_customizer_colour_selectors_top_menu', $css, $colors ); |
|
| 661 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 660 | + $css = apply_filters('lsx_customizer_colour_selectors_top_menu', $css, $colors); |
|
| 661 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 662 | 662 | return $css; |
| 663 | 663 | } |
| 664 | 664 | |
@@ -671,33 +671,33 @@ discard block |
||
| 671 | 671 | */ |
| 672 | 672 | function lsx_customizer_colour__header_set_theme_mod() { |
| 673 | 673 | $theme_mods = lsx_customizer_colour__header_get_theme_mods(); |
| 674 | - $styles = lsx_customizer_colour__header_get_css( $theme_mods ); |
|
| 674 | + $styles = lsx_customizer_colour__header_get_css($theme_mods); |
|
| 675 | 675 | |
| 676 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
| 676 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
| 677 | 677 | } |
| 678 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__header_set_theme_mod' ); |
|
| 679 | -add_action( 'customize_save_after', 'lsx_customizer_colour__header_set_theme_mod' ); |
|
| 678 | +add_action('after_switch_theme', 'lsx_customizer_colour__header_set_theme_mod'); |
|
| 679 | +add_action('customize_save_after', 'lsx_customizer_colour__header_set_theme_mod'); |
|
| 680 | 680 | |
| 681 | 681 | /** |
| 682 | 682 | * Enqueues front-end CSS for the header. |
| 683 | 683 | */ |
| 684 | 684 | function lsx_customizer_colour__header_css() { |
| 685 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__header_theme_mod' ); |
|
| 685 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__header_theme_mod'); |
|
| 686 | 686 | |
| 687 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 687 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 688 | 688 | $theme_mods = lsx_customizer_colour__header_get_theme_mods(); |
| 689 | - $styles = lsx_customizer_colour__header_get_css( $theme_mods ); |
|
| 689 | + $styles = lsx_customizer_colour__header_get_css($theme_mods); |
|
| 690 | 690 | |
| 691 | - if ( false === $styles_from_theme_mod ) { |
|
| 692 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
| 691 | + if (false === $styles_from_theme_mod) { |
|
| 692 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
| 693 | 693 | } |
| 694 | 694 | } else { |
| 695 | 695 | $styles = $styles_from_theme_mod; |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 698 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 699 | 699 | } |
| 700 | -add_action( 'wp_footer', 'lsx_customizer_colour__header_css', 12 ); |
|
| 700 | +add_action('wp_footer', 'lsx_customizer_colour__header_css', 12); |
|
| 701 | 701 | |
| 702 | 702 | /** |
| 703 | 703 | * Get header CSS theme mods. |
@@ -709,32 +709,32 @@ discard block |
||
| 709 | 709 | $colors = array(); |
| 710 | 710 | $counter = 0; |
| 711 | 711 | |
| 712 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 712 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 713 | 713 | $colors[$key] = $color_scheme[$counter]; |
| 714 | 714 | $counter++; |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | return array( |
| 718 | - 'header_background_color' => get_theme_mod( 'header_background_color', $colors['header_background_color'] ), |
|
| 719 | - 'header_title_color' => get_theme_mod( 'header_title_color', $colors['header_title_color'] ), |
|
| 720 | - 'header_title_hover_color' => get_theme_mod( 'header_title_hover_color', $colors['header_title_hover_color'] ), |
|
| 721 | - 'header_description_color' => get_theme_mod( 'header_description_color', $colors['header_description_color'] ) |
|
| 718 | + 'header_background_color' => get_theme_mod('header_background_color', $colors['header_background_color']), |
|
| 719 | + 'header_title_color' => get_theme_mod('header_title_color', $colors['header_title_color']), |
|
| 720 | + 'header_title_hover_color' => get_theme_mod('header_title_hover_color', $colors['header_title_hover_color']), |
|
| 721 | + 'header_description_color' => get_theme_mod('header_description_color', $colors['header_description_color']) |
|
| 722 | 722 | ); |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | /** |
| 726 | 726 | * Returns CSS for the header. |
| 727 | 727 | */ |
| 728 | -function lsx_customizer_colour__header_get_css( $colors ) { |
|
| 728 | +function lsx_customizer_colour__header_get_css($colors) { |
|
| 729 | 729 | global $customizer_colour_names; |
| 730 | 730 | |
| 731 | 731 | $colors_template = array(); |
| 732 | 732 | |
| 733 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 733 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 734 | 734 | $colors_template[$key] = ''; |
| 735 | 735 | } |
| 736 | 736 | |
| 737 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 737 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 738 | 738 | |
| 739 | 739 | $css = <<<CSS |
| 740 | 740 | /* |
@@ -771,8 +771,8 @@ discard block |
||
| 771 | 771 | } |
| 772 | 772 | CSS; |
| 773 | 773 | |
| 774 | - $css = apply_filters( 'lsx_customizer_colour_selectors_header', $css, $colors ); |
|
| 775 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 774 | + $css = apply_filters('lsx_customizer_colour_selectors_header', $css, $colors); |
|
| 775 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 776 | 776 | return $css; |
| 777 | 777 | } |
| 778 | 778 | |
@@ -785,33 +785,33 @@ discard block |
||
| 785 | 785 | */ |
| 786 | 786 | function lsx_customizer_colour__main_menu_set_theme_mod() { |
| 787 | 787 | $theme_mods = lsx_customizer_colour__main_menu_get_theme_mods(); |
| 788 | - $styles = lsx_customizer_colour__main_menu_get_css( $theme_mods ); |
|
| 788 | + $styles = lsx_customizer_colour__main_menu_get_css($theme_mods); |
|
| 789 | 789 | |
| 790 | - set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles ); |
|
| 790 | + set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles); |
|
| 791 | 791 | } |
| 792 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__main_menu_set_theme_mod' ); |
|
| 793 | -add_action( 'customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod' ); |
|
| 792 | +add_action('after_switch_theme', 'lsx_customizer_colour__main_menu_set_theme_mod'); |
|
| 793 | +add_action('customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod'); |
|
| 794 | 794 | |
| 795 | 795 | /** |
| 796 | 796 | * Enqueues front-end CSS for the main menu. |
| 797 | 797 | */ |
| 798 | 798 | function lsx_customizer_colour__main_menu_css() { |
| 799 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod' ); |
|
| 799 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__main_menu_theme_mod'); |
|
| 800 | 800 | |
| 801 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 801 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 802 | 802 | $theme_mods = lsx_customizer_colour__main_menu_get_theme_mods(); |
| 803 | - $styles = lsx_customizer_colour__main_menu_get_css( $theme_mods ); |
|
| 803 | + $styles = lsx_customizer_colour__main_menu_get_css($theme_mods); |
|
| 804 | 804 | |
| 805 | - if ( false === $styles_from_theme_mod ) { |
|
| 806 | - set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles ); |
|
| 805 | + if (false === $styles_from_theme_mod) { |
|
| 806 | + set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles); |
|
| 807 | 807 | } |
| 808 | 808 | } else { |
| 809 | 809 | $styles = $styles_from_theme_mod; |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 812 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 813 | 813 | } |
| 814 | -add_action( 'wp_footer', 'lsx_customizer_colour__main_menu_css', 12 ); |
|
| 814 | +add_action('wp_footer', 'lsx_customizer_colour__main_menu_css', 12); |
|
| 815 | 815 | |
| 816 | 816 | /** |
| 817 | 817 | * Get main menu CSS theme mods. |
@@ -823,33 +823,33 @@ discard block |
||
| 823 | 823 | $colors = array(); |
| 824 | 824 | $counter = 0; |
| 825 | 825 | |
| 826 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 826 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 827 | 827 | $colors[$key] = $color_scheme[$counter]; |
| 828 | 828 | $counter++; |
| 829 | 829 | } |
| 830 | 830 | |
| 831 | 831 | return array( |
| 832 | - 'main_menu_background_hover1_color' => get_theme_mod( 'main_menu_background_hover1_color', $colors['main_menu_background_hover1_color'] ), |
|
| 833 | - 'main_menu_background_hover2_color' => get_theme_mod( 'main_menu_background_hover2_color', $colors['main_menu_background_hover2_color'] ), |
|
| 834 | - 'main_menu_text_color' => get_theme_mod( 'main_menu_text_color', $colors['main_menu_text_color'] ), |
|
| 835 | - 'main_menu_text_hover1_color' => get_theme_mod( 'main_menu_text_hover1_color', $colors['main_menu_text_hover1_color'] ), |
|
| 836 | - 'main_menu_text_hover2_color' => get_theme_mod( 'main_menu_text_hover2_color', $colors['main_menu_text_hover2_color'] ) |
|
| 832 | + 'main_menu_background_hover1_color' => get_theme_mod('main_menu_background_hover1_color', $colors['main_menu_background_hover1_color']), |
|
| 833 | + 'main_menu_background_hover2_color' => get_theme_mod('main_menu_background_hover2_color', $colors['main_menu_background_hover2_color']), |
|
| 834 | + 'main_menu_text_color' => get_theme_mod('main_menu_text_color', $colors['main_menu_text_color']), |
|
| 835 | + 'main_menu_text_hover1_color' => get_theme_mod('main_menu_text_hover1_color', $colors['main_menu_text_hover1_color']), |
|
| 836 | + 'main_menu_text_hover2_color' => get_theme_mod('main_menu_text_hover2_color', $colors['main_menu_text_hover2_color']) |
|
| 837 | 837 | ); |
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | /** |
| 841 | 841 | * Returns CSS for the main menu. |
| 842 | 842 | */ |
| 843 | -function lsx_customizer_colour__main_menu_get_css( $colors ) { |
|
| 843 | +function lsx_customizer_colour__main_menu_get_css($colors) { |
|
| 844 | 844 | global $customizer_colour_names; |
| 845 | 845 | |
| 846 | 846 | $colors_template = array(); |
| 847 | 847 | |
| 848 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 848 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 849 | 849 | $colors_template[$key] = ''; |
| 850 | 850 | } |
| 851 | 851 | |
| 852 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 852 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 853 | 853 | |
| 854 | 854 | $css = <<<CSS |
| 855 | 855 | /* |
@@ -962,8 +962,8 @@ discard block |
||
| 962 | 962 | } |
| 963 | 963 | CSS; |
| 964 | 964 | |
| 965 | - $css = apply_filters( 'lsx_customizer_colour_selectors_main_menu', $css, $colors ); |
|
| 966 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 965 | + $css = apply_filters('lsx_customizer_colour_selectors_main_menu', $css, $colors); |
|
| 966 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 967 | 967 | return $css; |
| 968 | 968 | } |
| 969 | 969 | |
@@ -976,33 +976,33 @@ discard block |
||
| 976 | 976 | */ |
| 977 | 977 | function lsx_customizer_colour__banner_set_theme_mod() { |
| 978 | 978 | $theme_mods = lsx_customizer_colour__banner_get_theme_mods(); |
| 979 | - $styles = lsx_customizer_colour__banner_get_css( $theme_mods ); |
|
| 979 | + $styles = lsx_customizer_colour__banner_get_css($theme_mods); |
|
| 980 | 980 | |
| 981 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
| 981 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
| 982 | 982 | } |
| 983 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__banner_set_theme_mod' ); |
|
| 984 | -add_action( 'customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod' ); |
|
| 983 | +add_action('after_switch_theme', 'lsx_customizer_colour__banner_set_theme_mod'); |
|
| 984 | +add_action('customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod'); |
|
| 985 | 985 | |
| 986 | 986 | /** |
| 987 | 987 | * Enqueues front-end CSS for the banner. |
| 988 | 988 | */ |
| 989 | 989 | function lsx_customizer_colour__banner_css() { |
| 990 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__banner_theme_mod' ); |
|
| 990 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__banner_theme_mod'); |
|
| 991 | 991 | |
| 992 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 992 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 993 | 993 | $theme_mods = lsx_customizer_colour__banner_get_theme_mods(); |
| 994 | - $styles = lsx_customizer_colour__banner_get_css( $theme_mods ); |
|
| 994 | + $styles = lsx_customizer_colour__banner_get_css($theme_mods); |
|
| 995 | 995 | |
| 996 | - if ( false === $styles_from_theme_mod ) { |
|
| 997 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
| 996 | + if (false === $styles_from_theme_mod) { |
|
| 997 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
| 998 | 998 | } |
| 999 | 999 | } else { |
| 1000 | 1000 | $styles = $styles_from_theme_mod; |
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1003 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1004 | 1004 | } |
| 1005 | -add_action( 'wp_footer', 'lsx_customizer_colour__banner_css', 12 ); |
|
| 1005 | +add_action('wp_footer', 'lsx_customizer_colour__banner_css', 12); |
|
| 1006 | 1006 | |
| 1007 | 1007 | /** |
| 1008 | 1008 | * Get banner CSS theme mods. |
@@ -1014,31 +1014,31 @@ discard block |
||
| 1014 | 1014 | $colors = array(); |
| 1015 | 1015 | $counter = 0; |
| 1016 | 1016 | |
| 1017 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1017 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1018 | 1018 | $colors[$key] = $color_scheme[$counter]; |
| 1019 | 1019 | $counter++; |
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | 1022 | return array( |
| 1023 | - 'banner_background_color' => get_theme_mod( 'banner_background_color', $colors['banner_background_color'] ), |
|
| 1024 | - 'banner_text_color' => get_theme_mod( 'banner_text_color', $colors['banner_text_color'] ), |
|
| 1025 | - 'banner_text_image_color' => get_theme_mod( 'banner_text_image_color', $colors['banner_text_image_color'] ) |
|
| 1023 | + 'banner_background_color' => get_theme_mod('banner_background_color', $colors['banner_background_color']), |
|
| 1024 | + 'banner_text_color' => get_theme_mod('banner_text_color', $colors['banner_text_color']), |
|
| 1025 | + 'banner_text_image_color' => get_theme_mod('banner_text_image_color', $colors['banner_text_image_color']) |
|
| 1026 | 1026 | ); |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | 1029 | /** |
| 1030 | 1030 | * Returns CSS for the banner. |
| 1031 | 1031 | */ |
| 1032 | -function lsx_customizer_colour__banner_get_css( $colors ) { |
|
| 1032 | +function lsx_customizer_colour__banner_get_css($colors) { |
|
| 1033 | 1033 | global $customizer_colour_names; |
| 1034 | 1034 | |
| 1035 | 1035 | $colors_template = array(); |
| 1036 | 1036 | |
| 1037 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1037 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1038 | 1038 | $colors_template[$key] = ''; |
| 1039 | 1039 | } |
| 1040 | 1040 | |
| 1041 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1041 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1042 | 1042 | |
| 1043 | 1043 | $css = <<<CSS |
| 1044 | 1044 | /* |
@@ -1067,8 +1067,8 @@ discard block |
||
| 1067 | 1067 | } |
| 1068 | 1068 | CSS; |
| 1069 | 1069 | |
| 1070 | - $css = apply_filters( 'lsx_customizer_colour_selectors_banner', $css, $colors ); |
|
| 1071 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1070 | + $css = apply_filters('lsx_customizer_colour_selectors_banner', $css, $colors); |
|
| 1071 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1072 | 1072 | return $css; |
| 1073 | 1073 | } |
| 1074 | 1074 | |
@@ -1081,33 +1081,33 @@ discard block |
||
| 1081 | 1081 | */ |
| 1082 | 1082 | function lsx_customizer_colour__body_set_theme_mod() { |
| 1083 | 1083 | $theme_mods = lsx_customizer_colour__body_get_theme_mods(); |
| 1084 | - $styles = lsx_customizer_colour__body_get_css( $theme_mods ); |
|
| 1084 | + $styles = lsx_customizer_colour__body_get_css($theme_mods); |
|
| 1085 | 1085 | |
| 1086 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
| 1086 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
| 1087 | 1087 | } |
| 1088 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__body_set_theme_mod' ); |
|
| 1089 | -add_action( 'customize_save_after', 'lsx_customizer_colour__body_set_theme_mod' ); |
|
| 1088 | +add_action('after_switch_theme', 'lsx_customizer_colour__body_set_theme_mod'); |
|
| 1089 | +add_action('customize_save_after', 'lsx_customizer_colour__body_set_theme_mod'); |
|
| 1090 | 1090 | |
| 1091 | 1091 | /** |
| 1092 | 1092 | * Enqueues front-end CSS for the body. |
| 1093 | 1093 | */ |
| 1094 | 1094 | function lsx_customizer_colour__body_css() { |
| 1095 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__body_theme_mod' ); |
|
| 1095 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__body_theme_mod'); |
|
| 1096 | 1096 | |
| 1097 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1097 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1098 | 1098 | $theme_mods = lsx_customizer_colour__body_get_theme_mods(); |
| 1099 | - $styles = lsx_customizer_colour__body_get_css( $theme_mods ); |
|
| 1099 | + $styles = lsx_customizer_colour__body_get_css($theme_mods); |
|
| 1100 | 1100 | |
| 1101 | - if ( false === $styles_from_theme_mod ) { |
|
| 1102 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
| 1101 | + if (false === $styles_from_theme_mod) { |
|
| 1102 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
| 1103 | 1103 | } |
| 1104 | 1104 | } else { |
| 1105 | 1105 | $styles = $styles_from_theme_mod; |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1108 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1109 | 1109 | } |
| 1110 | -add_action( 'wp_footer', 'lsx_customizer_colour__body_css', 12 ); |
|
| 1110 | +add_action('wp_footer', 'lsx_customizer_colour__body_css', 12); |
|
| 1111 | 1111 | |
| 1112 | 1112 | /** |
| 1113 | 1113 | * Get body CSS theme mods. |
@@ -1119,41 +1119,41 @@ discard block |
||
| 1119 | 1119 | $colors = array(); |
| 1120 | 1120 | $counter = 0; |
| 1121 | 1121 | |
| 1122 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1122 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1123 | 1123 | $colors[$key] = $color_scheme[$counter]; |
| 1124 | 1124 | $counter++; |
| 1125 | 1125 | } |
| 1126 | 1126 | |
| 1127 | 1127 | return array( |
| 1128 | - 'body_background_color' => get_theme_mod( 'body_background_color', $colors['body_background_color'] ), |
|
| 1129 | - 'body_line_color' => get_theme_mod( 'body_line_color', $colors['body_line_color'] ), |
|
| 1130 | - 'body_text_heading_color' => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ), |
|
| 1131 | - 'body_text_color' => get_theme_mod( 'body_text_color', $colors['body_text_color'] ), |
|
| 1132 | - 'body_link_color' => get_theme_mod( 'body_link_color', $colors['body_link_color'] ), |
|
| 1133 | - 'body_link_hover_color' => get_theme_mod( 'body_link_hover_color', $colors['body_link_hover_color'] ), |
|
| 1134 | - |
|
| 1135 | - 'body_section_full_background_color' => get_theme_mod( 'body_section_full_background_color', $colors['body_section_full_background_color'] ), |
|
| 1136 | - 'body_section_full_text_color' => get_theme_mod( 'body_section_full_text_color', $colors['body_section_full_text_color'] ), |
|
| 1137 | - 'body_section_full_cta_background_color' => get_theme_mod( 'body_section_full_cta_background_color', $colors['body_section_full_cta_background_color'] ), |
|
| 1138 | - 'body_section_full_cta_text_color' => get_theme_mod( 'body_section_full_cta_text_color', $colors['body_section_full_cta_text_color'] ) |
|
| 1128 | + 'body_background_color' => get_theme_mod('body_background_color', $colors['body_background_color']), |
|
| 1129 | + 'body_line_color' => get_theme_mod('body_line_color', $colors['body_line_color']), |
|
| 1130 | + 'body_text_heading_color' => get_theme_mod('body_text_heading_color', $colors['body_text_heading_color']), |
|
| 1131 | + 'body_text_color' => get_theme_mod('body_text_color', $colors['body_text_color']), |
|
| 1132 | + 'body_link_color' => get_theme_mod('body_link_color', $colors['body_link_color']), |
|
| 1133 | + 'body_link_hover_color' => get_theme_mod('body_link_hover_color', $colors['body_link_hover_color']), |
|
| 1134 | + |
|
| 1135 | + 'body_section_full_background_color' => get_theme_mod('body_section_full_background_color', $colors['body_section_full_background_color']), |
|
| 1136 | + 'body_section_full_text_color' => get_theme_mod('body_section_full_text_color', $colors['body_section_full_text_color']), |
|
| 1137 | + 'body_section_full_cta_background_color' => get_theme_mod('body_section_full_cta_background_color', $colors['body_section_full_cta_background_color']), |
|
| 1138 | + 'body_section_full_cta_text_color' => get_theme_mod('body_section_full_cta_text_color', $colors['body_section_full_cta_text_color']) |
|
| 1139 | 1139 | ); |
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | 1142 | /** |
| 1143 | 1143 | * Returns CSS for the body. |
| 1144 | 1144 | */ |
| 1145 | -function lsx_customizer_colour__body_get_css( $colors ) { |
|
| 1145 | +function lsx_customizer_colour__body_get_css($colors) { |
|
| 1146 | 1146 | global $customizer_colour_names; |
| 1147 | 1147 | |
| 1148 | 1148 | $colors_template = array(); |
| 1149 | 1149 | |
| 1150 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1150 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1151 | 1151 | $colors_template[$key] = ''; |
| 1152 | 1152 | } |
| 1153 | 1153 | |
| 1154 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1154 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1155 | 1155 | |
| 1156 | - $rgb = lsx_customizer_colour__hex2rgb( $colors['body_line_color'] ); |
|
| 1156 | + $rgb = lsx_customizer_colour__hex2rgb($colors['body_line_color']); |
|
| 1157 | 1157 | $colors['body_line_color_rgba'] = "rgba({$rgb['red']}, {$rgb['green']}, {$rgb['blue']}, 0.5)"; |
| 1158 | 1158 | |
| 1159 | 1159 | $css = <<<CSS |
@@ -1418,8 +1418,8 @@ discard block |
||
| 1418 | 1418 | } |
| 1419 | 1419 | CSS; |
| 1420 | 1420 | |
| 1421 | - $css = apply_filters( 'lsx_customizer_colour_selectors_body', $css, $colors ); |
|
| 1422 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1421 | + $css = apply_filters('lsx_customizer_colour_selectors_body', $css, $colors); |
|
| 1422 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1423 | 1423 | return $css; |
| 1424 | 1424 | } |
| 1425 | 1425 | |
@@ -1432,33 +1432,33 @@ discard block |
||
| 1432 | 1432 | */ |
| 1433 | 1433 | function lsx_customizer_colour__footer_cta_set_theme_mod() { |
| 1434 | 1434 | $theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods(); |
| 1435 | - $styles = lsx_customizer_colour__footer_cta_get_css( $theme_mods ); |
|
| 1435 | + $styles = lsx_customizer_colour__footer_cta_get_css($theme_mods); |
|
| 1436 | 1436 | |
| 1437 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
| 1437 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
| 1438 | 1438 | } |
| 1439 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_cta_set_theme_mod' ); |
|
| 1440 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod' ); |
|
| 1439 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_cta_set_theme_mod'); |
|
| 1440 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod'); |
|
| 1441 | 1441 | |
| 1442 | 1442 | /** |
| 1443 | 1443 | * Enqueues front-end CSS for the footer cta. |
| 1444 | 1444 | */ |
| 1445 | 1445 | function lsx_customizer_colour__footer_cta_css() { |
| 1446 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod' ); |
|
| 1446 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_cta_theme_mod'); |
|
| 1447 | 1447 | |
| 1448 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1448 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1449 | 1449 | $theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods(); |
| 1450 | - $styles = lsx_customizer_colour__footer_cta_get_css( $theme_mods ); |
|
| 1450 | + $styles = lsx_customizer_colour__footer_cta_get_css($theme_mods); |
|
| 1451 | 1451 | |
| 1452 | - if ( false === $styles_from_theme_mod ) { |
|
| 1453 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
| 1452 | + if (false === $styles_from_theme_mod) { |
|
| 1453 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
| 1454 | 1454 | } |
| 1455 | 1455 | } else { |
| 1456 | 1456 | $styles = $styles_from_theme_mod; |
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1459 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1460 | 1460 | } |
| 1461 | -add_action( 'wp_footer', 'lsx_customizer_colour__footer_cta_css', 12 ); |
|
| 1461 | +add_action('wp_footer', 'lsx_customizer_colour__footer_cta_css', 12); |
|
| 1462 | 1462 | |
| 1463 | 1463 | /** |
| 1464 | 1464 | * Get footer cta CSS theme mods. |
@@ -1470,32 +1470,32 @@ discard block |
||
| 1470 | 1470 | $colors = array(); |
| 1471 | 1471 | $counter = 0; |
| 1472 | 1472 | |
| 1473 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1473 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1474 | 1474 | $colors[$key] = $color_scheme[$counter]; |
| 1475 | 1475 | $counter++; |
| 1476 | 1476 | } |
| 1477 | 1477 | |
| 1478 | 1478 | return array( |
| 1479 | - 'footer_cta_background_color' => get_theme_mod( 'footer_cta_background_color', $colors['footer_cta_background_color'] ), |
|
| 1480 | - 'footer_cta_text_color' => get_theme_mod( 'footer_cta_text_color', $colors['footer_cta_text_color'] ), |
|
| 1481 | - 'footer_cta_link_color' => get_theme_mod( 'footer_cta_link_color', $colors['footer_cta_link_color'] ), |
|
| 1482 | - 'footer_cta_link_hover_color' => get_theme_mod( 'footer_cta_link_hover_color', $colors['footer_cta_link_hover_color'] ) |
|
| 1479 | + 'footer_cta_background_color' => get_theme_mod('footer_cta_background_color', $colors['footer_cta_background_color']), |
|
| 1480 | + 'footer_cta_text_color' => get_theme_mod('footer_cta_text_color', $colors['footer_cta_text_color']), |
|
| 1481 | + 'footer_cta_link_color' => get_theme_mod('footer_cta_link_color', $colors['footer_cta_link_color']), |
|
| 1482 | + 'footer_cta_link_hover_color' => get_theme_mod('footer_cta_link_hover_color', $colors['footer_cta_link_hover_color']) |
|
| 1483 | 1483 | ); |
| 1484 | 1484 | } |
| 1485 | 1485 | |
| 1486 | 1486 | /** |
| 1487 | 1487 | * Returns CSS for the footer cta. |
| 1488 | 1488 | */ |
| 1489 | -function lsx_customizer_colour__footer_cta_get_css( $colors ) { |
|
| 1489 | +function lsx_customizer_colour__footer_cta_get_css($colors) { |
|
| 1490 | 1490 | global $customizer_colour_names; |
| 1491 | 1491 | |
| 1492 | 1492 | $colors_template = array(); |
| 1493 | 1493 | |
| 1494 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1494 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1495 | 1495 | $colors_template[$key] = ''; |
| 1496 | 1496 | } |
| 1497 | 1497 | |
| 1498 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1498 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1499 | 1499 | |
| 1500 | 1500 | $css = <<<CSS |
| 1501 | 1501 | /* |
@@ -1530,8 +1530,8 @@ discard block |
||
| 1530 | 1530 | } |
| 1531 | 1531 | CSS; |
| 1532 | 1532 | |
| 1533 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_cta', $css, $colors ); |
|
| 1534 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1533 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_cta', $css, $colors); |
|
| 1534 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1535 | 1535 | return $css; |
| 1536 | 1536 | } |
| 1537 | 1537 | |
@@ -1543,33 +1543,33 @@ discard block |
||
| 1543 | 1543 | */ |
| 1544 | 1544 | function lsx_customizer_colour__footer_widgets_set_theme_mod() { |
| 1545 | 1545 | $theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods(); |
| 1546 | - $styles = lsx_customizer_colour__footer_widgets_get_css( $theme_mods ); |
|
| 1546 | + $styles = lsx_customizer_colour__footer_widgets_get_css($theme_mods); |
|
| 1547 | 1547 | |
| 1548 | - set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles ); |
|
| 1548 | + set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles); |
|
| 1549 | 1549 | } |
| 1550 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_widgets_set_theme_mod' ); |
|
| 1551 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod' ); |
|
| 1550 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_widgets_set_theme_mod'); |
|
| 1551 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod'); |
|
| 1552 | 1552 | |
| 1553 | 1553 | /** |
| 1554 | 1554 | * Enqueues front-end CSS for the footer widgets. |
| 1555 | 1555 | */ |
| 1556 | 1556 | function lsx_customizer_colour__footer_widgets_css() { |
| 1557 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod' ); |
|
| 1557 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod'); |
|
| 1558 | 1558 | |
| 1559 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1559 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1560 | 1560 | $theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods(); |
| 1561 | - $styles = lsx_customizer_colour__footer_widgets_get_css( $theme_mods ); |
|
| 1561 | + $styles = lsx_customizer_colour__footer_widgets_get_css($theme_mods); |
|
| 1562 | 1562 | |
| 1563 | - if ( false === $styles_from_theme_mod ) { |
|
| 1564 | - set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles ); |
|
| 1563 | + if (false === $styles_from_theme_mod) { |
|
| 1564 | + set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles); |
|
| 1565 | 1565 | } |
| 1566 | 1566 | } else { |
| 1567 | 1567 | $styles = $styles_from_theme_mod; |
| 1568 | 1568 | } |
| 1569 | 1569 | |
| 1570 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1570 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1571 | 1571 | } |
| 1572 | -add_action( 'wp_footer', 'lsx_customizer_colour__footer_widgets_css', 12 ); |
|
| 1572 | +add_action('wp_footer', 'lsx_customizer_colour__footer_widgets_css', 12); |
|
| 1573 | 1573 | |
| 1574 | 1574 | /** |
| 1575 | 1575 | * Get footer widgets CSS theme mods. |
@@ -1581,32 +1581,32 @@ discard block |
||
| 1581 | 1581 | $colors = array(); |
| 1582 | 1582 | $counter = 0; |
| 1583 | 1583 | |
| 1584 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1584 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1585 | 1585 | $colors[$key] = $color_scheme[$counter]; |
| 1586 | 1586 | $counter++; |
| 1587 | 1587 | } |
| 1588 | 1588 | |
| 1589 | 1589 | return array( |
| 1590 | - 'footer_widgets_background_color' => get_theme_mod( 'footer_widgets_background_color', $colors['footer_widgets_background_color'] ), |
|
| 1591 | - 'footer_widgets_text_color' => get_theme_mod( 'footer_widgets_text_color', $colors['footer_widgets_text_color'] ), |
|
| 1592 | - 'footer_widgets_link_color' => get_theme_mod( 'footer_widgets_link_color', $colors['footer_widgets_link_color'] ), |
|
| 1593 | - 'footer_widgets_link_hover_color' => get_theme_mod( 'footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color'] ) |
|
| 1590 | + 'footer_widgets_background_color' => get_theme_mod('footer_widgets_background_color', $colors['footer_widgets_background_color']), |
|
| 1591 | + 'footer_widgets_text_color' => get_theme_mod('footer_widgets_text_color', $colors['footer_widgets_text_color']), |
|
| 1592 | + 'footer_widgets_link_color' => get_theme_mod('footer_widgets_link_color', $colors['footer_widgets_link_color']), |
|
| 1593 | + 'footer_widgets_link_hover_color' => get_theme_mod('footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color']) |
|
| 1594 | 1594 | ); |
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | 1597 | /** |
| 1598 | 1598 | * Returns CSS for the footer widgets. |
| 1599 | 1599 | */ |
| 1600 | -function lsx_customizer_colour__footer_widgets_get_css( $colors ) { |
|
| 1600 | +function lsx_customizer_colour__footer_widgets_get_css($colors) { |
|
| 1601 | 1601 | global $customizer_colour_names; |
| 1602 | 1602 | |
| 1603 | 1603 | $colors_template = array(); |
| 1604 | 1604 | |
| 1605 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1605 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1606 | 1606 | $colors_template[$key] = ''; |
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1609 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1610 | 1610 | |
| 1611 | 1611 | $css = <<<CSS |
| 1612 | 1612 | /* |
@@ -1645,8 +1645,8 @@ discard block |
||
| 1645 | 1645 | } |
| 1646 | 1646 | CSS; |
| 1647 | 1647 | |
| 1648 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_widgets', $css, $colors ); |
|
| 1649 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1648 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_widgets', $css, $colors); |
|
| 1649 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1650 | 1650 | return $css; |
| 1651 | 1651 | } |
| 1652 | 1652 | |
@@ -1658,33 +1658,33 @@ discard block |
||
| 1658 | 1658 | */ |
| 1659 | 1659 | function lsx_customizer_colour__footer_set_theme_mod() { |
| 1660 | 1660 | $theme_mods = lsx_customizer_colour__footer_get_theme_mods(); |
| 1661 | - $styles = lsx_customizer_colour__footer_get_css( $theme_mods ); |
|
| 1661 | + $styles = lsx_customizer_colour__footer_get_css($theme_mods); |
|
| 1662 | 1662 | |
| 1663 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
| 1663 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
| 1664 | 1664 | } |
| 1665 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_set_theme_mod' ); |
|
| 1666 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod' ); |
|
| 1665 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_set_theme_mod'); |
|
| 1666 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod'); |
|
| 1667 | 1667 | |
| 1668 | 1668 | /** |
| 1669 | 1669 | * Enqueues front-end CSS for the footer. |
| 1670 | 1670 | */ |
| 1671 | 1671 | function lsx_customizer_colour__footer_css() { |
| 1672 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_theme_mod' ); |
|
| 1672 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_theme_mod'); |
|
| 1673 | 1673 | |
| 1674 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1674 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1675 | 1675 | $theme_mods = lsx_customizer_colour__footer_get_theme_mods(); |
| 1676 | - $styles = lsx_customizer_colour__footer_get_css( $theme_mods ); |
|
| 1676 | + $styles = lsx_customizer_colour__footer_get_css($theme_mods); |
|
| 1677 | 1677 | |
| 1678 | - if ( false === $styles_from_theme_mod ) { |
|
| 1679 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
| 1678 | + if (false === $styles_from_theme_mod) { |
|
| 1679 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
| 1680 | 1680 | } |
| 1681 | 1681 | } else { |
| 1682 | 1682 | $styles = $styles_from_theme_mod; |
| 1683 | 1683 | } |
| 1684 | 1684 | |
| 1685 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1685 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1686 | 1686 | } |
| 1687 | -add_action( 'wp_footer', 'lsx_customizer_colour__footer_css', 12 ); |
|
| 1687 | +add_action('wp_footer', 'lsx_customizer_colour__footer_css', 12); |
|
| 1688 | 1688 | |
| 1689 | 1689 | /** |
| 1690 | 1690 | * Get footer CSS theme mods. |
@@ -1696,32 +1696,32 @@ discard block |
||
| 1696 | 1696 | $colors = array(); |
| 1697 | 1697 | $counter = 0; |
| 1698 | 1698 | |
| 1699 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1699 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1700 | 1700 | $colors[$key] = $color_scheme[$counter]; |
| 1701 | 1701 | $counter++; |
| 1702 | 1702 | } |
| 1703 | 1703 | |
| 1704 | 1704 | return array( |
| 1705 | - 'footer_background_color' => get_theme_mod( 'footer_background_color', $colors['footer_background_color'] ), |
|
| 1706 | - 'footer_text_color' => get_theme_mod( 'footer_text_color', $colors['footer_text_color'] ), |
|
| 1707 | - 'footer_link_color' => get_theme_mod( 'footer_link_color', $colors['footer_link_color'] ), |
|
| 1708 | - 'footer_link_hover_color' => get_theme_mod( 'footer_link_hover_color', $colors['footer_link_hover_color'] ) |
|
| 1705 | + 'footer_background_color' => get_theme_mod('footer_background_color', $colors['footer_background_color']), |
|
| 1706 | + 'footer_text_color' => get_theme_mod('footer_text_color', $colors['footer_text_color']), |
|
| 1707 | + 'footer_link_color' => get_theme_mod('footer_link_color', $colors['footer_link_color']), |
|
| 1708 | + 'footer_link_hover_color' => get_theme_mod('footer_link_hover_color', $colors['footer_link_hover_color']) |
|
| 1709 | 1709 | ); |
| 1710 | 1710 | } |
| 1711 | 1711 | |
| 1712 | 1712 | /** |
| 1713 | 1713 | * Returns CSS for the footer. |
| 1714 | 1714 | */ |
| 1715 | -function lsx_customizer_colour__footer_get_css( $colors ) { |
|
| 1715 | +function lsx_customizer_colour__footer_get_css($colors) { |
|
| 1716 | 1716 | global $customizer_colour_names; |
| 1717 | 1717 | |
| 1718 | 1718 | $colors_template = array(); |
| 1719 | 1719 | |
| 1720 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1720 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1721 | 1721 | $colors_template[$key] = ''; |
| 1722 | 1722 | } |
| 1723 | 1723 | |
| 1724 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1724 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1725 | 1725 | |
| 1726 | 1726 | $css = <<<CSS |
| 1727 | 1727 | /* |
@@ -1761,8 +1761,8 @@ discard block |
||
| 1761 | 1761 | } |
| 1762 | 1762 | CSS; |
| 1763 | 1763 | |
| 1764 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer', $css, $colors ); |
|
| 1765 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1764 | + $css = apply_filters('lsx_customizer_colour_selectors_footer', $css, $colors); |
|
| 1765 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1766 | 1766 | return $css; |
| 1767 | 1767 | } |
| 1768 | 1768 | |
@@ -1774,7 +1774,7 @@ discard block |
||
| 1774 | 1774 | * Customize Colour Control Class |
| 1775 | 1775 | */ |
| 1776 | 1776 | |
| 1777 | -if ( ! class_exists( 'WP_Customize_Control' ) ) { |
|
| 1777 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 1778 | 1778 | return; |
| 1779 | 1779 | } |
| 1780 | 1780 | |
@@ -1784,37 +1784,37 @@ discard block |
||
| 1784 | 1784 | * Enqueue control related scripts/styles. |
| 1785 | 1785 | */ |
| 1786 | 1786 | public function enqueue() { |
| 1787 | - wp_enqueue_script( 'lsx-colour-control', get_template_directory_uri() .'/js/customizer-colour.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), null, true ); |
|
| 1788 | - wp_localize_script( 'lsx-colour-control', 'colorScheme', $this->choices ); |
|
| 1787 | + wp_enqueue_script('lsx-colour-control', get_template_directory_uri() . '/js/customizer-colour.js', array('customize-controls', 'iris', 'underscore', 'wp-util'), null, true); |
|
| 1788 | + wp_localize_script('lsx-colour-control', 'colorScheme', $this->choices); |
|
| 1789 | 1789 | |
| 1790 | 1790 | global $customizer_colour_names; |
| 1791 | 1791 | $colors = array(); |
| 1792 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1792 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1793 | 1793 | $colors[] = $key; |
| 1794 | 1794 | } |
| 1795 | - wp_localize_script( 'lsx-colour-control', 'colorSchemeKeys', $colors ); |
|
| 1795 | + wp_localize_script('lsx-colour-control', 'colorSchemeKeys', $colors); |
|
| 1796 | 1796 | } |
| 1797 | 1797 | |
| 1798 | 1798 | /** |
| 1799 | 1799 | * Render the control's content. |
| 1800 | 1800 | */ |
| 1801 | 1801 | public function render_content() { |
| 1802 | - if ( empty( $this->choices ) ) { |
|
| 1802 | + if (empty($this->choices)) { |
|
| 1803 | 1803 | return; |
| 1804 | 1804 | } |
| 1805 | 1805 | |
| 1806 | 1806 | ?> |
| 1807 | 1807 | <label> |
| 1808 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 1809 | - <span class="customize-control-title"><?php echo esc_html( $this->label ) ?></span> |
|
| 1808 | + <?php if ( ! empty($this->label)) { ?> |
|
| 1809 | + <span class="customize-control-title"><?php echo esc_html($this->label) ?></span> |
|
| 1810 | 1810 | <?php } |
| 1811 | - if ( ! empty( $this->description ) ) { ?> |
|
| 1812 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ) ?></span> |
|
| 1811 | + if ( ! empty($this->description)) { ?> |
|
| 1812 | + <span class="description customize-control-description"><?php echo esc_html($this->description) ?></span> |
|
| 1813 | 1813 | <?php } ?> |
| 1814 | 1814 | <select <?php $this->link() ?>> |
| 1815 | 1815 | <?php |
| 1816 | - foreach ( $this->choices as $value => $label ) { |
|
| 1817 | - echo '<option value="'. esc_attr( $value ) .'"'. selected( $this->value(), $value, false ) .'>'. esc_html( $label['label'] ) .'</option>'; |
|
| 1816 | + foreach ($this->choices as $value => $label) { |
|
| 1817 | + echo '<option value="' . esc_attr($value) . '"' . selected($this->value(), $value, false) . '>' . esc_html($label['label']) . '</option>'; |
|
| 1818 | 1818 | } |
| 1819 | 1819 | ?> |
| 1820 | 1820 | </select> |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,77 +1,77 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Filter: lsx_customizer_colour_names |
| 6 | 6 | * |
| 7 | 7 | * Add two new colors (test) in main array of colors |
| 8 | 8 | */ |
| 9 | -function test_lsx_customizer_colour_names( $array ) { |
|
| 10 | - $array['test_text_color'] = esc_html__( 'TEST: Text', 'lsx' ); |
|
| 11 | - $array['test_text_color_hover'] = esc_html__( 'TEST: Text (hover)', 'lsx' ); |
|
| 9 | +function test_lsx_customizer_colour_names($array) { |
|
| 10 | + $array['test_text_color'] = esc_html__('TEST: Text', 'lsx'); |
|
| 11 | + $array['test_text_color_hover'] = esc_html__('TEST: Text (hover)', 'lsx'); |
|
| 12 | 12 | return $array; |
| 13 | 13 | } |
| 14 | -add_filter( 'lsx_customizer_colour_names', 'test_lsx_customizer_colour_names' ); |
|
| 14 | +add_filter('lsx_customizer_colour_names', 'test_lsx_customizer_colour_names'); |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Filter: lsx_customizer_colour_choices_default |
| 18 | 18 | * |
| 19 | 19 | * Add the new colors (test) in default scheme |
| 20 | 20 | */ |
| 21 | -function test_lsx_customizer_colour_choices_default( $array ) { |
|
| 21 | +function test_lsx_customizer_colour_choices_default($array) { |
|
| 22 | 22 | $array[] = '#ddddd1'; |
| 23 | 23 | $array[] = '#eeeee1'; |
| 24 | 24 | return $array; |
| 25 | 25 | } |
| 26 | -add_filter( 'lsx_customizer_colour_choices_default', 'test_lsx_customizer_colour_choices_default' ); |
|
| 26 | +add_filter('lsx_customizer_colour_choices_default', 'test_lsx_customizer_colour_choices_default'); |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Filter: lsx_customizer_colour_choices_red |
| 30 | 30 | * |
| 31 | 31 | * Add the new colors (test) in red scheme |
| 32 | 32 | */ |
| 33 | -function test_lsx_customizer_colour_choices_red( $array ) { |
|
| 33 | +function test_lsx_customizer_colour_choices_red($array) { |
|
| 34 | 34 | $array[] = '#ddddd2'; |
| 35 | 35 | $array[] = '#eeeee2'; |
| 36 | 36 | return $array; |
| 37 | 37 | } |
| 38 | -add_filter( 'lsx_customizer_colour_choices_red', 'test_lsx_customizer_colour_choices_red' ); |
|
| 38 | +add_filter('lsx_customizer_colour_choices_red', 'test_lsx_customizer_colour_choices_red'); |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * Filter: lsx_customizer_colour_choices_orange |
| 42 | 42 | * |
| 43 | 43 | * Add the new colors (test) in orange scheme |
| 44 | 44 | */ |
| 45 | -function test_lsx_customizer_colour_choices_orange( $array ) { |
|
| 45 | +function test_lsx_customizer_colour_choices_orange($array) { |
|
| 46 | 46 | $array[] = '#ddddd3'; |
| 47 | 47 | $array[] = '#eeeee3'; |
| 48 | 48 | return $array; |
| 49 | 49 | } |
| 50 | -add_filter( 'lsx_customizer_colour_choices_orange', 'test_lsx_customizer_colour_choices_orange' ); |
|
| 50 | +add_filter('lsx_customizer_colour_choices_orange', 'test_lsx_customizer_colour_choices_orange'); |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Filter: lsx_customizer_colour_choices_green |
| 54 | 54 | * |
| 55 | 55 | * Add the new colors (test) in green scheme |
| 56 | 56 | */ |
| 57 | -function test_lsx_customizer_colour_choices_green( $array ) { |
|
| 57 | +function test_lsx_customizer_colour_choices_green($array) { |
|
| 58 | 58 | $array[] = '#ddddd4'; |
| 59 | 59 | $array[] = '#eeeee4'; |
| 60 | 60 | return $array; |
| 61 | 61 | } |
| 62 | -add_filter( 'lsx_customizer_colour_choices_green', 'test_lsx_customizer_colour_choices_green' ); |
|
| 62 | +add_filter('lsx_customizer_colour_choices_green', 'test_lsx_customizer_colour_choices_green'); |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Filter: lsx_customizer_colour_choices_brown |
| 66 | 66 | * |
| 67 | 67 | * Add the new colors (test) in brown scheme |
| 68 | 68 | */ |
| 69 | -function test_lsx_customizer_colour_choices_brown( $array ) { |
|
| 69 | +function test_lsx_customizer_colour_choices_brown($array) { |
|
| 70 | 70 | $array[] = '#ddddd5'; |
| 71 | 71 | $array[] = '#eeeee5'; |
| 72 | 72 | return $array; |
| 73 | 73 | } |
| 74 | -add_filter( 'lsx_customizer_colour_choices_brown', 'test_lsx_customizer_colour_choices_brown' ); |
|
| 74 | +add_filter('lsx_customizer_colour_choices_brown', 'test_lsx_customizer_colour_choices_brown'); |
|
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | 77 | * Filter: lsx_customizer_colour_choices |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | * Add a new scheme |
| 80 | 80 | * Also add the new colors (test) in new scheme |
| 81 | 81 | */ |
| 82 | -function test_lsx_customizer_colour_choices( $array ) { |
|
| 82 | +function test_lsx_customizer_colour_choices($array) { |
|
| 83 | 83 | $array['test'] = array( |
| 84 | - 'label' => __( 'Test', 'lsx' ), |
|
| 84 | + 'label' => __('Test', 'lsx'), |
|
| 85 | 85 | 'colors' => array( |
| 86 | 86 | // Button |
| 87 | 87 | '#428bca', '#2a6496', '#ffffff', '#ffffff', |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | return $array; |
| 112 | 112 | } |
| 113 | -add_filter( 'lsx_customizer_colour_choices', 'test_lsx_customizer_colour_choices' ); |
|
| 113 | +add_filter('lsx_customizer_colour_choices', 'test_lsx_customizer_colour_choices'); |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * Filter: lsx_customizer_colour_selectors_button |
| 117 | 117 | * |
| 118 | 118 | * Add new selectors in "button" group of colours |
| 119 | 119 | */ |
| 120 | -function test_lsx_customizer_colour_selectors_button( $css, $colors ) { |
|
| 120 | +function test_lsx_customizer_colour_selectors_button($css, $colors) { |
|
| 121 | 121 | $css .= <<<CSS |
| 122 | 122 | |
| 123 | 123 | /* Button TEST */ |
@@ -132,14 +132,14 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | return $css; |
| 134 | 134 | } |
| 135 | -add_filter( 'lsx_customizer_colour_selectors_button', 'test_lsx_customizer_colour_selectors_button', 10, 2 ); |
|
| 135 | +add_filter('lsx_customizer_colour_selectors_button', 'test_lsx_customizer_colour_selectors_button', 10, 2); |
|
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | 138 | * Filter: lsx_customizer_colour_selectors_button_cta |
| 139 | 139 | * |
| 140 | 140 | * Add new selectors in "button cta" group of colours |
| 141 | 141 | */ |
| 142 | -function test_lsx_customizer_colour_selectors_button_cta( $css, $colors ) { |
|
| 142 | +function test_lsx_customizer_colour_selectors_button_cta($css, $colors) { |
|
| 143 | 143 | $css .= <<<CSS |
| 144 | 144 | |
| 145 | 145 | /* Button CTA TEST */ |
@@ -154,14 +154,14 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | return $css; |
| 156 | 156 | } |
| 157 | -add_filter( 'lsx_customizer_colour_selectors_button_cta', 'test_lsx_customizer_colour_selectors_button_cta', 10, 2 ); |
|
| 157 | +add_filter('lsx_customizer_colour_selectors_button_cta', 'test_lsx_customizer_colour_selectors_button_cta', 10, 2); |
|
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * Filter: lsx_customizer_colour_selectors_top_menu |
| 161 | 161 | * |
| 162 | 162 | * Add new selectors in "top menu" group of colours |
| 163 | 163 | */ |
| 164 | -function test_lsx_customizer_colour_selectors_top_menu( $css, $colors ) { |
|
| 164 | +function test_lsx_customizer_colour_selectors_top_menu($css, $colors) { |
|
| 165 | 165 | $css .= <<<CSS |
| 166 | 166 | |
| 167 | 167 | /* Top Menu TEST */ |
@@ -175,14 +175,14 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | return $css; |
| 177 | 177 | } |
| 178 | -add_filter( 'lsx_customizer_colour_selectors_top_menu', 'test_lsx_customizer_colour_selectors_top_menu', 10, 2 ); |
|
| 178 | +add_filter('lsx_customizer_colour_selectors_top_menu', 'test_lsx_customizer_colour_selectors_top_menu', 10, 2); |
|
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | 181 | * Filter: lsx_customizer_colour_selectors_header |
| 182 | 182 | * |
| 183 | 183 | * Add new selectors in "header" group of colours |
| 184 | 184 | */ |
| 185 | -function test_lsx_customizer_colour_selectors_header( $css, $colors ) { |
|
| 185 | +function test_lsx_customizer_colour_selectors_header($css, $colors) { |
|
| 186 | 186 | $css .= <<<CSS |
| 187 | 187 | |
| 188 | 188 | /* Header TEST */ |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | return $css; |
| 199 | 199 | } |
| 200 | -add_filter( 'lsx_customizer_colour_selectors_header', 'test_lsx_customizer_colour_selectors_header', 10, 2 ); |
|
| 200 | +add_filter('lsx_customizer_colour_selectors_header', 'test_lsx_customizer_colour_selectors_header', 10, 2); |
|
| 201 | 201 | |
| 202 | 202 | /** |
| 203 | 203 | * Filter: lsx_customizer_colour_selectors_main_menu |
| 204 | 204 | * |
| 205 | 205 | * Add new selectors in "main meun" group of colours |
| 206 | 206 | */ |
| 207 | -function test_lsx_customizer_colour_selectors_main_menu( $css, $colors ) { |
|
| 207 | +function test_lsx_customizer_colour_selectors_main_menu($css, $colors) { |
|
| 208 | 208 | $css .= <<<CSS |
| 209 | 209 | |
| 210 | 210 | /* Main Menu TEST */ |
@@ -220,14 +220,14 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | return $css; |
| 222 | 222 | } |
| 223 | -add_filter( 'lsx_customizer_colour_selectors_main_menu', 'test_lsx_customizer_colour_selectors_main_menu', 10, 2 ); |
|
| 223 | +add_filter('lsx_customizer_colour_selectors_main_menu', 'test_lsx_customizer_colour_selectors_main_menu', 10, 2); |
|
| 224 | 224 | |
| 225 | 225 | /** |
| 226 | 226 | * Filter: lsx_customizer_colour_selectors_banner |
| 227 | 227 | * |
| 228 | 228 | * Add new selectors in "banner" group of colours |
| 229 | 229 | */ |
| 230 | -function test_lsx_customizer_colour_selectors_banner( $css, $colors ) { |
|
| 230 | +function test_lsx_customizer_colour_selectors_banner($css, $colors) { |
|
| 231 | 231 | $css .= <<<CSS |
| 232 | 232 | |
| 233 | 233 | /* Banner TEST */ |
@@ -241,14 +241,14 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | return $css; |
| 243 | 243 | } |
| 244 | -add_filter( 'lsx_customizer_colour_selectors_banner', 'test_lsx_customizer_colour_selectors_banner', 10, 2 ); |
|
| 244 | +add_filter('lsx_customizer_colour_selectors_banner', 'test_lsx_customizer_colour_selectors_banner', 10, 2); |
|
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | 247 | * Filter: lsx_customizer_colour_selectors_body |
| 248 | 248 | * |
| 249 | 249 | * Add new selectors in "body" group of colours |
| 250 | 250 | */ |
| 251 | -function test_lsx_customizer_colour_selectors_body( $css, $colors ) { |
|
| 251 | +function test_lsx_customizer_colour_selectors_body($css, $colors) { |
|
| 252 | 252 | $css .= <<<CSS |
| 253 | 253 | |
| 254 | 254 | /* Body TEST */ |
@@ -265,14 +265,14 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | return $css; |
| 267 | 267 | } |
| 268 | -add_filter( 'lsx_customizer_colour_selectors_body', 'test_lsx_customizer_colour_selectors_body', 10, 2 ); |
|
| 268 | +add_filter('lsx_customizer_colour_selectors_body', 'test_lsx_customizer_colour_selectors_body', 10, 2); |
|
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | 271 | * Filter: lsx_customizer_colour_selectors_footer_cta |
| 272 | 272 | * |
| 273 | 273 | * Add new selectors in "footer cta" group of colours |
| 274 | 274 | */ |
| 275 | -function test_lsx_customizer_colour_selectors_footer_cta( $css, $colors ) { |
|
| 275 | +function test_lsx_customizer_colour_selectors_footer_cta($css, $colors) { |
|
| 276 | 276 | $css .= <<<CSS |
| 277 | 277 | |
| 278 | 278 | /* Footer CTA TEST */ |
@@ -287,14 +287,14 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | return $css; |
| 289 | 289 | } |
| 290 | -add_filter( 'lsx_customizer_colour_selectors_footer_cta', 'test_lsx_customizer_colour_selectors_footer_cta', 10, 2 ); |
|
| 290 | +add_filter('lsx_customizer_colour_selectors_footer_cta', 'test_lsx_customizer_colour_selectors_footer_cta', 10, 2); |
|
| 291 | 291 | |
| 292 | 292 | /** |
| 293 | 293 | * Filter: lsx_customizer_colour_selectors_footer_widgets |
| 294 | 294 | * |
| 295 | 295 | * Add new selectors in "footer widgets" group of colours |
| 296 | 296 | */ |
| 297 | -function test_lsx_customizer_colour_selectors_footer_widgets( $css, $colors ) { |
|
| 297 | +function test_lsx_customizer_colour_selectors_footer_widgets($css, $colors) { |
|
| 298 | 298 | $css .= <<<CSS |
| 299 | 299 | |
| 300 | 300 | /* Footer Widgets TEST */ |
@@ -309,14 +309,14 @@ discard block |
||
| 309 | 309 | |
| 310 | 310 | return $css; |
| 311 | 311 | } |
| 312 | -add_filter( 'lsx_customizer_colour_selectors_footer_widgets', 'test_lsx_customizer_colour_selectors_footer_widgets', 10, 2 ); |
|
| 312 | +add_filter('lsx_customizer_colour_selectors_footer_widgets', 'test_lsx_customizer_colour_selectors_footer_widgets', 10, 2); |
|
| 313 | 313 | |
| 314 | 314 | /** |
| 315 | 315 | * Filter: lsx_customizer_colour_selectors_footer |
| 316 | 316 | * |
| 317 | 317 | * Add new selectors in "footer" group of colours |
| 318 | 318 | */ |
| 319 | -function test_lsx_customizer_colour_selectors_footer( $css, $colors ) { |
|
| 319 | +function test_lsx_customizer_colour_selectors_footer($css, $colors) { |
|
| 320 | 320 | $css .= <<<CSS |
| 321 | 321 | |
| 322 | 322 | /* Footer TEST */ |
@@ -331,4 +331,4 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | return $css; |
| 333 | 333 | } |
| 334 | -add_filter( 'lsx_customizer_colour_selectors_footer', 'test_lsx_customizer_colour_selectors_footer', 10, 2 ); |
|
| 334 | +add_filter('lsx_customizer_colour_selectors_footer', 'test_lsx_customizer_colour_selectors_footer', 10, 2); |
|
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Constructor |
| 15 | - **/ |
|
| 15 | + **/ |
|
| 16 | 16 | public function __construct($title, $location, $cssDeclaration, $cssClass) |
| 17 | 17 | { |
| 18 | 18 | $this->title = $title; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | /** |
| 25 | 25 | * Getters |
| 26 | 26 | * taken from: http://stackoverflow.com/questions/4478661/getter-and-setter |
| 27 | - **/ |
|
| 27 | + **/ |
|
| 28 | 28 | public function __get($property) |
| 29 | 29 | { |
| 30 | 30 | if (property_exists($this, $property)) { |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,42 +1,42 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX_Customize_Font_Control Class |
| 6 | 6 | **/ |
| 7 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 7 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 8 | 8 | return; |
| 9 | 9 | } |
| 10 | -class LSX_Customize_Font_Control extends WP_Customize_Control{ |
|
| 10 | +class LSX_Customize_Font_Control extends WP_Customize_Control { |
|
| 11 | 11 | public $fonts; |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Enqueue the styles and scripts |
| 15 | 15 | **/ |
| 16 | - public function enqueue(){ |
|
| 16 | + public function enqueue() { |
|
| 17 | 17 | // styles |
| 18 | - wp_enqueue_style( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/css/customizer-font.css'); |
|
| 18 | + wp_enqueue_style('lsx-font-picker-custom-control', get_template_directory_uri() . '/css/customizer-font.css'); |
|
| 19 | 19 | |
| 20 | 20 | // scripts |
| 21 | - wp_enqueue_script( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/js/customizer-font.js'); |
|
| 21 | + wp_enqueue_script('lsx-font-picker-custom-control', get_template_directory_uri() . '/js/customizer-font.js'); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Render the content on the theme customizer page |
| 26 | 26 | **/ |
| 27 | - public function render_content(){ |
|
| 28 | - if ( empty( $this->choices ) ){ |
|
| 27 | + public function render_content() { |
|
| 28 | + if (empty($this->choices)) { |
|
| 29 | 29 | // if there are no choices then don't print anything |
| 30 | 30 | return; |
| 31 | 31 | } |
| 32 | 32 | $fonts = array(); |
| 33 | - foreach( $this->choices as $slug=>$font ){ |
|
| 33 | + foreach ($this->choices as $slug=>$font) { |
|
| 34 | 34 | $fonts[] = $font['header']; |
| 35 | 35 | $fonts[] = $font['body']; |
| 36 | 36 | $this->choices[$slug] = $font; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $this->fonts = new LSX_Google_Font_Collection( $fonts ); |
|
| 39 | + $this->fonts = new LSX_Google_Font_Collection($fonts); |
|
| 40 | 40 | |
| 41 | 41 | $fonts = $this->fonts->get_font_family_name_array(); |
| 42 | 42 | //print links to css files |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | <div class="fontPickerCustomControl"> |
| 52 | 52 | <select <?php $this->link(); ?>> |
| 53 | 53 | <?php |
| 54 | - foreach ( $this->choices as $value => $conf ){ |
|
| 55 | - echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $value ) . '</option>'; |
|
| 54 | + foreach ($this->choices as $value => $conf) { |
|
| 55 | + echo '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>'; |
|
| 56 | 56 | } |
| 57 | 57 | ?> |
| 58 | 58 | </select> |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | <ul> |
| 61 | 61 | <?php |
| 62 | 62 | //$cssClassArray = $this->fonts->get_css_class_array(); |
| 63 | - foreach ($this->choices as $key => $font){ |
|
| 63 | + foreach ($this->choices as $key => $font) { |
|
| 64 | 64 | $class = null; |
| 65 | - if( $key == $set_value ){ |
|
| 65 | + if ($key == $set_value) { |
|
| 66 | 66 | $class = ' selected'; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | ?> |
| 70 | - <li class="font-choice <?php echo esc_attr( $class ); ?>"> |
|
| 71 | - <div class="<?php echo esc_attr( $font['header']['cssClass'] ); ?>"><?php echo esc_html( $font['header']['title'] ); ?></div> |
|
| 72 | - <small class="<?php echo esc_attr( $font['body']['cssClass'] ); ?>"><?php echo esc_html( $font['body']['title'] ); ?></small> |
|
| 70 | + <li class="font-choice <?php echo esc_attr($class); ?>"> |
|
| 71 | + <div class="<?php echo esc_attr($font['header']['cssClass']); ?>"><?php echo esc_html($font['header']['title']); ?></div> |
|
| 72 | + <small class="<?php echo esc_attr($font['body']['cssClass']); ?>"><?php echo esc_html($font['body']['title']); ?></small> |
|
| 73 | 73 | </li> |
| 74 | 74 | <?php |
| 75 | 75 | } |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customizer Header Swatch Control Class |
| 6 | 6 | * |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | */ |
| 9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 10 | 10 | return; |
| 11 | 11 | } |
| 12 | 12 | class LSX_Customize_Header_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * @param string $id |
| 39 | 39 | * @param array $args |
| 40 | 40 | */ |
| 41 | - public function __construct( $manager, $id, $args = array() ) { |
|
| 42 | - parent::__construct( $manager, $id, $args ); |
|
| 43 | - if( !empty( $args['choices'] ) ){ |
|
| 41 | + public function __construct($manager, $id, $args = array()) { |
|
| 42 | + parent::__construct($manager, $id, $args); |
|
| 43 | + if ( ! empty($args['choices'])) { |
|
| 44 | 44 | $this->layouts = $args['choices']; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function enqueue() { |
| 54 | 54 | // |
| 55 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), null, true ); |
|
| 55 | + wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), null, true); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -62,30 +62,30 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function render_content() { |
| 64 | 64 | |
| 65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
| 65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
| 66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
| 67 | 67 | $value = $this->value(); |
| 68 | 68 | |
| 69 | 69 | ?> |
| 70 | 70 | <label> |
| 71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
| 71 | + <?php if ( ! empty($this->label)) { ?> |
|
| 72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
| 73 | 73 | <?php } |
| 74 | - if ( ! empty( $this->description ) ) { ?> |
|
| 75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
| 74 | + if ( ! empty($this->description)) { ?> |
|
| 75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
| 76 | 76 | <?php } ?> |
| 77 | 77 | <div class="header-layouts-selector"> |
| 78 | 78 | <?php |
| 79 | - foreach( $this->layouts as $layout ){ |
|
| 79 | + foreach ($this->layouts as $layout) { |
|
| 80 | 80 | $sel = 'border: 1px solid transparent;'; |
| 81 | - if( $value == $layout ){ |
|
| 81 | + if ($value == $layout) { |
|
| 82 | 82 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
| 83 | 83 | } |
| 84 | - echo '<img class="header-layout-button" style="padding:2px;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/header-' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">'; |
|
| 84 | + echo '<img class="header-layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/header-' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | ?> |
| 88 | - <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>> |
|
| 88 | + <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> |
|
| 89 | 89 | </div> |
| 90 | 90 | </label> |
| 91 | 91 | <?php |