@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * |
| 5 | 5 | * @package lsx |
| 6 | 6 | */ |
| 7 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 7 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 8 | 8 | |
| 9 | 9 | define('LSX_VERSION', '1.8.0'); |
| 10 | 10 | |
@@ -21,22 +21,22 @@ discard block |
||
| 21 | 21 | require get_template_directory() . '/inc/comment-walker.php'; |
| 22 | 22 | require get_template_directory() . '/inc/jetpack.php'; |
| 23 | 23 | require get_template_directory() . '/inc/lazyload.php'; |
| 24 | -if(class_exists('BuddyPress')){ |
|
| 24 | +if (class_exists('BuddyPress')) { |
|
| 25 | 25 | require get_template_directory() . '/inc/buddypress.php'; |
| 26 | 26 | } |
| 27 | -if(class_exists('WooCommerce')){ |
|
| 27 | +if (class_exists('WooCommerce')) { |
|
| 28 | 28 | require get_template_directory() . '/inc/woocommerce.php'; |
| 29 | 29 | } |
| 30 | -if(class_exists('WP_Job_Manager')){ |
|
| 30 | +if (class_exists('WP_Job_Manager')) { |
|
| 31 | 31 | require get_template_directory() . '/inc/wp-job-manager.php'; |
| 32 | 32 | } |
| 33 | -if(class_exists('Tribe__Events__Main')){ |
|
| 33 | +if (class_exists('Tribe__Events__Main')) { |
|
| 34 | 34 | require get_template_directory() . '/inc/the-events-calendar.php'; |
| 35 | 35 | } |
| 36 | 36 | require get_template_directory() . '/inc/template-tags.php'; |
| 37 | 37 | require get_template_directory() . '/inc/extras.php'; |
| 38 | 38 | require get_template_directory() . '/inc/wp-bootstrap-navwalker.php'; |
| 39 | -if(class_exists('Sensei_WC')){ |
|
| 39 | +if (class_exists('Sensei_WC')) { |
|
| 40 | 40 | require get_template_directory() . '/inc/sensei.php'; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | * @category customizer |
| 49 | 49 | * @return $lsx_controls array() |
| 50 | 50 | */ |
| 51 | -function lsx_customizer_core_controls( $lsx_controls ) { |
|
| 51 | +function lsx_customizer_core_controls($lsx_controls) { |
|
| 52 | 52 | $lsx_controls['sections']['lsx-core'] = array( |
| 53 | - 'title' => esc_html__( 'Core Settings', 'lsx' ), |
|
| 54 | - 'description' => __( 'Change the core settings.', 'lsx' ), |
|
| 53 | + 'title' => esc_html__('Core Settings', 'lsx'), |
|
| 54 | + 'description' => __('Change the core settings.', 'lsx'), |
|
| 55 | 55 | 'priority' => 21 |
| 56 | 56 | ); |
| 57 | 57 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | 64 | $lsx_controls['fields']['lsx_lazyload_status'] = array( |
| 65 | - 'label' => __( 'Lazy Loading Images', 'lsx' ), |
|
| 65 | + 'label' => __('Lazy Loading Images', 'lsx'), |
|
| 66 | 66 | 'section' => 'lsx-core', |
| 67 | 67 | 'type' => 'checkbox', |
| 68 | 68 | ); |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | $lsx_controls['fields']['lsx_preloader_content_status'] = array( |
| 77 | - 'label' => __( 'Preloader Content', 'lsx' ), |
|
| 77 | + 'label' => __('Preloader Content', 'lsx'), |
|
| 78 | 78 | 'section' => 'lsx-core', |
| 79 | 79 | 'type' => 'checkbox', |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | return $lsx_controls; |
| 83 | 83 | } |
| 84 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' ); |
|
| 84 | +add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls'); |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Returns an array of the colour scheme picker. |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @category customizer |
| 92 | 92 | * @return $lsx_controls array() |
| 93 | 93 | */ |
| 94 | -function lsx_customizer_colour_scheme_controls( $lsx_controls ) { |
|
| 94 | +function lsx_customizer_colour_scheme_controls($lsx_controls) { |
|
| 95 | 95 | global $customizer_colour_names; |
| 96 | 96 | global $customizer_colour_choices; |
| 97 | 97 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | 104 | $lsx_controls['fields']['color_scheme'] = array( |
| 105 | - 'label' => esc_html__( 'Base Color Scheme', 'lsx' ), |
|
| 105 | + 'label' => esc_html__('Base Color Scheme', 'lsx'), |
|
| 106 | 106 | 'section' => 'colors', |
| 107 | 107 | 'type' => 'select', |
| 108 | 108 | 'priority' => 1, |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | 'choices' => $customizer_colour_choices |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 113 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 114 | 114 | $sanitize_callback = 'sanitize_hex_color'; |
| 115 | 115 | |
| 116 | - if ( 'background_color' === $key ) { |
|
| 116 | + if ('background_color' === $key) { |
|
| 117 | 117 | $sanitize_callback = 'sanitize_hex_color_no_hash'; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | return $lsx_controls; |
| 135 | 135 | } |
| 136 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_colour_scheme_controls' ); |
|
| 136 | +add_filter('lsx_customizer_controls', 'lsx_customizer_colour_scheme_controls'); |
|
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * Returns an array of the layout panel. |
@@ -144,56 +144,56 @@ discard block |
||
| 144 | 144 | * @return $lsx_controls array() |
| 145 | 145 | */ |
| 146 | 146 | function lsx_customizer_layout_controls($lsx_controls) { |
| 147 | - $lsx_controls['settings']['lsx_header_layout'] = array( |
|
| 147 | + $lsx_controls['settings']['lsx_header_layout'] = array( |
|
| 148 | 148 | 'default' => 'inline', //Default setting/value to save |
| 149 | 149 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 150 | 150 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 151 | 151 | ); |
| 152 | 152 | $lsx_controls['fields']['lsx_header_layout'] = array( |
| 153 | - 'label' => __('Header','lsx'), |
|
| 153 | + 'label' => __('Header', 'lsx'), |
|
| 154 | 154 | 'section' => 'lsx-layout', |
| 155 | 155 | 'control' => 'LSX_Customize_Header_Layout_Control', |
| 156 | - 'choices' => array('central','expanded','inline') |
|
| 156 | + 'choices' => array('central', 'expanded', 'inline') |
|
| 157 | 157 | ); |
| 158 | 158 | $lsx_controls['sections']['lsx-layout'] = array( |
| 159 | - 'title' => esc_html__( 'Layout', 'lsx' ), |
|
| 160 | - 'description' => __( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
| 159 | + 'title' => esc_html__('Layout', 'lsx'), |
|
| 160 | + 'description' => __('Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx'), |
|
| 161 | 161 | 'priority' => 22 |
| 162 | 162 | ); |
| 163 | - $lsx_controls['settings']['lsx_layout'] = array( |
|
| 163 | + $lsx_controls['settings']['lsx_layout'] = array( |
|
| 164 | 164 | 'default' => '2cr', //Default setting/value to save |
| 165 | 165 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 166 | 166 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 167 | 167 | ); |
| 168 | - $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
| 168 | + $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
| 169 | 169 | 'default' => false, //Default setting/value to save |
| 170 | 170 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
| 171 | 171 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 172 | 172 | ); |
| 173 | 173 | $lsx_controls['fields']['lsx_header_fixed'] = array( |
| 174 | - 'label' => __('Fixed Header','lsx'), |
|
| 174 | + 'label' => __('Fixed Header', 'lsx'), |
|
| 175 | 175 | 'section' => 'lsx-layout', |
| 176 | 176 | 'type' => 'checkbox', |
| 177 | 177 | ); |
| 178 | - $lsx_controls['settings']['lsx_header_search'] = array( |
|
| 178 | + $lsx_controls['settings']['lsx_header_search'] = array( |
|
| 179 | 179 | 'default' => false, //Default setting/value to save |
| 180 | 180 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
| 181 | 181 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 182 | 182 | ); |
| 183 | 183 | $lsx_controls['fields']['lsx_header_search'] = array( |
| 184 | - 'label' => __('Search Box in Header','lsx'), |
|
| 184 | + 'label' => __('Search Box in Header', 'lsx'), |
|
| 185 | 185 | 'section' => 'lsx-layout', |
| 186 | 186 | 'type' => 'checkbox', |
| 187 | 187 | ); |
| 188 | 188 | $lsx_controls['fields']['lsx_layout'] = array( |
| 189 | - 'label' => __('Body','lsx'), |
|
| 189 | + 'label' => __('Body', 'lsx'), |
|
| 190 | 190 | 'section' => 'lsx-layout', |
| 191 | 191 | 'control' => 'LSX_Customize_Layout_Control', |
| 192 | - 'choices' => array('1c','2cr','2cl') |
|
| 192 | + 'choices' => array('1c', '2cr', '2cl') |
|
| 193 | 193 | ); |
| 194 | 194 | return $lsx_controls; |
| 195 | 195 | } |
| 196 | -add_filter('lsx_customizer_controls','lsx_customizer_layout_controls'); |
|
| 196 | +add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls'); |
|
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | 199 | * Returns an array of the font controls. |
@@ -205,11 +205,11 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | function lsx_customizer_font_controls($lsx_controls) { |
| 207 | 207 | $lsx_controls['sections']['lsx-font'] = array( |
| 208 | - 'title' => __( 'Font', 'lsx' ), |
|
| 208 | + 'title' => __('Font', 'lsx'), |
|
| 209 | 209 | 'description' => 'Change the fonts sitewide.', |
| 210 | 210 | 'priority' => 41 |
| 211 | 211 | ); |
| 212 | - $lsx_controls['settings']['lsx_font'] = array( |
|
| 212 | + $lsx_controls['settings']['lsx_font'] = array( |
|
| 213 | 213 | 'default' => 'raleway_open_sans', //Default setting/value to save |
| 214 | 214 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 215 | 215 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | 'choices' => array( |
| 224 | 224 | 'raleway_open_sans' => array( |
| 225 | 225 | 'header' => array( |
| 226 | - "title" => __( 'Raleway', 'lsx' ), |
|
| 226 | + "title" => __('Raleway', 'lsx'), |
|
| 227 | 227 | "location" => "Raleway", |
| 228 | 228 | "cssDeclaration" => "'Raleway', sans-serif", |
| 229 | 229 | "cssClass" => "raleway", |
| 230 | 230 | ), |
| 231 | 231 | 'body' => array( |
| 232 | - "title" => __( 'Open Sans', 'lsx' ), |
|
| 232 | + "title" => __('Open Sans', 'lsx'), |
|
| 233 | 233 | "location" => "Open+Sans", |
| 234 | 234 | "cssDeclaration" => "'Open Sans', sans-serif", |
| 235 | 235 | "cssClass" => "openSans" |
@@ -237,13 +237,13 @@ discard block |
||
| 237 | 237 | ), |
| 238 | 238 | 'noto_serif_noto_sans' => array( |
| 239 | 239 | 'header' => array( |
| 240 | - "title" => __( 'Noto Serif', 'lsx' ), |
|
| 240 | + "title" => __('Noto Serif', 'lsx'), |
|
| 241 | 241 | "location" => "Noto+Serif", |
| 242 | 242 | "cssDeclaration" => "'Noto Serif', serif", |
| 243 | 243 | "cssClass" => "notoSerif", |
| 244 | 244 | ), |
| 245 | 245 | 'body' => array( |
| 246 | - "title" => __( 'Noto Sans', 'lsx' ), |
|
| 246 | + "title" => __('Noto Sans', 'lsx'), |
|
| 247 | 247 | "location" => "Noto+Sans", |
| 248 | 248 | "cssDeclaration" => "'Noto Sans', sans-serif", |
| 249 | 249 | "cssClass" => "notoSans", |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | ), |
| 252 | 252 | 'noto_sans_noto_sans' => array( |
| 253 | 253 | 'header' => array( |
| 254 | - "title" => __( 'Noto Sans', 'lsx' ), |
|
| 254 | + "title" => __('Noto Sans', 'lsx'), |
|
| 255 | 255 | "location" => "Noto+Sans", |
| 256 | 256 | "cssDeclaration" => "'Noto Sans', sans-serif", |
| 257 | 257 | "cssClass" => "notoSans", |
| 258 | 258 | ), |
| 259 | 259 | 'body' => array( |
| 260 | - "title" => __( 'Noto Sans', 'lsx' ), |
|
| 260 | + "title" => __('Noto Sans', 'lsx'), |
|
| 261 | 261 | "location" => "Noto+Sans", |
| 262 | 262 | "cssDeclaration" => "'Noto Sans', sans-serif", |
| 263 | 263 | "cssClass" => "notoSans", |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | ), |
| 266 | 266 | 'alegreya_open_sans' => array( |
| 267 | 267 | 'header' => array( |
| 268 | - "title" => __( 'Alegreya', 'lsx' ), |
|
| 268 | + "title" => __('Alegreya', 'lsx'), |
|
| 269 | 269 | "location" => "Alegreya", |
| 270 | 270 | "cssDeclaration" => "'Alegreya', serif", |
| 271 | 271 | "cssClass" => "alegreya", |
| 272 | 272 | ), |
| 273 | 273 | 'body' => array( |
| 274 | - "title" => __( 'Open Sans', 'lsx' ), |
|
| 274 | + "title" => __('Open Sans', 'lsx'), |
|
| 275 | 275 | "location" => "Open+Sans", |
| 276 | 276 | "cssDeclaration" => "'Open Sans', sans-serif", |
| 277 | 277 | "cssClass" => "openSans" |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | ); |
| 283 | 283 | return $lsx_controls; |
| 284 | 284 | } |
| 285 | -add_filter('lsx_customizer_controls','lsx_customizer_font_controls'); |
|
| 285 | +add_filter('lsx_customizer_controls', 'lsx_customizer_font_controls'); |
|
| 286 | 286 | |
| 287 | 287 | /** |
| 288 | 288 | * Returns an array of $controls for the customizer class to generate. |
@@ -292,12 +292,12 @@ discard block |
||
| 292 | 292 | * @category customizer |
| 293 | 293 | * @return $lsx_controls array() |
| 294 | 294 | */ |
| 295 | -function lsx_get_customizer_controls(){ |
|
| 295 | +function lsx_get_customizer_controls() { |
|
| 296 | 296 | $lsx_controls = array(); |
| 297 | 297 | $lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls); |
| 298 | 298 | return $lsx_controls; |
| 299 | 299 | } |
| 300 | -$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() ); |
|
| 300 | +$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls()); |
|
| 301 | 301 | |
| 302 | -add_image_size( 'lsx-thumbnail-wide', 350, 230, true ); |
|
| 303 | -add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
|
| 304 | 302 | \ No newline at end of file |
| 303 | +add_image_size('lsx-thumbnail-wide', 350, 230, true); |
|
| 304 | +add_image_size('lsx-thumbnail-single', 750, 350, true); |
|
| 305 | 305 | \ No newline at end of file |
@@ -1,5 +1,5 @@ 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 Configuration File |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @author [email protected] <lsdev.biz> |
| 10 | 10 | * |
| 11 | 11 | */ |
| 12 | -if ( ! class_exists( 'LSX_Theme_Customizer' ) ) { |
|
| 12 | +if ( ! class_exists('LSX_Theme_Customizer')) { |
|
| 13 | 13 | |
| 14 | 14 | class LSX_Theme_Customizer { |
| 15 | 15 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @since 1.0.0 |
| 31 | 31 | */ |
| 32 | - public function __construct( $controls ) { |
|
| 32 | + public function __construct($controls) { |
|
| 33 | 33 | require get_template_directory() . '/inc/google-font.php'; |
| 34 | 34 | require get_template_directory() . '/inc/google-font-collection.php'; |
| 35 | 35 | require get_template_directory() . '/inc/customizer-core.php'; |
@@ -40,19 +40,19 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $this->controls = $controls; |
| 42 | 42 | |
| 43 | - add_action( 'customize_preview_init', array($this,'customize_preview_js' ),20); |
|
| 44 | - add_action( 'customize_register', array($this,'customizer'), 11 ); |
|
| 43 | + add_action('customize_preview_init', array($this, 'customize_preview_js'), 20); |
|
| 44 | + add_action('customize_register', array($this, 'customizer'), 11); |
|
| 45 | 45 | |
| 46 | - add_action( 'wp_ajax_customizer_site_title', array($this,'ajax_site_title') ); |
|
| 47 | - add_action( 'wp_ajax_nopriv_customizer_site_title', array($this,'ajax_site_title') ); |
|
| 46 | + add_action('wp_ajax_customizer_site_title', array($this, 'ajax_site_title')); |
|
| 47 | + add_action('wp_ajax_nopriv_customizer_site_title', array($this, 'ajax_site_title')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
| 52 | 52 | */ |
| 53 | 53 | function customize_preview_js() { |
| 54 | - wp_enqueue_script( 'lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ) , wp_get_theme()->Version, true ); |
|
| 55 | - wp_localize_script( 'lsx_customizer', 'lsx_customizer_params', array( 'template_directory' => get_template_directory_uri() ) ); |
|
| 54 | + wp_enqueue_script('lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), wp_get_theme()->Version, true); |
|
| 55 | + wp_localize_script('lsx_customizer', 'lsx_customizer_params', array('template_directory' => get_template_directory_uri())); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -60,38 +60,38 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @since 1.0.0 |
| 62 | 62 | */ |
| 63 | - public function customizer( $wp_customize ) { |
|
| 63 | + public function customizer($wp_customize) { |
|
| 64 | 64 | // start panels |
| 65 | - if( !empty( $this->controls['panels'] ) ){ |
|
| 66 | - foreach( $this->controls['panels'] as $panel_slug => $args ){ |
|
| 67 | - $this->add_panel( $panel_slug, $args, $wp_customize ); |
|
| 65 | + if ( ! empty($this->controls['panels'])) { |
|
| 66 | + foreach ($this->controls['panels'] as $panel_slug => $args) { |
|
| 67 | + $this->add_panel($panel_slug, $args, $wp_customize); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // start sections |
| 72 | - if( !empty( $this->controls['sections'] ) ){ |
|
| 73 | - foreach( $this->controls['sections'] as $section_slug => $args ){ |
|
| 74 | - $this->add_section( $section_slug, $args, $wp_customize ); |
|
| 72 | + if ( ! empty($this->controls['sections'])) { |
|
| 73 | + foreach ($this->controls['sections'] as $section_slug => $args) { |
|
| 74 | + $this->add_section($section_slug, $args, $wp_customize); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // start settings |
| 79 | - if( !empty( $this->controls['settings'] ) ){ |
|
| 80 | - foreach( $this->controls['settings'] as $settings_slug => $args ){ |
|
| 81 | - $this->add_setting( $settings_slug, $args, $wp_customize ); |
|
| 79 | + if ( ! empty($this->controls['settings'])) { |
|
| 80 | + foreach ($this->controls['settings'] as $settings_slug => $args) { |
|
| 81 | + $this->add_setting($settings_slug, $args, $wp_customize); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // start fields |
| 86 | - if( !empty( $this->controls['fields'] ) ){ |
|
| 87 | - foreach( $this->controls['fields'] as $field_slug => $args ){ |
|
| 88 | - $this->add_control( $field_slug, $args, $wp_customize ); |
|
| 86 | + if ( ! empty($this->controls['fields'])) { |
|
| 87 | + foreach ($this->controls['fields'] as $field_slug => $args) { |
|
| 88 | + $this->add_control($field_slug, $args, $wp_customize); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
| 93 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
| 94 | - $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; |
|
| 92 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
| 93 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
| 94 | + $wp_customize->get_setting('background_color')->transport = 'postMessage'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @since 1.0.0 |
| 101 | 101 | */ |
| 102 | - private function add_panel( $slug, $args, $wp_customize ) { |
|
| 102 | + private function add_panel($slug, $args, $wp_customize) { |
|
| 103 | 103 | $default_args = array( |
| 104 | 104 | 'title' => null, |
| 105 | 105 | 'description' => null, |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $wp_customize->add_panel( |
| 109 | 109 | $slug, |
| 110 | - array_merge( $default_args, $args ) |
|
| 110 | + array_merge($default_args, $args) |
|
| 111 | 111 | ); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @since 1.0.0 |
| 118 | 118 | */ |
| 119 | - private function add_section( $slug, $args, $wp_customize ) { |
|
| 119 | + private function add_section($slug, $args, $wp_customize) { |
|
| 120 | 120 | $default_args = array( |
| 121 | 121 | 'capability' => 'edit_theme_options', //Capability needed to tweak |
| 122 | 122 | 'description' => null, //Descriptive tooltip |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - $wp_customize->add_section( $slug, |
|
| 126 | - array_merge( $default_args, $args ) |
|
| 125 | + $wp_customize->add_section($slug, |
|
| 126 | + array_merge($default_args, $args) |
|
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | * |
| 133 | 133 | * @since 1.0.0 |
| 134 | 134 | */ |
| 135 | - private function add_setting( $slug, $args, $wp_customize ) { |
|
| 136 | - $wp_customize->add_setting( $slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
| 137 | - array_merge( array( |
|
| 135 | + private function add_setting($slug, $args, $wp_customize) { |
|
| 136 | + $wp_customize->add_setting($slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
| 137 | + array_merge(array( |
|
| 138 | 138 | 'default' => null, //Default setting/value to save |
| 139 | 139 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 140 | 140 | 'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting. |
| 141 | 141 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 142 | 142 | 'sanitize_callback' => 'lsx_sanitize_choices' |
| 143 | - ), $args ) |
|
| 143 | + ), $args) |
|
| 144 | 144 | ); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,28 +149,28 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @since 1.0.0 |
| 151 | 151 | */ |
| 152 | - private function add_control( $slug, $args, $wp_customize ) { |
|
| 152 | + private function add_control($slug, $args, $wp_customize) { |
|
| 153 | 153 | $default_args = array( |
| 154 | 154 | |
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | - if( isset( $args['control'] ) && class_exists( $args['control'] )){ |
|
| 157 | + if (isset($args['control']) && class_exists($args['control'])) { |
|
| 158 | 158 | |
| 159 | 159 | $control_class = $args['control']; |
| 160 | - unset( $args['control'] ); |
|
| 160 | + unset($args['control']); |
|
| 161 | 161 | |
| 162 | - $control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) ); |
|
| 163 | - $wp_customize->add_control( $control ); |
|
| 162 | + $control = new $control_class($wp_customize, $slug, array_merge($default_args, $args)); |
|
| 163 | + $wp_customize->add_control($control); |
|
| 164 | 164 | |
| 165 | - }else{ |
|
| 165 | + } else { |
|
| 166 | 166 | |
| 167 | - if( isset( $args['control'] ) ){ |
|
| 168 | - unset( $args['control'] ); |
|
| 167 | + if (isset($args['control'])) { |
|
| 168 | + unset($args['control']); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $wp_customize->add_control( |
| 172 | 172 | $slug, |
| 173 | - array_merge( $default_args, $args ) |
|
| 173 | + array_merge($default_args, $args) |
|
| 174 | 174 | ); |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -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_enqueue_scripts', 'lsx_customizer_colour__add_footer_styles', 999 ); |
|
| 34 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__add_footer_styles', 999); |
|
| 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 str_replace( '>', '>', esc_html( lsx_customizer_colour__top_menu_get_css( $colors ) ) ); ?> |
|
| 50 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__header_get_css( $colors ) ) ); ?> |
|
| 51 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__main_menu_get_css( $colors ) ) ); ?> |
|
| 49 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__top_menu_get_css($colors))); ?> |
|
| 50 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__header_get_css($colors))); ?> |
|
| 51 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__main_menu_get_css($colors))); ?> |
|
| 52 | 52 | |
| 53 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__banner_get_css( $colors ) ) ); ?> |
|
| 54 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__body_get_css( $colors ) ) ); ?> |
|
| 53 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__banner_get_css($colors))); ?> |
|
| 54 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__body_get_css($colors))); ?> |
|
| 55 | 55 | |
| 56 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__footer_cta_get_css( $colors ) ) ); ?> |
|
| 57 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__footer_widgets_get_css( $colors ) ) ); ?> |
|
| 58 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__footer_get_css( $colors ) ) ); ?> |
|
| 56 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__footer_cta_get_css($colors))); ?> |
|
| 57 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__footer_widgets_get_css($colors))); ?> |
|
| 58 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__footer_get_css($colors))); ?> |
|
| 59 | 59 | |
| 60 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__button_get_css( $colors ) ) ); ?> |
|
| 61 | - <?php echo str_replace( '>', '>', esc_html( lsx_customizer_colour__button_cta_get_css( $colors ) ) ); ?> |
|
| 60 | + <?php echo str_replace('>', '>', esc_html(lsx_customizer_colour__button_get_css($colors))); ?> |
|
| 61 | + <?php echo str_replace('>', '>', 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_enqueue_scripts', 'lsx_customizer_colour__button_css', 9999 ); |
|
| 138 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__button_css', 9999); |
|
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | 141 | * Get button CSS theme mods. |
@@ -144,26 +144,26 @@ discard block |
||
| 144 | 144 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 145 | 145 | |
| 146 | 146 | return array( |
| 147 | - 'button_background_color' => get_theme_mod( 'button_background_color', $colors['button_background_color'] ), |
|
| 148 | - 'button_background_hover_color' => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ), |
|
| 149 | - 'button_text_color' => get_theme_mod( 'button_text_color', $colors['button_text_color'] ), |
|
| 150 | - 'button_text_color_hover' => get_theme_mod( 'button_text_color_hover', $colors['button_text_color_hover'] ) |
|
| 147 | + 'button_background_color' => get_theme_mod('button_background_color', $colors['button_background_color']), |
|
| 148 | + 'button_background_hover_color' => get_theme_mod('button_background_hover_color', $colors['button_background_hover_color']), |
|
| 149 | + 'button_text_color' => get_theme_mod('button_text_color', $colors['button_text_color']), |
|
| 150 | + 'button_text_color_hover' => get_theme_mod('button_text_color_hover', $colors['button_text_color_hover']) |
|
| 151 | 151 | ); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * Returns CSS for the button. |
| 156 | 156 | */ |
| 157 | -function lsx_customizer_colour__button_get_css( $colors ) { |
|
| 157 | +function lsx_customizer_colour__button_get_css($colors) { |
|
| 158 | 158 | global $customizer_colour_names; |
| 159 | 159 | |
| 160 | 160 | $colors_template = array(); |
| 161 | 161 | |
| 162 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 162 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 163 | 163 | $colors_template[$key] = ''; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 166 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 167 | 167 | |
| 168 | 168 | $css = <<<CSS |
| 169 | 169 | /* |
@@ -361,8 +361,8 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | CSS; |
| 363 | 363 | |
| 364 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button', $css, $colors ); |
|
| 365 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 364 | + $css = apply_filters('lsx_customizer_colour_selectors_button', $css, $colors); |
|
| 365 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 366 | 366 | return $css; |
| 367 | 367 | } |
| 368 | 368 | |
@@ -375,33 +375,33 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | function lsx_customizer_colour__button_cta_set_theme_mod() { |
| 377 | 377 | $theme_mods = lsx_customizer_colour__button_cta_get_theme_mods(); |
| 378 | - $styles = lsx_customizer_colour__button_cta_get_css( $theme_mods ); |
|
| 378 | + $styles = lsx_customizer_colour__button_cta_get_css($theme_mods); |
|
| 379 | 379 | |
| 380 | - set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles ); |
|
| 380 | + set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles); |
|
| 381 | 381 | } |
| 382 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__button_cta_set_theme_mod' ); |
|
| 383 | -add_action( 'customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod' ); |
|
| 382 | +add_action('after_switch_theme', 'lsx_customizer_colour__button_cta_set_theme_mod'); |
|
| 383 | +add_action('customize_save_after', 'lsx_customizer_colour__button_cta_set_theme_mod'); |
|
| 384 | 384 | |
| 385 | 385 | /** |
| 386 | 386 | * Enqueues front-end CSS for the button cta. |
| 387 | 387 | */ |
| 388 | 388 | function lsx_customizer_colour__button_cta_css() { |
| 389 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod' ); |
|
| 389 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_cta_theme_mod'); |
|
| 390 | 390 | |
| 391 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 391 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 392 | 392 | $theme_mods = lsx_customizer_colour__button_cta_get_theme_mods(); |
| 393 | - $styles = lsx_customizer_colour__button_cta_get_css( $theme_mods ); |
|
| 393 | + $styles = lsx_customizer_colour__button_cta_get_css($theme_mods); |
|
| 394 | 394 | |
| 395 | - if ( false === $styles_from_theme_mod ) { |
|
| 396 | - set_theme_mod( 'lsx_customizer_colour__button_cta_theme_mod', $styles ); |
|
| 395 | + if (false === $styles_from_theme_mod) { |
|
| 396 | + set_theme_mod('lsx_customizer_colour__button_cta_theme_mod', $styles); |
|
| 397 | 397 | } |
| 398 | 398 | } else { |
| 399 | 399 | $styles = $styles_from_theme_mod; |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 402 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 403 | 403 | } |
| 404 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__button_cta_css', 9999 ); |
|
| 404 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__button_cta_css', 9999); |
|
| 405 | 405 | |
| 406 | 406 | /** |
| 407 | 407 | * Get button cta CSS theme mods. |
@@ -410,26 +410,26 @@ discard block |
||
| 410 | 410 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 411 | 411 | |
| 412 | 412 | return array( |
| 413 | - 'button_cta_background_color' => get_theme_mod( 'button_cta_background_color', $colors['button_cta_background_color'] ), |
|
| 414 | - 'button_cta_background_hover_color' => get_theme_mod( 'button_cta_background_hover_color', $colors['button_cta_background_hover_color'] ), |
|
| 415 | - 'button_cta_text_color' => get_theme_mod( 'button_cta_text_color', $colors['button_cta_text_color'] ), |
|
| 416 | - 'button_cta_text_color_hover' => get_theme_mod( 'button_cta_text_color_hover', $colors['button_cta_text_color_hover'] ) |
|
| 413 | + 'button_cta_background_color' => get_theme_mod('button_cta_background_color', $colors['button_cta_background_color']), |
|
| 414 | + 'button_cta_background_hover_color' => get_theme_mod('button_cta_background_hover_color', $colors['button_cta_background_hover_color']), |
|
| 415 | + 'button_cta_text_color' => get_theme_mod('button_cta_text_color', $colors['button_cta_text_color']), |
|
| 416 | + 'button_cta_text_color_hover' => get_theme_mod('button_cta_text_color_hover', $colors['button_cta_text_color_hover']) |
|
| 417 | 417 | ); |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
| 421 | 421 | * Returns CSS for the button cta. |
| 422 | 422 | */ |
| 423 | -function lsx_customizer_colour__button_cta_get_css( $colors ) { |
|
| 423 | +function lsx_customizer_colour__button_cta_get_css($colors) { |
|
| 424 | 424 | global $customizer_colour_names; |
| 425 | 425 | |
| 426 | 426 | $colors_template = array(); |
| 427 | 427 | |
| 428 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 428 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 429 | 429 | $colors_template[$key] = ''; |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 432 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 433 | 433 | |
| 434 | 434 | $css = <<<CSS |
| 435 | 435 | /* |
@@ -564,8 +564,8 @@ discard block |
||
| 564 | 564 | } |
| 565 | 565 | CSS; |
| 566 | 566 | |
| 567 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button_cta', $css, $colors ); |
|
| 568 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 567 | + $css = apply_filters('lsx_customizer_colour_selectors_button_cta', $css, $colors); |
|
| 568 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 569 | 569 | return $css; |
| 570 | 570 | } |
| 571 | 571 | |
@@ -578,33 +578,33 @@ discard block |
||
| 578 | 578 | */ |
| 579 | 579 | function lsx_customizer_colour__top_menu_set_theme_mod() { |
| 580 | 580 | $theme_mods = lsx_customizer_colour__top_menu_get_theme_mods(); |
| 581 | - $styles = lsx_customizer_colour__top_menu_get_css( $theme_mods ); |
|
| 581 | + $styles = lsx_customizer_colour__top_menu_get_css($theme_mods); |
|
| 582 | 582 | |
| 583 | - set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles ); |
|
| 583 | + set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles); |
|
| 584 | 584 | } |
| 585 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__top_menu_set_theme_mod' ); |
|
| 586 | -add_action( 'customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod' ); |
|
| 585 | +add_action('after_switch_theme', 'lsx_customizer_colour__top_menu_set_theme_mod'); |
|
| 586 | +add_action('customize_save_after', 'lsx_customizer_colour__top_menu_set_theme_mod'); |
|
| 587 | 587 | |
| 588 | 588 | /** |
| 589 | 589 | * Enqueues front-end CSS for the top menu. |
| 590 | 590 | */ |
| 591 | 591 | function lsx_customizer_colour__top_menu_css() { |
| 592 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod' ); |
|
| 592 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__top_menu_theme_mod'); |
|
| 593 | 593 | |
| 594 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 594 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 595 | 595 | $theme_mods = lsx_customizer_colour__top_menu_get_theme_mods(); |
| 596 | - $styles = lsx_customizer_colour__top_menu_get_css( $theme_mods ); |
|
| 596 | + $styles = lsx_customizer_colour__top_menu_get_css($theme_mods); |
|
| 597 | 597 | |
| 598 | - if ( false === $styles_from_theme_mod ) { |
|
| 599 | - set_theme_mod( 'lsx_customizer_colour__top_menu_theme_mod', $styles ); |
|
| 598 | + if (false === $styles_from_theme_mod) { |
|
| 599 | + set_theme_mod('lsx_customizer_colour__top_menu_theme_mod', $styles); |
|
| 600 | 600 | } |
| 601 | 601 | } else { |
| 602 | 602 | $styles = $styles_from_theme_mod; |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 605 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 606 | 606 | } |
| 607 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__top_menu_css', 9999 ); |
|
| 607 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__top_menu_css', 9999); |
|
| 608 | 608 | |
| 609 | 609 | /** |
| 610 | 610 | * Get top menu CSS theme mods. |
@@ -613,25 +613,25 @@ discard block |
||
| 613 | 613 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 614 | 614 | |
| 615 | 615 | return array( |
| 616 | - 'top_menu_background_color' => get_theme_mod( 'top_menu_background_color', $colors['top_menu_background_color'] ), |
|
| 617 | - 'top_menu_text_color' => get_theme_mod( 'top_menu_text_color', $colors['top_menu_text_color'] ), |
|
| 618 | - 'top_menu_text_hover_color' => get_theme_mod( 'top_menu_text_hover_color', $colors['top_menu_text_hover_color'] ) |
|
| 616 | + 'top_menu_background_color' => get_theme_mod('top_menu_background_color', $colors['top_menu_background_color']), |
|
| 617 | + 'top_menu_text_color' => get_theme_mod('top_menu_text_color', $colors['top_menu_text_color']), |
|
| 618 | + 'top_menu_text_hover_color' => get_theme_mod('top_menu_text_hover_color', $colors['top_menu_text_hover_color']) |
|
| 619 | 619 | ); |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | /** |
| 623 | 623 | * Returns CSS for the top menu. |
| 624 | 624 | */ |
| 625 | -function lsx_customizer_colour__top_menu_get_css( $colors ) { |
|
| 625 | +function lsx_customizer_colour__top_menu_get_css($colors) { |
|
| 626 | 626 | global $customizer_colour_names; |
| 627 | 627 | |
| 628 | 628 | $colors_template = array(); |
| 629 | 629 | |
| 630 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 630 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 631 | 631 | $colors_template[$key] = ''; |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 634 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 635 | 635 | |
| 636 | 636 | $css = <<<CSS |
| 637 | 637 | /* |
@@ -690,8 +690,8 @@ discard block |
||
| 690 | 690 | } |
| 691 | 691 | CSS; |
| 692 | 692 | |
| 693 | - $css = apply_filters( 'lsx_customizer_colour_selectors_top_menu', $css, $colors ); |
|
| 694 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 693 | + $css = apply_filters('lsx_customizer_colour_selectors_top_menu', $css, $colors); |
|
| 694 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 695 | 695 | return $css; |
| 696 | 696 | } |
| 697 | 697 | |
@@ -704,33 +704,33 @@ discard block |
||
| 704 | 704 | */ |
| 705 | 705 | function lsx_customizer_colour__header_set_theme_mod() { |
| 706 | 706 | $theme_mods = lsx_customizer_colour__header_get_theme_mods(); |
| 707 | - $styles = lsx_customizer_colour__header_get_css( $theme_mods ); |
|
| 707 | + $styles = lsx_customizer_colour__header_get_css($theme_mods); |
|
| 708 | 708 | |
| 709 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
| 709 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
| 710 | 710 | } |
| 711 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__header_set_theme_mod' ); |
|
| 712 | -add_action( 'customize_save_after', 'lsx_customizer_colour__header_set_theme_mod' ); |
|
| 711 | +add_action('after_switch_theme', 'lsx_customizer_colour__header_set_theme_mod'); |
|
| 712 | +add_action('customize_save_after', 'lsx_customizer_colour__header_set_theme_mod'); |
|
| 713 | 713 | |
| 714 | 714 | /** |
| 715 | 715 | * Enqueues front-end CSS for the header. |
| 716 | 716 | */ |
| 717 | 717 | function lsx_customizer_colour__header_css() { |
| 718 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__header_theme_mod' ); |
|
| 718 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__header_theme_mod'); |
|
| 719 | 719 | |
| 720 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 720 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 721 | 721 | $theme_mods = lsx_customizer_colour__header_get_theme_mods(); |
| 722 | - $styles = lsx_customizer_colour__header_get_css( $theme_mods ); |
|
| 722 | + $styles = lsx_customizer_colour__header_get_css($theme_mods); |
|
| 723 | 723 | |
| 724 | - if ( false === $styles_from_theme_mod ) { |
|
| 725 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
| 724 | + if (false === $styles_from_theme_mod) { |
|
| 725 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
| 726 | 726 | } |
| 727 | 727 | } else { |
| 728 | 728 | $styles = $styles_from_theme_mod; |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 731 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 732 | 732 | } |
| 733 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__header_css', 9999 ); |
|
| 733 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__header_css', 9999); |
|
| 734 | 734 | |
| 735 | 735 | /** |
| 736 | 736 | * Get header CSS theme mods. |
@@ -739,26 +739,26 @@ discard block |
||
| 739 | 739 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 740 | 740 | |
| 741 | 741 | return array( |
| 742 | - 'header_background_color' => get_theme_mod( 'header_background_color', $colors['header_background_color'] ), |
|
| 743 | - 'header_title_color' => get_theme_mod( 'header_title_color', $colors['header_title_color'] ), |
|
| 744 | - 'header_title_hover_color' => get_theme_mod( 'header_title_hover_color', $colors['header_title_hover_color'] ), |
|
| 745 | - 'header_description_color' => get_theme_mod( 'header_description_color', $colors['header_description_color'] ) |
|
| 742 | + 'header_background_color' => get_theme_mod('header_background_color', $colors['header_background_color']), |
|
| 743 | + 'header_title_color' => get_theme_mod('header_title_color', $colors['header_title_color']), |
|
| 744 | + 'header_title_hover_color' => get_theme_mod('header_title_hover_color', $colors['header_title_hover_color']), |
|
| 745 | + 'header_description_color' => get_theme_mod('header_description_color', $colors['header_description_color']) |
|
| 746 | 746 | ); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | /** |
| 750 | 750 | * Returns CSS for the header. |
| 751 | 751 | */ |
| 752 | -function lsx_customizer_colour__header_get_css( $colors ) { |
|
| 752 | +function lsx_customizer_colour__header_get_css($colors) { |
|
| 753 | 753 | global $customizer_colour_names; |
| 754 | 754 | |
| 755 | 755 | $colors_template = array(); |
| 756 | 756 | |
| 757 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 757 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 758 | 758 | $colors_template[$key] = ''; |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 761 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 762 | 762 | |
| 763 | 763 | $css = <<<CSS |
| 764 | 764 | /* |
@@ -795,8 +795,8 @@ discard block |
||
| 795 | 795 | } |
| 796 | 796 | CSS; |
| 797 | 797 | |
| 798 | - $css = apply_filters( 'lsx_customizer_colour_selectors_header', $css, $colors ); |
|
| 799 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 798 | + $css = apply_filters('lsx_customizer_colour_selectors_header', $css, $colors); |
|
| 799 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 800 | 800 | return $css; |
| 801 | 801 | } |
| 802 | 802 | |
@@ -809,33 +809,33 @@ discard block |
||
| 809 | 809 | */ |
| 810 | 810 | function lsx_customizer_colour__main_menu_set_theme_mod() { |
| 811 | 811 | $theme_mods = lsx_customizer_colour__main_menu_get_theme_mods(); |
| 812 | - $styles = lsx_customizer_colour__main_menu_get_css( $theme_mods ); |
|
| 812 | + $styles = lsx_customizer_colour__main_menu_get_css($theme_mods); |
|
| 813 | 813 | |
| 814 | - set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles ); |
|
| 814 | + set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles); |
|
| 815 | 815 | } |
| 816 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__main_menu_set_theme_mod' ); |
|
| 817 | -add_action( 'customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod' ); |
|
| 816 | +add_action('after_switch_theme', 'lsx_customizer_colour__main_menu_set_theme_mod'); |
|
| 817 | +add_action('customize_save_after', 'lsx_customizer_colour__main_menu_set_theme_mod'); |
|
| 818 | 818 | |
| 819 | 819 | /** |
| 820 | 820 | * Enqueues front-end CSS for the main menu. |
| 821 | 821 | */ |
| 822 | 822 | function lsx_customizer_colour__main_menu_css() { |
| 823 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod' ); |
|
| 823 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__main_menu_theme_mod'); |
|
| 824 | 824 | |
| 825 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 825 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 826 | 826 | $theme_mods = lsx_customizer_colour__main_menu_get_theme_mods(); |
| 827 | - $styles = lsx_customizer_colour__main_menu_get_css( $theme_mods ); |
|
| 827 | + $styles = lsx_customizer_colour__main_menu_get_css($theme_mods); |
|
| 828 | 828 | |
| 829 | - if ( false === $styles_from_theme_mod ) { |
|
| 830 | - set_theme_mod( 'lsx_customizer_colour__main_menu_theme_mod', $styles ); |
|
| 829 | + if (false === $styles_from_theme_mod) { |
|
| 830 | + set_theme_mod('lsx_customizer_colour__main_menu_theme_mod', $styles); |
|
| 831 | 831 | } |
| 832 | 832 | } else { |
| 833 | 833 | $styles = $styles_from_theme_mod; |
| 834 | 834 | } |
| 835 | 835 | |
| 836 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 836 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 837 | 837 | } |
| 838 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__main_menu_css', 9999 ); |
|
| 838 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__main_menu_css', 9999); |
|
| 839 | 839 | |
| 840 | 840 | /** |
| 841 | 841 | * Get main menu CSS theme mods. |
@@ -844,27 +844,27 @@ discard block |
||
| 844 | 844 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 845 | 845 | |
| 846 | 846 | return array( |
| 847 | - 'main_menu_background_hover1_color' => get_theme_mod( 'main_menu_background_hover1_color', $colors['main_menu_background_hover1_color'] ), |
|
| 848 | - 'main_menu_background_hover2_color' => get_theme_mod( 'main_menu_background_hover2_color', $colors['main_menu_background_hover2_color'] ), |
|
| 849 | - 'main_menu_text_color' => get_theme_mod( 'main_menu_text_color', $colors['main_menu_text_color'] ), |
|
| 850 | - 'main_menu_text_hover1_color' => get_theme_mod( 'main_menu_text_hover1_color', $colors['main_menu_text_hover1_color'] ), |
|
| 851 | - 'main_menu_text_hover2_color' => get_theme_mod( 'main_menu_text_hover2_color', $colors['main_menu_text_hover2_color'] ) |
|
| 847 | + 'main_menu_background_hover1_color' => get_theme_mod('main_menu_background_hover1_color', $colors['main_menu_background_hover1_color']), |
|
| 848 | + 'main_menu_background_hover2_color' => get_theme_mod('main_menu_background_hover2_color', $colors['main_menu_background_hover2_color']), |
|
| 849 | + 'main_menu_text_color' => get_theme_mod('main_menu_text_color', $colors['main_menu_text_color']), |
|
| 850 | + 'main_menu_text_hover1_color' => get_theme_mod('main_menu_text_hover1_color', $colors['main_menu_text_hover1_color']), |
|
| 851 | + 'main_menu_text_hover2_color' => get_theme_mod('main_menu_text_hover2_color', $colors['main_menu_text_hover2_color']) |
|
| 852 | 852 | ); |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | /** |
| 856 | 856 | * Returns CSS for the main menu. |
| 857 | 857 | */ |
| 858 | -function lsx_customizer_colour__main_menu_get_css( $colors ) { |
|
| 858 | +function lsx_customizer_colour__main_menu_get_css($colors) { |
|
| 859 | 859 | global $customizer_colour_names; |
| 860 | 860 | |
| 861 | 861 | $colors_template = array(); |
| 862 | 862 | |
| 863 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 863 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 864 | 864 | $colors_template[$key] = ''; |
| 865 | 865 | } |
| 866 | 866 | |
| 867 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 867 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 868 | 868 | |
| 869 | 869 | $css = <<<CSS |
| 870 | 870 | /* |
@@ -954,8 +954,8 @@ discard block |
||
| 954 | 954 | } |
| 955 | 955 | CSS; |
| 956 | 956 | |
| 957 | - $css = apply_filters( 'lsx_customizer_colour_selectors_main_menu', $css, $colors ); |
|
| 958 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 957 | + $css = apply_filters('lsx_customizer_colour_selectors_main_menu', $css, $colors); |
|
| 958 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 959 | 959 | return $css; |
| 960 | 960 | } |
| 961 | 961 | |
@@ -968,33 +968,33 @@ discard block |
||
| 968 | 968 | */ |
| 969 | 969 | function lsx_customizer_colour__banner_set_theme_mod() { |
| 970 | 970 | $theme_mods = lsx_customizer_colour__banner_get_theme_mods(); |
| 971 | - $styles = lsx_customizer_colour__banner_get_css( $theme_mods ); |
|
| 971 | + $styles = lsx_customizer_colour__banner_get_css($theme_mods); |
|
| 972 | 972 | |
| 973 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
| 973 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
| 974 | 974 | } |
| 975 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__banner_set_theme_mod' ); |
|
| 976 | -add_action( 'customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod' ); |
|
| 975 | +add_action('after_switch_theme', 'lsx_customizer_colour__banner_set_theme_mod'); |
|
| 976 | +add_action('customize_save_after', 'lsx_customizer_colour__banner_set_theme_mod'); |
|
| 977 | 977 | |
| 978 | 978 | /** |
| 979 | 979 | * Enqueues front-end CSS for the banner. |
| 980 | 980 | */ |
| 981 | 981 | function lsx_customizer_colour__banner_css() { |
| 982 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__banner_theme_mod' ); |
|
| 982 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__banner_theme_mod'); |
|
| 983 | 983 | |
| 984 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 984 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 985 | 985 | $theme_mods = lsx_customizer_colour__banner_get_theme_mods(); |
| 986 | - $styles = lsx_customizer_colour__banner_get_css( $theme_mods ); |
|
| 986 | + $styles = lsx_customizer_colour__banner_get_css($theme_mods); |
|
| 987 | 987 | |
| 988 | - if ( false === $styles_from_theme_mod ) { |
|
| 989 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
| 988 | + if (false === $styles_from_theme_mod) { |
|
| 989 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
| 990 | 990 | } |
| 991 | 991 | } else { |
| 992 | 992 | $styles = $styles_from_theme_mod; |
| 993 | 993 | } |
| 994 | 994 | |
| 995 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 995 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 996 | 996 | } |
| 997 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__banner_css', 9999 ); |
|
| 997 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__banner_css', 9999); |
|
| 998 | 998 | |
| 999 | 999 | /** |
| 1000 | 1000 | * Get banner CSS theme mods. |
@@ -1003,25 +1003,25 @@ discard block |
||
| 1003 | 1003 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 1004 | 1004 | |
| 1005 | 1005 | return array( |
| 1006 | - 'banner_background_color' => get_theme_mod( 'banner_background_color', $colors['banner_background_color'] ), |
|
| 1007 | - 'banner_text_color' => get_theme_mod( 'banner_text_color', $colors['banner_text_color'] ), |
|
| 1008 | - 'banner_text_image_color' => get_theme_mod( 'banner_text_image_color', $colors['banner_text_image_color'] ) |
|
| 1006 | + 'banner_background_color' => get_theme_mod('banner_background_color', $colors['banner_background_color']), |
|
| 1007 | + 'banner_text_color' => get_theme_mod('banner_text_color', $colors['banner_text_color']), |
|
| 1008 | + 'banner_text_image_color' => get_theme_mod('banner_text_image_color', $colors['banner_text_image_color']) |
|
| 1009 | 1009 | ); |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | /** |
| 1013 | 1013 | * Returns CSS for the banner. |
| 1014 | 1014 | */ |
| 1015 | -function lsx_customizer_colour__banner_get_css( $colors ) { |
|
| 1015 | +function lsx_customizer_colour__banner_get_css($colors) { |
|
| 1016 | 1016 | global $customizer_colour_names; |
| 1017 | 1017 | |
| 1018 | 1018 | $colors_template = array(); |
| 1019 | 1019 | |
| 1020 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1020 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1021 | 1021 | $colors_template[$key] = ''; |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1024 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1025 | 1025 | |
| 1026 | 1026 | $css = <<<CSS |
| 1027 | 1027 | /* |
@@ -1050,8 +1050,8 @@ discard block |
||
| 1050 | 1050 | } |
| 1051 | 1051 | CSS; |
| 1052 | 1052 | |
| 1053 | - $css = apply_filters( 'lsx_customizer_colour_selectors_banner', $css, $colors ); |
|
| 1054 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1053 | + $css = apply_filters('lsx_customizer_colour_selectors_banner', $css, $colors); |
|
| 1054 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1055 | 1055 | return $css; |
| 1056 | 1056 | } |
| 1057 | 1057 | |
@@ -1064,33 +1064,33 @@ discard block |
||
| 1064 | 1064 | */ |
| 1065 | 1065 | function lsx_customizer_colour__body_set_theme_mod() { |
| 1066 | 1066 | $theme_mods = lsx_customizer_colour__body_get_theme_mods(); |
| 1067 | - $styles = lsx_customizer_colour__body_get_css( $theme_mods ); |
|
| 1067 | + $styles = lsx_customizer_colour__body_get_css($theme_mods); |
|
| 1068 | 1068 | |
| 1069 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
| 1069 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
| 1070 | 1070 | } |
| 1071 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__body_set_theme_mod' ); |
|
| 1072 | -add_action( 'customize_save_after', 'lsx_customizer_colour__body_set_theme_mod' ); |
|
| 1071 | +add_action('after_switch_theme', 'lsx_customizer_colour__body_set_theme_mod'); |
|
| 1072 | +add_action('customize_save_after', 'lsx_customizer_colour__body_set_theme_mod'); |
|
| 1073 | 1073 | |
| 1074 | 1074 | /** |
| 1075 | 1075 | * Enqueues front-end CSS for the body. |
| 1076 | 1076 | */ |
| 1077 | 1077 | function lsx_customizer_colour__body_css() { |
| 1078 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__body_theme_mod' ); |
|
| 1078 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__body_theme_mod'); |
|
| 1079 | 1079 | |
| 1080 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1080 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1081 | 1081 | $theme_mods = lsx_customizer_colour__body_get_theme_mods(); |
| 1082 | - $styles = lsx_customizer_colour__body_get_css( $theme_mods ); |
|
| 1082 | + $styles = lsx_customizer_colour__body_get_css($theme_mods); |
|
| 1083 | 1083 | |
| 1084 | - if ( false === $styles_from_theme_mod ) { |
|
| 1085 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
| 1084 | + if (false === $styles_from_theme_mod) { |
|
| 1085 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
| 1086 | 1086 | } |
| 1087 | 1087 | } else { |
| 1088 | 1088 | $styles = $styles_from_theme_mod; |
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1091 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1092 | 1092 | } |
| 1093 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__body_css', 9999 ); |
|
| 1093 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__body_css', 9999); |
|
| 1094 | 1094 | |
| 1095 | 1095 | /** |
| 1096 | 1096 | * Get body CSS theme mods. |
@@ -1098,39 +1098,39 @@ discard block |
||
| 1098 | 1098 | function lsx_customizer_colour__body_get_theme_mods() { |
| 1099 | 1099 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 1100 | 1100 | |
| 1101 | - $background_color = get_theme_mod( 'background_color', $colors['background_color'] ); |
|
| 1101 | + $background_color = get_theme_mod('background_color', $colors['background_color']); |
|
| 1102 | 1102 | |
| 1103 | - if ( '#' !== substr( $background_color, 0, 1 ) ) { |
|
| 1103 | + if ('#' !== substr($background_color, 0, 1)) { |
|
| 1104 | 1104 | $background_color = '#' . $background_color; |
| 1105 | 1105 | } |
| 1106 | 1106 | |
| 1107 | 1107 | return array( |
| 1108 | 1108 | 'background_color' => $background_color, |
| 1109 | - 'body_line_color' => get_theme_mod( 'body_line_color', $colors['body_line_color'] ), |
|
| 1110 | - 'body_text_heading_color' => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ), |
|
| 1111 | - 'body_text_color' => get_theme_mod( 'body_text_color', $colors['body_text_color'] ), |
|
| 1112 | - 'body_link_color' => get_theme_mod( 'body_link_color', $colors['body_link_color'] ), |
|
| 1113 | - 'body_link_hover_color' => get_theme_mod( 'body_link_hover_color', $colors['body_link_hover_color'] ), |
|
| 1114 | - 'body_section_full_background_color' => get_theme_mod( 'body_section_full_background_color', $colors['body_section_full_background_color'] ), |
|
| 1115 | - 'body_section_full_text_color' => get_theme_mod( 'body_section_full_text_color', $colors['body_section_full_text_color'] ), |
|
| 1116 | - 'body_section_full_cta_background_color' => get_theme_mod( 'body_section_full_cta_background_color', $colors['body_section_full_cta_background_color'] ), |
|
| 1117 | - 'body_section_full_cta_text_color' => get_theme_mod( 'body_section_full_cta_text_color', $colors['body_section_full_cta_text_color'] ) |
|
| 1109 | + 'body_line_color' => get_theme_mod('body_line_color', $colors['body_line_color']), |
|
| 1110 | + 'body_text_heading_color' => get_theme_mod('body_text_heading_color', $colors['body_text_heading_color']), |
|
| 1111 | + 'body_text_color' => get_theme_mod('body_text_color', $colors['body_text_color']), |
|
| 1112 | + 'body_link_color' => get_theme_mod('body_link_color', $colors['body_link_color']), |
|
| 1113 | + 'body_link_hover_color' => get_theme_mod('body_link_hover_color', $colors['body_link_hover_color']), |
|
| 1114 | + 'body_section_full_background_color' => get_theme_mod('body_section_full_background_color', $colors['body_section_full_background_color']), |
|
| 1115 | + 'body_section_full_text_color' => get_theme_mod('body_section_full_text_color', $colors['body_section_full_text_color']), |
|
| 1116 | + 'body_section_full_cta_background_color' => get_theme_mod('body_section_full_cta_background_color', $colors['body_section_full_cta_background_color']), |
|
| 1117 | + 'body_section_full_cta_text_color' => get_theme_mod('body_section_full_cta_text_color', $colors['body_section_full_cta_text_color']) |
|
| 1118 | 1118 | ); |
| 1119 | 1119 | } |
| 1120 | 1120 | |
| 1121 | 1121 | /** |
| 1122 | 1122 | * Returns CSS for the body. |
| 1123 | 1123 | */ |
| 1124 | -function lsx_customizer_colour__body_get_css( $colors ) { |
|
| 1124 | +function lsx_customizer_colour__body_get_css($colors) { |
|
| 1125 | 1125 | global $customizer_colour_names; |
| 1126 | 1126 | |
| 1127 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1127 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1128 | 1128 | $colors_template[$key] = ''; |
| 1129 | 1129 | } |
| 1130 | 1130 | |
| 1131 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1131 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1132 | 1132 | |
| 1133 | - $rgb = lsx_customizer_colour__hex2rgb( $colors['body_line_color'] ); |
|
| 1133 | + $rgb = lsx_customizer_colour__hex2rgb($colors['body_line_color']); |
|
| 1134 | 1134 | $colors['body_line_color_rgba'] = "rgba({$rgb['red']}, {$rgb['green']}, {$rgb['blue']}, 0.5)"; |
| 1135 | 1135 | |
| 1136 | 1136 | $css = <<<CSS |
@@ -1410,8 +1410,8 @@ discard block |
||
| 1410 | 1410 | } |
| 1411 | 1411 | CSS; |
| 1412 | 1412 | |
| 1413 | - $css = apply_filters( 'lsx_customizer_colour_selectors_body', $css, $colors ); |
|
| 1414 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1413 | + $css = apply_filters('lsx_customizer_colour_selectors_body', $css, $colors); |
|
| 1414 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1415 | 1415 | |
| 1416 | 1416 | return $css; |
| 1417 | 1417 | } |
@@ -1425,33 +1425,33 @@ discard block |
||
| 1425 | 1425 | */ |
| 1426 | 1426 | function lsx_customizer_colour__footer_cta_set_theme_mod() { |
| 1427 | 1427 | $theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods(); |
| 1428 | - $styles = lsx_customizer_colour__footer_cta_get_css( $theme_mods ); |
|
| 1428 | + $styles = lsx_customizer_colour__footer_cta_get_css($theme_mods); |
|
| 1429 | 1429 | |
| 1430 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
| 1430 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
| 1431 | 1431 | } |
| 1432 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_cta_set_theme_mod' ); |
|
| 1433 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod' ); |
|
| 1432 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_cta_set_theme_mod'); |
|
| 1433 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_cta_set_theme_mod'); |
|
| 1434 | 1434 | |
| 1435 | 1435 | /** |
| 1436 | 1436 | * Enqueues front-end CSS for the footer cta. |
| 1437 | 1437 | */ |
| 1438 | 1438 | function lsx_customizer_colour__footer_cta_css() { |
| 1439 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod' ); |
|
| 1439 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_cta_theme_mod'); |
|
| 1440 | 1440 | |
| 1441 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1441 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1442 | 1442 | $theme_mods = lsx_customizer_colour__footer_cta_get_theme_mods(); |
| 1443 | - $styles = lsx_customizer_colour__footer_cta_get_css( $theme_mods ); |
|
| 1443 | + $styles = lsx_customizer_colour__footer_cta_get_css($theme_mods); |
|
| 1444 | 1444 | |
| 1445 | - if ( false === $styles_from_theme_mod ) { |
|
| 1446 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
| 1445 | + if (false === $styles_from_theme_mod) { |
|
| 1446 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
| 1447 | 1447 | } |
| 1448 | 1448 | } else { |
| 1449 | 1449 | $styles = $styles_from_theme_mod; |
| 1450 | 1450 | } |
| 1451 | 1451 | |
| 1452 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1452 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1453 | 1453 | } |
| 1454 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__footer_cta_css', 9999 ); |
|
| 1454 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__footer_cta_css', 9999); |
|
| 1455 | 1455 | |
| 1456 | 1456 | /** |
| 1457 | 1457 | * Get footer cta CSS theme mods. |
@@ -1460,26 +1460,26 @@ discard block |
||
| 1460 | 1460 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 1461 | 1461 | |
| 1462 | 1462 | return array( |
| 1463 | - 'footer_cta_background_color' => get_theme_mod( 'footer_cta_background_color', $colors['footer_cta_background_color'] ), |
|
| 1464 | - 'footer_cta_text_color' => get_theme_mod( 'footer_cta_text_color', $colors['footer_cta_text_color'] ), |
|
| 1465 | - 'footer_cta_link_color' => get_theme_mod( 'footer_cta_link_color', $colors['footer_cta_link_color'] ), |
|
| 1466 | - 'footer_cta_link_hover_color' => get_theme_mod( 'footer_cta_link_hover_color', $colors['footer_cta_link_hover_color'] ) |
|
| 1463 | + 'footer_cta_background_color' => get_theme_mod('footer_cta_background_color', $colors['footer_cta_background_color']), |
|
| 1464 | + 'footer_cta_text_color' => get_theme_mod('footer_cta_text_color', $colors['footer_cta_text_color']), |
|
| 1465 | + 'footer_cta_link_color' => get_theme_mod('footer_cta_link_color', $colors['footer_cta_link_color']), |
|
| 1466 | + 'footer_cta_link_hover_color' => get_theme_mod('footer_cta_link_hover_color', $colors['footer_cta_link_hover_color']) |
|
| 1467 | 1467 | ); |
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | 1470 | /** |
| 1471 | 1471 | * Returns CSS for the footer cta. |
| 1472 | 1472 | */ |
| 1473 | -function lsx_customizer_colour__footer_cta_get_css( $colors ) { |
|
| 1473 | +function lsx_customizer_colour__footer_cta_get_css($colors) { |
|
| 1474 | 1474 | global $customizer_colour_names; |
| 1475 | 1475 | |
| 1476 | 1476 | $colors_template = array(); |
| 1477 | 1477 | |
| 1478 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1478 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1479 | 1479 | $colors_template[$key] = ''; |
| 1480 | 1480 | } |
| 1481 | 1481 | |
| 1482 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1482 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1483 | 1483 | |
| 1484 | 1484 | $css = <<<CSS |
| 1485 | 1485 | /* |
@@ -1514,8 +1514,8 @@ discard block |
||
| 1514 | 1514 | } |
| 1515 | 1515 | CSS; |
| 1516 | 1516 | |
| 1517 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_cta', $css, $colors ); |
|
| 1518 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1517 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_cta', $css, $colors); |
|
| 1518 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1519 | 1519 | return $css; |
| 1520 | 1520 | } |
| 1521 | 1521 | |
@@ -1527,33 +1527,33 @@ discard block |
||
| 1527 | 1527 | */ |
| 1528 | 1528 | function lsx_customizer_colour__footer_widgets_set_theme_mod() { |
| 1529 | 1529 | $theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods(); |
| 1530 | - $styles = lsx_customizer_colour__footer_widgets_get_css( $theme_mods ); |
|
| 1530 | + $styles = lsx_customizer_colour__footer_widgets_get_css($theme_mods); |
|
| 1531 | 1531 | |
| 1532 | - set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles ); |
|
| 1532 | + set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles); |
|
| 1533 | 1533 | } |
| 1534 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_widgets_set_theme_mod' ); |
|
| 1535 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod' ); |
|
| 1534 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_widgets_set_theme_mod'); |
|
| 1535 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_widgets_set_theme_mod'); |
|
| 1536 | 1536 | |
| 1537 | 1537 | /** |
| 1538 | 1538 | * Enqueues front-end CSS for the footer widgets. |
| 1539 | 1539 | */ |
| 1540 | 1540 | function lsx_customizer_colour__footer_widgets_css() { |
| 1541 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod' ); |
|
| 1541 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod'); |
|
| 1542 | 1542 | |
| 1543 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1543 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1544 | 1544 | $theme_mods = lsx_customizer_colour__footer_widgets_get_theme_mods(); |
| 1545 | - $styles = lsx_customizer_colour__footer_widgets_get_css( $theme_mods ); |
|
| 1545 | + $styles = lsx_customizer_colour__footer_widgets_get_css($theme_mods); |
|
| 1546 | 1546 | |
| 1547 | - if ( false === $styles_from_theme_mod ) { |
|
| 1548 | - set_theme_mod( 'lsx_customizer_colour__footer_widgets_theme_mod', $styles ); |
|
| 1547 | + if (false === $styles_from_theme_mod) { |
|
| 1548 | + set_theme_mod('lsx_customizer_colour__footer_widgets_theme_mod', $styles); |
|
| 1549 | 1549 | } |
| 1550 | 1550 | } else { |
| 1551 | 1551 | $styles = $styles_from_theme_mod; |
| 1552 | 1552 | } |
| 1553 | 1553 | |
| 1554 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1554 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1555 | 1555 | } |
| 1556 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__footer_widgets_css', 9999 ); |
|
| 1556 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__footer_widgets_css', 9999); |
|
| 1557 | 1557 | |
| 1558 | 1558 | /** |
| 1559 | 1559 | * Get footer widgets CSS theme mods. |
@@ -1562,26 +1562,26 @@ discard block |
||
| 1562 | 1562 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 1563 | 1563 | |
| 1564 | 1564 | return array( |
| 1565 | - 'footer_widgets_background_color' => get_theme_mod( 'footer_widgets_background_color', $colors['footer_widgets_background_color'] ), |
|
| 1566 | - 'footer_widgets_text_color' => get_theme_mod( 'footer_widgets_text_color', $colors['footer_widgets_text_color'] ), |
|
| 1567 | - 'footer_widgets_link_color' => get_theme_mod( 'footer_widgets_link_color', $colors['footer_widgets_link_color'] ), |
|
| 1568 | - 'footer_widgets_link_hover_color' => get_theme_mod( 'footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color'] ) |
|
| 1565 | + 'footer_widgets_background_color' => get_theme_mod('footer_widgets_background_color', $colors['footer_widgets_background_color']), |
|
| 1566 | + 'footer_widgets_text_color' => get_theme_mod('footer_widgets_text_color', $colors['footer_widgets_text_color']), |
|
| 1567 | + 'footer_widgets_link_color' => get_theme_mod('footer_widgets_link_color', $colors['footer_widgets_link_color']), |
|
| 1568 | + 'footer_widgets_link_hover_color' => get_theme_mod('footer_widgets_link_hover_color', $colors['footer_widgets_link_hover_color']) |
|
| 1569 | 1569 | ); |
| 1570 | 1570 | } |
| 1571 | 1571 | |
| 1572 | 1572 | /** |
| 1573 | 1573 | * Returns CSS for the footer widgets. |
| 1574 | 1574 | */ |
| 1575 | -function lsx_customizer_colour__footer_widgets_get_css( $colors ) { |
|
| 1575 | +function lsx_customizer_colour__footer_widgets_get_css($colors) { |
|
| 1576 | 1576 | global $customizer_colour_names; |
| 1577 | 1577 | |
| 1578 | 1578 | $colors_template = array(); |
| 1579 | 1579 | |
| 1580 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1580 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1581 | 1581 | $colors_template[$key] = ''; |
| 1582 | 1582 | } |
| 1583 | 1583 | |
| 1584 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1584 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1585 | 1585 | |
| 1586 | 1586 | $css = <<<CSS |
| 1587 | 1587 | /* |
@@ -1620,8 +1620,8 @@ discard block |
||
| 1620 | 1620 | } |
| 1621 | 1621 | CSS; |
| 1622 | 1622 | |
| 1623 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_widgets', $css, $colors ); |
|
| 1624 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1623 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_widgets', $css, $colors); |
|
| 1624 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1625 | 1625 | return $css; |
| 1626 | 1626 | } |
| 1627 | 1627 | |
@@ -1633,33 +1633,33 @@ discard block |
||
| 1633 | 1633 | */ |
| 1634 | 1634 | function lsx_customizer_colour__footer_set_theme_mod() { |
| 1635 | 1635 | $theme_mods = lsx_customizer_colour__footer_get_theme_mods(); |
| 1636 | - $styles = lsx_customizer_colour__footer_get_css( $theme_mods ); |
|
| 1636 | + $styles = lsx_customizer_colour__footer_get_css($theme_mods); |
|
| 1637 | 1637 | |
| 1638 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
| 1638 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
| 1639 | 1639 | } |
| 1640 | -add_action( 'after_switch_theme', 'lsx_customizer_colour__footer_set_theme_mod' ); |
|
| 1641 | -add_action( 'customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod' ); |
|
| 1640 | +add_action('after_switch_theme', 'lsx_customizer_colour__footer_set_theme_mod'); |
|
| 1641 | +add_action('customize_save_after', 'lsx_customizer_colour__footer_set_theme_mod'); |
|
| 1642 | 1642 | |
| 1643 | 1643 | /** |
| 1644 | 1644 | * Enqueues front-end CSS for the footer. |
| 1645 | 1645 | */ |
| 1646 | 1646 | function lsx_customizer_colour__footer_css() { |
| 1647 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_theme_mod' ); |
|
| 1647 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_theme_mod'); |
|
| 1648 | 1648 | |
| 1649 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 1649 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 1650 | 1650 | $theme_mods = lsx_customizer_colour__footer_get_theme_mods(); |
| 1651 | - $styles = lsx_customizer_colour__footer_get_css( $theme_mods ); |
|
| 1651 | + $styles = lsx_customizer_colour__footer_get_css($theme_mods); |
|
| 1652 | 1652 | |
| 1653 | - if ( false === $styles_from_theme_mod ) { |
|
| 1654 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
| 1653 | + if (false === $styles_from_theme_mod) { |
|
| 1654 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
| 1655 | 1655 | } |
| 1656 | 1656 | } else { |
| 1657 | 1657 | $styles = $styles_from_theme_mod; |
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | - wp_add_inline_style( 'lsx_customizer_colour', $styles ); |
|
| 1660 | + wp_add_inline_style('lsx_customizer_colour', $styles); |
|
| 1661 | 1661 | } |
| 1662 | -add_action( 'wp_enqueue_scripts', 'lsx_customizer_colour__footer_css', 9999 ); |
|
| 1662 | +add_action('wp_enqueue_scripts', 'lsx_customizer_colour__footer_css', 9999); |
|
| 1663 | 1663 | |
| 1664 | 1664 | /** |
| 1665 | 1665 | * Get footer CSS theme mods. |
@@ -1668,26 +1668,26 @@ discard block |
||
| 1668 | 1668 | $colors = lsx_customizer_colour__get_color_scheme(); |
| 1669 | 1669 | |
| 1670 | 1670 | return array( |
| 1671 | - 'footer_background_color' => get_theme_mod( 'footer_background_color', $colors['footer_background_color'] ), |
|
| 1672 | - 'footer_text_color' => get_theme_mod( 'footer_text_color', $colors['footer_text_color'] ), |
|
| 1673 | - 'footer_link_color' => get_theme_mod( 'footer_link_color', $colors['footer_link_color'] ), |
|
| 1674 | - 'footer_link_hover_color' => get_theme_mod( 'footer_link_hover_color', $colors['footer_link_hover_color'] ) |
|
| 1671 | + 'footer_background_color' => get_theme_mod('footer_background_color', $colors['footer_background_color']), |
|
| 1672 | + 'footer_text_color' => get_theme_mod('footer_text_color', $colors['footer_text_color']), |
|
| 1673 | + 'footer_link_color' => get_theme_mod('footer_link_color', $colors['footer_link_color']), |
|
| 1674 | + 'footer_link_hover_color' => get_theme_mod('footer_link_hover_color', $colors['footer_link_hover_color']) |
|
| 1675 | 1675 | ); |
| 1676 | 1676 | } |
| 1677 | 1677 | |
| 1678 | 1678 | /** |
| 1679 | 1679 | * Returns CSS for the footer. |
| 1680 | 1680 | */ |
| 1681 | -function lsx_customizer_colour__footer_get_css( $colors ) { |
|
| 1681 | +function lsx_customizer_colour__footer_get_css($colors) { |
|
| 1682 | 1682 | global $customizer_colour_names; |
| 1683 | 1683 | |
| 1684 | 1684 | $colors_template = array(); |
| 1685 | 1685 | |
| 1686 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1686 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1687 | 1687 | $colors_template[$key] = ''; |
| 1688 | 1688 | } |
| 1689 | 1689 | |
| 1690 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 1690 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 1691 | 1691 | |
| 1692 | 1692 | $css = <<<CSS |
| 1693 | 1693 | /* |
@@ -1727,8 +1727,8 @@ discard block |
||
| 1727 | 1727 | } |
| 1728 | 1728 | CSS; |
| 1729 | 1729 | |
| 1730 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer', $css, $colors ); |
|
| 1731 | - $css = lsx_customizer_colour__scss_to_css( $css ); |
|
| 1730 | + $css = apply_filters('lsx_customizer_colour_selectors_footer', $css, $colors); |
|
| 1731 | + $css = lsx_customizer_colour__scss_to_css($css); |
|
| 1732 | 1732 | return $css; |
| 1733 | 1733 | } |
| 1734 | 1734 | |
@@ -1740,7 +1740,7 @@ discard block |
||
| 1740 | 1740 | * Customize Colour Control Class |
| 1741 | 1741 | */ |
| 1742 | 1742 | |
| 1743 | -if ( ! class_exists( 'WP_Customize_Control' ) ) { |
|
| 1743 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 1744 | 1744 | return; |
| 1745 | 1745 | } |
| 1746 | 1746 | |
@@ -1750,37 +1750,37 @@ discard block |
||
| 1750 | 1750 | * Enqueue control related scripts/styles. |
| 1751 | 1751 | */ |
| 1752 | 1752 | public function enqueue() { |
| 1753 | - wp_enqueue_script( 'lsx-colour-control', get_template_directory_uri() .'/js/customizer-colour.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), null, true ); |
|
| 1754 | - wp_localize_script( 'lsx-colour-control', 'colorScheme', $this->choices ); |
|
| 1753 | + wp_enqueue_script('lsx-colour-control', get_template_directory_uri() . '/js/customizer-colour.js', array('customize-controls', 'iris', 'underscore', 'wp-util'), null, true); |
|
| 1754 | + wp_localize_script('lsx-colour-control', 'colorScheme', $this->choices); |
|
| 1755 | 1755 | |
| 1756 | 1756 | global $customizer_colour_names; |
| 1757 | 1757 | $colors = array(); |
| 1758 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 1758 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 1759 | 1759 | $colors[] = $key; |
| 1760 | 1760 | } |
| 1761 | - wp_localize_script( 'lsx-colour-control', 'colorSchemeKeys', $colors ); |
|
| 1761 | + wp_localize_script('lsx-colour-control', 'colorSchemeKeys', $colors); |
|
| 1762 | 1762 | } |
| 1763 | 1763 | |
| 1764 | 1764 | /** |
| 1765 | 1765 | * Render the control's content. |
| 1766 | 1766 | */ |
| 1767 | 1767 | public function render_content() { |
| 1768 | - if ( empty( $this->choices ) ) { |
|
| 1768 | + if (empty($this->choices)) { |
|
| 1769 | 1769 | return; |
| 1770 | 1770 | } |
| 1771 | 1771 | |
| 1772 | 1772 | ?> |
| 1773 | 1773 | <label> |
| 1774 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 1775 | - <span class="customize-control-title"><?php echo esc_html( $this->label ) ?></span> |
|
| 1774 | + <?php if ( ! empty($this->label)) { ?> |
|
| 1775 | + <span class="customize-control-title"><?php echo esc_html($this->label) ?></span> |
|
| 1776 | 1776 | <?php } |
| 1777 | - if ( ! empty( $this->description ) ) { ?> |
|
| 1778 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ) ?></span> |
|
| 1777 | + if ( ! empty($this->description)) { ?> |
|
| 1778 | + <span class="description customize-control-description"><?php echo esc_html($this->description) ?></span> |
|
| 1779 | 1779 | <?php } ?> |
| 1780 | 1780 | <select <?php $this->link() ?>> |
| 1781 | 1781 | <?php |
| 1782 | - foreach ( $this->choices as $value => $label ) { |
|
| 1783 | - echo '<option value="'. esc_attr( $value ) .'"'. selected( $this->value(), $value, false ) .'>'. esc_html( $label['label'] ) .'</option>'; |
|
| 1782 | + foreach ($this->choices as $value => $label) { |
|
| 1783 | + echo '<option value="' . esc_attr($value) . '"' . selected($this->value(), $value, false) . '>' . esc_html($label['label']) . '</option>'; |
|
| 1784 | 1784 | } |
| 1785 | 1785 | ?> |
| 1786 | 1786 | </select> |
@@ -1,5 +1,5 @@ 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 | * Theme Configuration File |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * @package lsx |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( ! function_exists( 'lsx_setup' ) ) : |
|
| 11 | +if ( ! function_exists('lsx_setup')) : |
|
| 12 | 12 | /** |
| 13 | 13 | * Sets up theme defaults and registers support for various WordPress features. |
| 14 | 14 | * |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | function lsx_setup() { |
| 20 | 20 | global $content_width; |
| 21 | 21 | |
| 22 | - load_theme_textdomain( 'lsx', get_template_directory() . '/languages' ); |
|
| 22 | + load_theme_textdomain('lsx', get_template_directory() . '/languages'); |
|
| 23 | 23 | |
| 24 | 24 | $args = array( |
| 25 | 25 | 'header-text' => array( |
@@ -28,51 +28,51 @@ discard block |
||
| 28 | 28 | ), |
| 29 | 29 | 'size' => 'medium', |
| 30 | 30 | ); |
| 31 | - add_theme_support( 'site-logo', $args ); |
|
| 31 | + add_theme_support('site-logo', $args); |
|
| 32 | 32 | |
| 33 | - add_theme_support( 'custom-logo', array( |
|
| 33 | + add_theme_support('custom-logo', array( |
|
| 34 | 34 | 'height' => 50, |
| 35 | 35 | 'width' => 150, |
| 36 | 36 | 'flex-width' => true, |
| 37 | 37 | 'flex-height' => true, |
| 38 | - ) ); |
|
| 38 | + )); |
|
| 39 | 39 | |
| 40 | - add_theme_support( 'custom-background' ); |
|
| 41 | - add_theme_support( 'automatic-feed-links' ); |
|
| 42 | - add_theme_support( 'title-tag' ); |
|
| 43 | - add_theme_support( 'post-thumbnails' ); |
|
| 44 | - add_theme_support( 'post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside') ); |
|
| 40 | + add_theme_support('custom-background'); |
|
| 41 | + add_theme_support('automatic-feed-links'); |
|
| 42 | + add_theme_support('title-tag'); |
|
| 43 | + add_theme_support('post-thumbnails'); |
|
| 44 | + add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside')); |
|
| 45 | 45 | |
| 46 | 46 | // This theme uses wp_nav_menu() in one location. |
| 47 | - register_nav_menus( array( |
|
| 48 | - 'primary' => __( 'Primary Menu', 'lsx' ), |
|
| 49 | - 'top-menu'=> __( 'Top Menu' , 'lsx' ), |
|
| 50 | - 'social'=> __( 'Social Menu' , 'lsx' ), |
|
| 51 | - 'footer'=> __( 'Footer Menu' , 'lsx' ) |
|
| 52 | - ) ); |
|
| 47 | + register_nav_menus(array( |
|
| 48 | + 'primary' => __('Primary Menu', 'lsx'), |
|
| 49 | + 'top-menu'=> __('Top Menu', 'lsx'), |
|
| 50 | + 'social'=> __('Social Menu', 'lsx'), |
|
| 51 | + 'footer'=> __('Footer Menu', 'lsx') |
|
| 52 | + )); |
|
| 53 | 53 | |
| 54 | 54 | //Set the content width |
| 55 | 55 | $content_width = 1140; |
| 56 | 56 | |
| 57 | - add_editor_style( get_template_directory_uri() . '/css/editor-style.css' ); |
|
| 58 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
| 57 | + add_editor_style(get_template_directory_uri() . '/css/editor-style.css'); |
|
| 58 | + add_theme_support('html5', array('caption')); |
|
| 59 | 59 | |
| 60 | - add_theme_support( 'woocommerce' ); |
|
| 61 | - add_theme_support( 'sensei' ); |
|
| 60 | + add_theme_support('woocommerce'); |
|
| 61 | + add_theme_support('sensei'); |
|
| 62 | 62 | } |
| 63 | 63 | endif; // lsx_setup |
| 64 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
| 64 | +add_action('after_setup_theme', 'lsx_setup'); |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Removes the "Custom Fields" meta box. |
| 68 | 68 | */ |
| 69 | 69 | function lsx_remove_meta_boxes() { |
| 70 | 70 | $post_types = get_post_types(); |
| 71 | - foreach($post_types as $post_type){ |
|
| 72 | - remove_meta_box( 'postcustom' , $post_type , 'normal' ); |
|
| 71 | + foreach ($post_types as $post_type) { |
|
| 72 | + remove_meta_box('postcustom', $post_type, 'normal'); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | -add_action( 'admin_menu' , 'lsx_remove_meta_boxes' ); |
|
| 75 | +add_action('admin_menu', 'lsx_remove_meta_boxes'); |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -84,33 +84,33 @@ discard block |
||
| 84 | 84 | function lsx_process_content_width() { |
| 85 | 85 | global $content_width; |
| 86 | 86 | |
| 87 | - if( |
|
| 87 | + if ( |
|
| 88 | 88 | is_page_template('page-templates/template-portfolio.php') || |
| 89 | 89 | is_page_template('page-templates/template-front-page.php') || |
| 90 | 90 | is_page_template('page-templates/template-full-width.php') || |
| 91 | 91 | is_post_type_archive('jetpack-portfolio') || |
| 92 | - is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) || |
|
| 92 | + is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) || |
|
| 93 | 93 | is_singular('jetpack-portfolio') |
| 94 | - ){ |
|
| 94 | + ) { |
|
| 95 | 95 | $content_width = 1140; |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | -add_action('wp_head','lsx_process_content_width'); |
|
| 98 | +add_action('wp_head', 'lsx_process_content_width'); |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * Disable the comments form by default for the page post type. |
| 102 | 102 | * @package lsx |
| 103 | 103 | * @subpackage config |
| 104 | 104 | */ |
| 105 | -function lsx_page_comments_off( $data ) { |
|
| 106 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
| 105 | +function lsx_page_comments_off($data) { |
|
| 106 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
| 107 | 107 | $data['comment_status'] = 0; |
| 108 | 108 | $data['ping_status'] = 0; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $data; |
| 112 | 112 | } |
| 113 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
| 113 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * Disable the comments form by default for the page post type. |
@@ -118,14 +118,14 @@ discard block |
||
| 118 | 118 | * @subpackage config |
| 119 | 119 | */ |
| 120 | 120 | function lsx_is_legacy($data) { |
| 121 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
| 121 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
| 122 | 122 | $data['comment_status'] = 0; |
| 123 | 123 | $data['ping_status'] = 0; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return $data; |
| 127 | 127 | } |
| 128 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
| 128 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * Run the init command |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | * @subpackage config |
| 134 | 134 | */ |
| 135 | 135 | function lsx_init() { |
| 136 | - if(class_exists('WooCommerce')){ |
|
| 137 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); |
|
| 136 | + if (class_exists('WooCommerce')) { |
|
| 137 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | -add_action( 'init', 'lsx_init',100 ); |
|
| 140 | +add_action('init', 'lsx_init', 100); |
|
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | 143 | * Run on the wp_head |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | function lsx_wp_head() { |
| 148 | 148 | |
| 149 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 150 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 149 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 150 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 151 | 151 | |
| 152 | - if('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post','page','jetpack-portfolio')) && !is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format')) ){ |
|
| 153 | - remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
| 152 | + if ('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post', 'page', 'jetpack-portfolio')) && ! is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format'))) { |
|
| 153 | + remove_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | -add_action( 'wp_head', 'lsx_wp_head',100 ); |
|
| 156 | +add_action('wp_head', 'lsx_wp_head', 100); |
|
@@ -1,70 +1,70 @@ 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' ), |
|
| 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' ), |
|
| 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' ), |
|
| 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' ), |
|
| 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' ), |
|
| 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' ), |
|
| 36 | - |
|
| 37 | - '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 | - 'body_section_full_background_color' => esc_html__( 'BODY: Section full (background)', 'lsx' ), |
|
| 44 | - 'body_section_full_text_color' => esc_html__( 'BODY: Section full (text)', 'lsx' ), |
|
| 45 | - 'body_section_full_cta_background_color' => esc_html__( 'BODY: Section full CTA (background)', 'lsx' ), |
|
| 46 | - 'body_section_full_cta_text_color' => esc_html__( 'BODY: Section full CTA (text)', 'lsx' ), |
|
| 47 | - |
|
| 48 | - 'footer_cta_background_color' => esc_html__( 'FOOTER CTA: Background', 'lsx' ), |
|
| 49 | - 'footer_cta_text_color' => esc_html__( 'FOOTER CTA: Text', 'lsx' ), |
|
| 50 | - 'footer_cta_link_color' => esc_html__( 'FOOTER CTA: Link', 'lsx' ), |
|
| 51 | - 'footer_cta_link_hover_color' => esc_html__( 'FOOTER CTA: Link (hover)', 'lsx' ), |
|
| 52 | - |
|
| 53 | - 'footer_widgets_background_color' => esc_html__( 'FOOTER WIDGETS: Background', 'lsx' ), |
|
| 54 | - 'footer_widgets_text_color' => esc_html__( 'FOOTER WIDGETS: Text', 'lsx' ), |
|
| 55 | - 'footer_widgets_link_color' => esc_html__( 'FOOTER WIDGETS: Link', 'lsx' ), |
|
| 56 | - 'footer_widgets_link_hover_color' => esc_html__( 'FOOTER WIDGETS: Link (hover)', 'lsx' ), |
|
| 57 | - |
|
| 58 | - 'footer_background_color' => esc_html__( 'FOOTER: Background', 'lsx' ), |
|
| 59 | - 'footer_text_color' => esc_html__( 'FOOTER: Text', 'lsx' ), |
|
| 60 | - 'footer_link_color' => esc_html__( 'FOOTER: Link', 'lsx' ), |
|
| 61 | - 'footer_link_hover_color' => esc_html__( 'FOOTER: Link (hover)', 'lsx' ), |
|
| 62 | -) ); |
|
| 63 | - |
|
| 64 | -$customizer_colour_choices = apply_filters( 'lsx_customizer_colour_choices', array( |
|
| 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 | + |
|
| 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 | + |
|
| 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 | + |
|
| 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 | + |
|
| 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 | + |
|
| 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 | + |
|
| 37 | + '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 | + 'body_section_full_background_color' => esc_html__('BODY: Section full (background)', 'lsx'), |
|
| 44 | + 'body_section_full_text_color' => esc_html__('BODY: Section full (text)', 'lsx'), |
|
| 45 | + 'body_section_full_cta_background_color' => esc_html__('BODY: Section full CTA (background)', 'lsx'), |
|
| 46 | + 'body_section_full_cta_text_color' => esc_html__('BODY: Section full CTA (text)', 'lsx'), |
|
| 47 | + |
|
| 48 | + 'footer_cta_background_color' => esc_html__('FOOTER CTA: Background', 'lsx'), |
|
| 49 | + 'footer_cta_text_color' => esc_html__('FOOTER CTA: Text', 'lsx'), |
|
| 50 | + 'footer_cta_link_color' => esc_html__('FOOTER CTA: Link', 'lsx'), |
|
| 51 | + 'footer_cta_link_hover_color' => esc_html__('FOOTER CTA: Link (hover)', 'lsx'), |
|
| 52 | + |
|
| 53 | + 'footer_widgets_background_color' => esc_html__('FOOTER WIDGETS: Background', 'lsx'), |
|
| 54 | + 'footer_widgets_text_color' => esc_html__('FOOTER WIDGETS: Text', 'lsx'), |
|
| 55 | + 'footer_widgets_link_color' => esc_html__('FOOTER WIDGETS: Link', 'lsx'), |
|
| 56 | + 'footer_widgets_link_hover_color' => esc_html__('FOOTER WIDGETS: Link (hover)', 'lsx'), |
|
| 57 | + |
|
| 58 | + 'footer_background_color' => esc_html__('FOOTER: Background', 'lsx'), |
|
| 59 | + 'footer_text_color' => esc_html__('FOOTER: Text', 'lsx'), |
|
| 60 | + 'footer_link_color' => esc_html__('FOOTER: Link', 'lsx'), |
|
| 61 | + 'footer_link_hover_color' => esc_html__('FOOTER: Link (hover)', 'lsx'), |
|
| 62 | +)); |
|
| 63 | + |
|
| 64 | +$customizer_colour_choices = apply_filters('lsx_customizer_colour_choices', array( |
|
| 65 | 65 | 'default' => array( |
| 66 | - 'label' => __( 'Default', 'lsx' ), |
|
| 67 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_default', array( |
|
| 66 | + 'label' => __('Default', 'lsx'), |
|
| 67 | + 'colors' => apply_filters('lsx_customizer_colour_choices_default', array( |
|
| 68 | 68 | 'button_background_color' => '#428bca', |
| 69 | 69 | 'button_background_hover_color' => '#2a6496', |
| 70 | 70 | 'button_text_color' => '#ffffff', |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | 'footer_text_color' => '#ffffff', |
| 120 | 120 | 'footer_link_color' => '#337ab7', |
| 121 | 121 | 'footer_link_hover_color' => '#969696', |
| 122 | - ) ) |
|
| 122 | + )) |
|
| 123 | 123 | ), |
| 124 | 124 | 'red' => array( |
| 125 | - 'label' => __( 'Red', 'lsx' ), |
|
| 126 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_red', array( |
|
| 125 | + 'label' => __('Red', 'lsx'), |
|
| 126 | + 'colors' => apply_filters('lsx_customizer_colour_choices_red', array( |
|
| 127 | 127 | 'button_background_color' => '#b64d3f', |
| 128 | 128 | 'button_background_hover_color' => '#87291c', |
| 129 | 129 | 'button_text_color' => '#ffffff', |
@@ -178,11 +178,11 @@ discard block |
||
| 178 | 178 | 'footer_text_color' => '#ffffff', |
| 179 | 179 | 'footer_link_color' => '#b64d3f', |
| 180 | 180 | 'footer_link_hover_color' => '#969696', |
| 181 | - ) ) |
|
| 181 | + )) |
|
| 182 | 182 | ), |
| 183 | 183 | 'orange' => array( |
| 184 | - 'label' => __( 'Orange', 'lsx' ), |
|
| 185 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_orange', array( |
|
| 184 | + 'label' => __('Orange', 'lsx'), |
|
| 185 | + 'colors' => apply_filters('lsx_customizer_colour_choices_orange', array( |
|
| 186 | 186 | 'button_background_color' => '#fbaf3f', |
| 187 | 187 | 'button_background_hover_color' => '#e49435', |
| 188 | 188 | 'button_text_color' => '#260e03', |
@@ -237,11 +237,11 @@ discard block |
||
| 237 | 237 | 'footer_text_color' => '#ffffff', |
| 238 | 238 | 'footer_link_color' => '#e4701e', |
| 239 | 239 | 'footer_link_hover_color' => '#969696', |
| 240 | - ) ) |
|
| 240 | + )) |
|
| 241 | 241 | ), |
| 242 | 242 | 'green' => array( |
| 243 | - 'label' => __( 'Green', 'lsx' ), |
|
| 244 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_green', array( |
|
| 243 | + 'label' => __('Green', 'lsx'), |
|
| 244 | + 'colors' => apply_filters('lsx_customizer_colour_choices_green', array( |
|
| 245 | 245 | 'button_background_color' => '#596b46', |
| 246 | 246 | 'button_background_hover_color' => '#3d4a30', |
| 247 | 247 | 'button_text_color' => '#ffffff', |
@@ -296,11 +296,11 @@ discard block |
||
| 296 | 296 | 'footer_text_color' => '#ffffff', |
| 297 | 297 | 'footer_link_color' => '#596b46', |
| 298 | 298 | 'footer_link_hover_color' => '#969696', |
| 299 | - ) ) |
|
| 299 | + )) |
|
| 300 | 300 | ), |
| 301 | 301 | 'brown' => array( |
| 302 | - 'label' => __( 'Brown', 'lsx' ), |
|
| 303 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_brown', array( |
|
| 302 | + 'label' => __('Brown', 'lsx'), |
|
| 303 | + 'colors' => apply_filters('lsx_customizer_colour_choices_brown', array( |
|
| 304 | 304 | 'button_background_color' => '#8c6a45', |
| 305 | 305 | 'button_background_hover_color' => '#5b452e', |
| 306 | 306 | 'button_text_color' => '#ffffff', |
@@ -355,6 +355,6 @@ discard block |
||
| 355 | 355 | 'footer_text_color' => '#ffffff', |
| 356 | 356 | 'footer_link_color' => '#8c6a45', |
| 357 | 357 | 'footer_link_hover_color' => '#969696', |
| 358 | - ) ) |
|
| 358 | + )) |
|
| 359 | 359 | ) |
| 360 | -) ); |
|
| 360 | +)); |
|