@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Login' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Login')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Login Class |
@@ -18,13 +18,13 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'customize_register', array( $this, 'register_general' ), 20 ); |
|
| 22 | - add_action( 'customize_register', array( $this, 'register_form' ), 30 ); |
|
| 23 | - add_action( 'customize_register', array( $this, 'register_background' ), 40 ); |
|
| 21 | + add_action('customize_register', array($this, 'register_general'), 20); |
|
| 22 | + add_action('customize_register', array($this, 'register_form'), 30); |
|
| 23 | + add_action('customize_register', array($this, 'register_background'), 40); |
|
| 24 | 24 | |
| 25 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 26 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 27 | - add_action( 'login_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 25 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 26 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 27 | + add_action('login_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
| 34 | 34 | * @since 1.0.0 |
| 35 | 35 | */ |
| 36 | - public function register_general( $wp_customize ) { |
|
| 36 | + public function register_general($wp_customize) { |
|
| 37 | 37 | /** |
| 38 | 38 | * Register the main panel |
| 39 | 39 | */ |
| 40 | 40 | $wp_customize->add_panel( |
| 41 | 41 | 'login', |
| 42 | 42 | array( |
| 43 | - 'title' => esc_html__( 'WP Login Screen', 'lsx-customizer' ), |
|
| 43 | + 'title' => esc_html__('WP Login Screen', 'lsx-customizer'), |
|
| 44 | 44 | 'priority' => 60, |
| 45 | 45 | ) |
| 46 | 46 | ); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $wp_customize->add_section( |
| 52 | 52 | 'login-general', |
| 53 | 53 | array( |
| 54 | - 'title' => esc_html__( 'General', 'lsx-customizer' ), |
|
| 54 | + 'title' => esc_html__('General', 'lsx-customizer'), |
|
| 55 | 55 | 'priority' => 1, |
| 56 | 56 | 'panel' => 'login', |
| 57 | 57 | ) |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $wp_customize, |
| 75 | 75 | 'lsx_login_logo', |
| 76 | 76 | array( |
| 77 | - 'label' => __( 'Upload a logo', 'lsx-customizer' ), |
|
| 77 | + 'label' => __('Upload a logo', 'lsx-customizer'), |
|
| 78 | 78 | 'section' => 'login-general', |
| 79 | 79 | 'settings' => 'lsx_login_logo', |
| 80 | 80 | ) |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $wp_customize, |
| 98 | 98 | 'lsx_login_link_colour', |
| 99 | 99 | array( |
| 100 | - 'label' => __( 'Link Colour', 'lsx-customizer' ), |
|
| 100 | + 'label' => __('Link Colour', 'lsx-customizer'), |
|
| 101 | 101 | 'section' => 'login-general', |
| 102 | 102 | 'settings' => 'lsx_login_link_colour', |
| 103 | 103 | ) |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $wp_customize, |
| 121 | 121 | 'lsx_login_link_hover_colour', |
| 122 | 122 | array( |
| 123 | - 'label' => __( 'Link Hover Colour', 'lsx-customizer' ), |
|
| 123 | + 'label' => __('Link Hover Colour', 'lsx-customizer'), |
|
| 124 | 124 | 'section' => 'login-general', |
| 125 | 125 | 'settings' => 'lsx_login_link_hover_colour', |
| 126 | 126 | ) |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $wp_customize, |
| 144 | 144 | 'lsx_login_custom_css', |
| 145 | 145 | array( |
| 146 | - 'label' => __( 'Custom CSS', 'lsx-customizer' ), |
|
| 146 | + 'label' => __('Custom CSS', 'lsx-customizer'), |
|
| 147 | 147 | 'section' => 'login-general', |
| 148 | 148 | 'settings' => 'lsx_login_custom_css', |
| 149 | 149 | 'type' => 'textarea', |
@@ -158,14 +158,14 @@ discard block |
||
| 158 | 158 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
| 159 | 159 | * @since 1.0.0 |
| 160 | 160 | */ |
| 161 | - public function register_form( $wp_customize ) { |
|
| 161 | + public function register_form($wp_customize) { |
|
| 162 | 162 | /** |
| 163 | 163 | * Reigster the Form section |
| 164 | 164 | */ |
| 165 | 165 | $wp_customize->add_section( |
| 166 | 166 | 'login-form', |
| 167 | 167 | array( |
| 168 | - 'title' => esc_html__( 'Form', 'lsx-customizer' ), |
|
| 168 | + 'title' => esc_html__('Form', 'lsx-customizer'), |
|
| 169 | 169 | 'priority' => 1, |
| 170 | 170 | 'panel' => 'login', |
| 171 | 171 | ) |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $wp_customize, |
| 188 | 188 | 'lsx_login_form_colour', |
| 189 | 189 | array( |
| 190 | - 'label' => __( 'Form Background Color', 'lsx-customizer' ), |
|
| 190 | + 'label' => __('Form Background Color', 'lsx-customizer'), |
|
| 191 | 191 | 'section' => 'login-form', |
| 192 | 192 | 'settings' => 'lsx_login_form_colour', |
| 193 | 193 | ) |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $wp_customize, |
| 211 | 211 | 'lsx_login_form_label_colour', |
| 212 | 212 | array( |
| 213 | - 'label' => __( 'Form Label Color', 'lsx-customizer' ), |
|
| 213 | + 'label' => __('Form Label Color', 'lsx-customizer'), |
|
| 214 | 214 | 'section' => 'login-form', |
| 215 | 215 | 'settings' => 'lsx_login_form_label_colour', |
| 216 | 216 | ) |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $wp_customize, |
| 234 | 234 | 'lsx_login_button_colour', |
| 235 | 235 | array( |
| 236 | - 'label' => __( 'Button Colour', 'lsx-customizer' ), |
|
| 236 | + 'label' => __('Button Colour', 'lsx-customizer'), |
|
| 237 | 237 | 'section' => 'login-form', |
| 238 | 238 | 'settings' => 'lsx_login_button_colour', |
| 239 | 239 | ) |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $wp_customize, |
| 257 | 257 | 'lsx_login_button_shadow_colour', |
| 258 | 258 | array( |
| 259 | - 'label' => __( 'Button Shadow Colour', 'lsx-customizer' ), |
|
| 259 | + 'label' => __('Button Shadow Colour', 'lsx-customizer'), |
|
| 260 | 260 | 'section' => 'login-form', |
| 261 | 261 | 'settings' => 'lsx_login_button_shadow_colour', |
| 262 | 262 | ) |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $wp_customize, |
| 280 | 280 | 'lsx_login_button_hover_colour', |
| 281 | 281 | array( |
| 282 | - 'label' => __( 'Button Hover Colour', 'lsx-customizer' ), |
|
| 282 | + 'label' => __('Button Hover Colour', 'lsx-customizer'), |
|
| 283 | 283 | 'section' => 'login-form', |
| 284 | 284 | 'settings' => 'lsx_login_button_hover_colour', |
| 285 | 285 | ) |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | $wp_customize, |
| 303 | 303 | 'lsx_login_button_text_colour', |
| 304 | 304 | array( |
| 305 | - 'label' => __( 'Button Text Colour', 'lsx-customizer' ), |
|
| 305 | + 'label' => __('Button Text Colour', 'lsx-customizer'), |
|
| 306 | 306 | 'section' => 'login-form', |
| 307 | 307 | 'settings' => 'lsx_login_button_text_colour', |
| 308 | 308 | ) |
@@ -317,11 +317,11 @@ discard block |
||
| 317 | 317 | * @param WP_Customize_Manager $wp_customize Theme Customizer object. |
| 318 | 318 | * @since 1.0.0 |
| 319 | 319 | */ |
| 320 | - public function register_background( $wp_customize ) { |
|
| 320 | + public function register_background($wp_customize) { |
|
| 321 | 321 | $wp_customize->add_section( |
| 322 | 322 | 'login-background', |
| 323 | 323 | array( |
| 324 | - 'title' => esc_html__( 'Background', 'lsx-customizer' ), |
|
| 324 | + 'title' => esc_html__('Background', 'lsx-customizer'), |
|
| 325 | 325 | 'priority' => 1, |
| 326 | 326 | 'panel' => 'login', |
| 327 | 327 | ) |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $wp_customize, |
| 343 | 343 | 'lsx_login_bg_colour', |
| 344 | 344 | array( |
| 345 | - 'label' => __( 'Background Colour', 'lsx-customizer' ), |
|
| 345 | + 'label' => __('Background Colour', 'lsx-customizer'), |
|
| 346 | 346 | 'section' => 'login-background', |
| 347 | 347 | 'settings' => 'lsx_login_bg_colour', |
| 348 | 348 | ) |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $wp_customize, |
| 367 | 367 | 'lsx_login_bg_image', |
| 368 | 368 | array( |
| 369 | - 'label' => __( 'Background Image', 'lsx-customizer' ), |
|
| 369 | + 'label' => __('Background Image', 'lsx-customizer'), |
|
| 370 | 370 | 'section' => 'login-background', |
| 371 | 371 | 'settings' => 'lsx_login_bg_image', |
| 372 | 372 | ) |
@@ -389,15 +389,15 @@ discard block |
||
| 389 | 389 | $wp_customize, |
| 390 | 390 | 'lsx_login_bg_repeat', |
| 391 | 391 | array( |
| 392 | - 'label' => __( 'Background Repeat', 'lsx-customizer' ), |
|
| 392 | + 'label' => __('Background Repeat', 'lsx-customizer'), |
|
| 393 | 393 | 'section' => 'login-background', |
| 394 | 394 | 'settings' => 'lsx_login_bg_repeat', |
| 395 | 395 | 'type' => 'select', |
| 396 | 396 | 'choices' => array( |
| 397 | - 'no-repeat' => __( 'No Repeat', 'lsx-customizer' ), |
|
| 398 | - 'repeat' => __( 'Repeat', 'lsx-customizer' ), |
|
| 399 | - 'repeat-x' => __( 'Repeat Horizontally', 'lsx-customizer' ), |
|
| 400 | - 'repeat-y' => __( 'Repeat Vertically', 'lsx-customizer' ), |
|
| 397 | + 'no-repeat' => __('No Repeat', 'lsx-customizer'), |
|
| 398 | + 'repeat' => __('Repeat', 'lsx-customizer'), |
|
| 399 | + 'repeat-x' => __('Repeat Horizontally', 'lsx-customizer'), |
|
| 400 | + 'repeat-y' => __('Repeat Vertically', 'lsx-customizer'), |
|
| 401 | 401 | ), |
| 402 | 402 | ) |
| 403 | 403 | ) |
@@ -419,14 +419,14 @@ discard block |
||
| 419 | 419 | $wp_customize, |
| 420 | 420 | 'lsx_login_bg_size', |
| 421 | 421 | array( |
| 422 | - 'label' => __( 'Background Size', 'lsx-customizer' ), |
|
| 422 | + 'label' => __('Background Size', 'lsx-customizer'), |
|
| 423 | 423 | 'section' => 'login-background', |
| 424 | 424 | 'settings' => 'lsx_login_bg_size', |
| 425 | 425 | 'type' => 'select', |
| 426 | 426 | 'choices' => array( |
| 427 | - 'initial' => __( 'None', 'lsx-customizer' ), |
|
| 428 | - 'cover' => __( 'Cover', 'lsx-customizer' ), |
|
| 429 | - 'contain' => __( 'Contain', 'lsx-customizer' ), |
|
| 427 | + 'initial' => __('None', 'lsx-customizer'), |
|
| 428 | + 'cover' => __('Cover', 'lsx-customizer'), |
|
| 429 | + 'contain' => __('Contain', 'lsx-customizer'), |
|
| 430 | 430 | ), |
| 431 | 431 | ) |
| 432 | 432 | ) |
@@ -440,9 +440,9 @@ discard block |
||
| 440 | 440 | */ |
| 441 | 441 | public function set_theme_mod() { |
| 442 | 442 | $theme_mods = $this->get_theme_mods(); |
| 443 | - $styles = $this->get_css( $theme_mods ); |
|
| 443 | + $styles = $this->get_css($theme_mods); |
|
| 444 | 444 | |
| 445 | - set_theme_mod( 'lsx_customizer_login_styles', $styles ); |
|
| 445 | + set_theme_mod('lsx_customizer_login_styles', $styles); |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /** |
@@ -451,13 +451,13 @@ discard block |
||
| 451 | 451 | * @since 1.0.0 |
| 452 | 452 | */ |
| 453 | 453 | public function enqueue_css() { |
| 454 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_login_styles' ); |
|
| 455 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 454 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_login_styles'); |
|
| 455 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 456 | 456 | $theme_mods = $this->get_theme_mods(); |
| 457 | - $styles = $this->get_css( $theme_mods ); |
|
| 457 | + $styles = $this->get_css($theme_mods); |
|
| 458 | 458 | |
| 459 | - if ( false === $styles_from_theme_mod ) { |
|
| 460 | - set_theme_mod( 'lsx_customizer_login_styles', $styles ); |
|
| 459 | + if (false === $styles_from_theme_mod) { |
|
| 460 | + set_theme_mod('lsx_customizer_login_styles', $styles); |
|
| 461 | 461 | } |
| 462 | 462 | } else { |
| 463 | 463 | $styles = $styles_from_theme_mod; |
@@ -479,20 +479,20 @@ discard block |
||
| 479 | 479 | $mods = apply_filters( |
| 480 | 480 | 'lsx_customizer_login_styles', |
| 481 | 481 | array( |
| 482 | - 'logo' => get_theme_mod( 'lsx_login_logo', '' ), |
|
| 483 | - 'link_colour' => get_theme_mod( 'lsx_login_link_colour', '#0085ba' ), |
|
| 484 | - 'link_hover_colour' => get_theme_mod( 'lsx_login_link_hover_colour', '#0085ba' ), |
|
| 485 | - 'button_colour' => get_theme_mod( 'lsx_login_button_colour', '#0085ba' ), |
|
| 486 | - 'button_shadow_colour' => get_theme_mod( 'lsx_login_button_shadow_colour', '#015d82' ), |
|
| 487 | - 'button_hover_colour' => get_theme_mod( 'lsx_login_button_hover_colour', '#015d82' ), |
|
| 488 | - 'button_text_colour' => get_theme_mod( 'lsx_login_button_text_colour', '#ffffff' ), |
|
| 489 | - 'login_form_colour' => get_theme_mod( 'lsx_login_form_colour', '#ffffff' ), |
|
| 490 | - 'login_form_label_colour' => get_theme_mod( 'lsx_login_form_label_colour', '#333333' ), |
|
| 491 | - 'background_colour' => get_theme_mod( 'lsx_login_bg_colour', '#f2f2f2' ), |
|
| 492 | - 'background_image' => get_theme_mod( 'lsx_login_bg_image', '' ), |
|
| 493 | - 'background_repeat' => get_theme_mod( 'lsx_login_bg_repeat', 'no-repeat' ), |
|
| 494 | - 'background_size' => get_theme_mod( 'lsx_login_bg_size', 'initial' ), |
|
| 495 | - 'custom_css' => get_theme_mod( 'lsx_login_custom_css', '' ), |
|
| 482 | + 'logo' => get_theme_mod('lsx_login_logo', ''), |
|
| 483 | + 'link_colour' => get_theme_mod('lsx_login_link_colour', '#0085ba'), |
|
| 484 | + 'link_hover_colour' => get_theme_mod('lsx_login_link_hover_colour', '#0085ba'), |
|
| 485 | + 'button_colour' => get_theme_mod('lsx_login_button_colour', '#0085ba'), |
|
| 486 | + 'button_shadow_colour' => get_theme_mod('lsx_login_button_shadow_colour', '#015d82'), |
|
| 487 | + 'button_hover_colour' => get_theme_mod('lsx_login_button_hover_colour', '#015d82'), |
|
| 488 | + 'button_text_colour' => get_theme_mod('lsx_login_button_text_colour', '#ffffff'), |
|
| 489 | + 'login_form_colour' => get_theme_mod('lsx_login_form_colour', '#ffffff'), |
|
| 490 | + 'login_form_label_colour' => get_theme_mod('lsx_login_form_label_colour', '#333333'), |
|
| 491 | + 'background_colour' => get_theme_mod('lsx_login_bg_colour', '#f2f2f2'), |
|
| 492 | + 'background_image' => get_theme_mod('lsx_login_bg_image', ''), |
|
| 493 | + 'background_repeat' => get_theme_mod('lsx_login_bg_repeat', 'no-repeat'), |
|
| 494 | + 'background_size' => get_theme_mod('lsx_login_bg_size', 'initial'), |
|
| 495 | + 'custom_css' => get_theme_mod('lsx_login_custom_css', ''), |
|
| 496 | 496 | ) |
| 497 | 497 | ); |
| 498 | 498 | return $mods; |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | * |
| 504 | 504 | * @since 1.0.0 |
| 505 | 505 | */ |
| 506 | - public function get_css( $theme_mods ) { |
|
| 506 | + public function get_css($theme_mods) { |
|
| 507 | 507 | $css = '<style>'; |
| 508 | 508 | |
| 509 | 509 | $css .= "body.login #backtoblog a, body.login #nav a { color: {$theme_mods['link_colour']}; }"; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | $css .= "body.login form { background: {$theme_mods['login_form_colour']}; }"; |
| 520 | 520 | $css .= "body.login label { color: {$theme_mods['login_form_label_colour']}; }"; |
| 521 | 521 | |
| 522 | - if ( isset( $theme_mods['logo'] ) && '' !== $theme_mods['logo'] ) { |
|
| 522 | + if (isset($theme_mods['logo']) && '' !== $theme_mods['logo']) { |
|
| 523 | 523 | $css .= " |
| 524 | 524 | #login h1 a, .login h1 a { |
| 525 | 525 | background-image: url('" . $theme_mods['logo'] . "'); |
@@ -533,15 +533,15 @@ discard block |
||
| 533 | 533 | |
| 534 | 534 | // Add in the background image options. |
| 535 | 535 | $background_image = ''; |
| 536 | - if ( isset( $theme_mods['background_image'] ) && '' !== $theme_mods['background_image'] ) { |
|
| 536 | + if (isset($theme_mods['background_image']) && '' !== $theme_mods['background_image']) { |
|
| 537 | 537 | $background_image = "background-image:url('{$theme_mods['background_image']}');"; |
| 538 | 538 | } |
| 539 | 539 | $background_repeat = ''; |
| 540 | - if ( isset( $theme_mods['background_repeat'] ) && '' !== $theme_mods['background_repeat'] ) { |
|
| 540 | + if (isset($theme_mods['background_repeat']) && '' !== $theme_mods['background_repeat']) { |
|
| 541 | 541 | $background_repeat = "background-repeat:{$theme_mods['background_repeat']};"; |
| 542 | 542 | } |
| 543 | 543 | $background_size = ''; |
| 544 | - if ( isset( $theme_mods['background_size'] ) && '' !== $theme_mods['background_size'] ) { |
|
| 544 | + if (isset($theme_mods['background_size']) && '' !== $theme_mods['background_size']) { |
|
| 545 | 545 | $background_size = "background-size:{$theme_mods['background_size']};"; |
| 546 | 546 | } |
| 547 | 547 | $css .= " |
@@ -556,12 +556,12 @@ discard block |
||
| 556 | 556 | }"; |
| 557 | 557 | |
| 558 | 558 | // Add in the custom css |
| 559 | - if ( isset( $theme_mods['custom_css'] ) && '' !== $theme_mods['custom_css'] ) { |
|
| 559 | + if (isset($theme_mods['custom_css']) && '' !== $theme_mods['custom_css']) { |
|
| 560 | 560 | $css .= $theme_mods['custom_css']; |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | $css .= '</style>'; |
| 564 | - $css = apply_filters( 'lsx_customizer_login_styles', $css ); |
|
| 564 | + $css = apply_filters('lsx_customizer_login_styles', $css); |
|
| 565 | 565 | return $css; |
| 566 | 566 | } |
| 567 | 567 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Header' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Colour_Header')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Colour Header Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 22 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 21 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 22 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 23 | 23 | |
| 24 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 24 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function set_theme_mod() { |
| 33 | 33 | $theme_mods = $this->get_theme_mods(); |
| 34 | - $styles = $this->get_css( $theme_mods ); |
|
| 34 | + $styles = $this->get_css($theme_mods); |
|
| 35 | 35 | |
| 36 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
| 36 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | * @since 1.0.0 |
| 43 | 43 | */ |
| 44 | 44 | public function enqueue_css() { |
| 45 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__header_theme_mod' ); |
|
| 45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__header_theme_mod'); |
|
| 46 | 46 | |
| 47 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 47 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 48 | 48 | $theme_mods = $this->get_theme_mods(); |
| 49 | - $styles = $this->get_css( $theme_mods ); |
|
| 49 | + $styles = $this->get_css($theme_mods); |
|
| 50 | 50 | |
| 51 | - if ( false === $styles_from_theme_mod ) { |
|
| 52 | - set_theme_mod( 'lsx_customizer_colour__header_theme_mod', $styles ); |
|
| 51 | + if (false === $styles_from_theme_mod) { |
|
| 52 | + set_theme_mod('lsx_customizer_colour__header_theme_mod', $styles); |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | $styles = $styles_from_theme_mod; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - wp_add_inline_style( 'lsx-customizer', $styles ); |
|
| 58 | + wp_add_inline_style('lsx-customizer', $styles); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | public function get_theme_mods() { |
| 67 | 67 | $colors = parent::get_color_scheme(); |
| 68 | 68 | |
| 69 | - return apply_filters( 'lsx_customizer_colours_header', array( |
|
| 70 | - 'header_background_color' => get_theme_mod( 'header_background_color', $colors['header_background_color'] ), |
|
| 71 | - 'header_link_color' => get_theme_mod( 'header_link_color', $colors['header_link_color'] ), |
|
| 72 | - 'header_link_hover_color' => get_theme_mod( 'header_link_hover_color', $colors['header_link_hover_color'] ), |
|
| 73 | - 'header_description_color' => get_theme_mod( 'header_description_color', $colors['header_description_color'] ), |
|
| 74 | - ) ); |
|
| 69 | + return apply_filters('lsx_customizer_colours_header', array( |
|
| 70 | + 'header_background_color' => get_theme_mod('header_background_color', $colors['header_background_color']), |
|
| 71 | + 'header_link_color' => get_theme_mod('header_link_color', $colors['header_link_color']), |
|
| 72 | + 'header_link_hover_color' => get_theme_mod('header_link_hover_color', $colors['header_link_hover_color']), |
|
| 73 | + 'header_description_color' => get_theme_mod('header_description_color', $colors['header_description_color']), |
|
| 74 | + )); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -79,21 +79,21 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @since 1.0.0 |
| 81 | 81 | */ |
| 82 | - function get_css( $colors ) { |
|
| 82 | + function get_css($colors) { |
|
| 83 | 83 | global $customizer_colour_names; |
| 84 | 84 | |
| 85 | 85 | $colors_template = array(); |
| 86 | 86 | |
| 87 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 88 | - $colors_template[ $key ] = ''; |
|
| 87 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 88 | + $colors_template[$key] = ''; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 91 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 92 | 92 | |
| 93 | - if ( empty( $colors['header_background_color'] ) |
|
| 94 | - || empty( $colors['header_link_color'] ) |
|
| 95 | - || empty( $colors['header_link_hover_color'] ) |
|
| 96 | - || empty( $colors['header_description_color'] ) ) { |
|
| 93 | + if (empty($colors['header_background_color']) |
|
| 94 | + || empty($colors['header_link_color']) |
|
| 95 | + || empty($colors['header_link_hover_color']) |
|
| 96 | + || empty($colors['header_description_color'])) { |
|
| 97 | 97 | return ''; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | ); |
| 112 | 112 | '; |
| 113 | 113 | |
| 114 | - $css = apply_filters( 'lsx_customizer_colour_selectors_header', $css, $colors ); |
|
| 115 | - $css = parent::scss_to_css( $css ); |
|
| 114 | + $css = apply_filters('lsx_customizer_colour_selectors_header', $css, $colors); |
|
| 115 | + $css = parent::scss_to_css($css); |
|
| 116 | 116 | |
| 117 | 117 | return $css; |
| 118 | 118 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Footer_CTA' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Colour_Footer_CTA')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Colour Footer CTA Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 22 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 21 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 22 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 23 | 23 | |
| 24 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 24 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function set_theme_mod() { |
| 33 | 33 | $theme_mods = $this->get_theme_mods(); |
| 34 | - $styles = $this->get_css( $theme_mods ); |
|
| 34 | + $styles = $this->get_css($theme_mods); |
|
| 35 | 35 | |
| 36 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
| 36 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | * @since 1.0.0 |
| 43 | 43 | */ |
| 44 | 44 | public function enqueue_css() { |
| 45 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod' ); |
|
| 45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_cta_theme_mod'); |
|
| 46 | 46 | |
| 47 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 47 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 48 | 48 | $theme_mods = $this->get_theme_mods(); |
| 49 | - $styles = $this->get_css( $theme_mods ); |
|
| 49 | + $styles = $this->get_css($theme_mods); |
|
| 50 | 50 | |
| 51 | - if ( false === $styles_from_theme_mod ) { |
|
| 52 | - set_theme_mod( 'lsx_customizer_colour__footer_cta_theme_mod', $styles ); |
|
| 51 | + if (false === $styles_from_theme_mod) { |
|
| 52 | + set_theme_mod('lsx_customizer_colour__footer_cta_theme_mod', $styles); |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | $styles = $styles_from_theme_mod; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - wp_add_inline_style( 'lsx-customizer', $styles ); |
|
| 58 | + wp_add_inline_style('lsx-customizer', $styles); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | public function get_theme_mods() { |
| 67 | 67 | $colors = parent::get_color_scheme(); |
| 68 | 68 | |
| 69 | - return apply_filters( 'lsx_customizer_colours_footer_cta', array( |
|
| 70 | - 'footer_cta_background_color' => get_theme_mod( 'footer_cta_background_color', $colors['footer_cta_background_color'] ), |
|
| 71 | - 'footer_cta_text_color' => get_theme_mod( 'footer_cta_text_color', $colors['footer_cta_text_color'] ), |
|
| 72 | - 'footer_cta_link_color' => get_theme_mod( 'footer_cta_link_color', $colors['footer_cta_link_color'] ), |
|
| 73 | - 'footer_cta_link_hover_color' => get_theme_mod( 'footer_cta_link_hover_color', $colors['footer_cta_link_hover_color'] ), |
|
| 74 | - ) ); |
|
| 69 | + return apply_filters('lsx_customizer_colours_footer_cta', array( |
|
| 70 | + 'footer_cta_background_color' => get_theme_mod('footer_cta_background_color', $colors['footer_cta_background_color']), |
|
| 71 | + 'footer_cta_text_color' => get_theme_mod('footer_cta_text_color', $colors['footer_cta_text_color']), |
|
| 72 | + 'footer_cta_link_color' => get_theme_mod('footer_cta_link_color', $colors['footer_cta_link_color']), |
|
| 73 | + 'footer_cta_link_hover_color' => get_theme_mod('footer_cta_link_hover_color', $colors['footer_cta_link_hover_color']), |
|
| 74 | + )); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -79,21 +79,21 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @since 1.0.0 |
| 81 | 81 | */ |
| 82 | - function get_css( $colors ) { |
|
| 82 | + function get_css($colors) { |
|
| 83 | 83 | global $customizer_colour_names; |
| 84 | 84 | |
| 85 | 85 | $colors_template = array(); |
| 86 | 86 | |
| 87 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 88 | - $colors_template[ $key ] = ''; |
|
| 87 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 88 | + $colors_template[$key] = ''; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 91 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 92 | 92 | |
| 93 | - if ( empty( $colors['footer_cta_background_color'] ) |
|
| 94 | - || empty( $colors['footer_cta_text_color'] ) |
|
| 95 | - || empty( $colors['footer_cta_link_color'] ) |
|
| 96 | - || empty( $colors['footer_cta_link_hover_color'] ) ) { |
|
| 93 | + if (empty($colors['footer_cta_background_color']) |
|
| 94 | + || empty($colors['footer_cta_text_color']) |
|
| 95 | + || empty($colors['footer_cta_link_color']) |
|
| 96 | + || empty($colors['footer_cta_link_hover_color'])) { |
|
| 97 | 97 | return ''; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | ); |
| 112 | 112 | '; |
| 113 | 113 | |
| 114 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer_cta', $css, $colors ); |
|
| 115 | - $css = parent::scss_to_css( $css ); |
|
| 114 | + $css = apply_filters('lsx_customizer_colour_selectors_footer_cta', $css, $colors); |
|
| 115 | + $css = parent::scss_to_css($css); |
|
| 116 | 116 | return $css; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Body' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Colour_Body')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Colour Body Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 22 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 21 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 22 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 23 | 23 | |
| 24 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 24 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function set_theme_mod() { |
| 33 | 33 | $theme_mods = $this->get_theme_mods(); |
| 34 | - $styles = $this->get_css( $theme_mods ); |
|
| 34 | + $styles = $this->get_css($theme_mods); |
|
| 35 | 35 | |
| 36 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
| 36 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | * @since 1.0.0 |
| 43 | 43 | */ |
| 44 | 44 | public function enqueue_css() { |
| 45 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__body_theme_mod' ); |
|
| 45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__body_theme_mod'); |
|
| 46 | 46 | |
| 47 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 47 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 48 | 48 | $theme_mods = $this->get_theme_mods(); |
| 49 | - $styles = $this->get_css( $theme_mods ); |
|
| 49 | + $styles = $this->get_css($theme_mods); |
|
| 50 | 50 | |
| 51 | - if ( false === $styles_from_theme_mod ) { |
|
| 52 | - set_theme_mod( 'lsx_customizer_colour__body_theme_mod', $styles ); |
|
| 51 | + if (false === $styles_from_theme_mod) { |
|
| 52 | + set_theme_mod('lsx_customizer_colour__body_theme_mod', $styles); |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | $styles = $styles_from_theme_mod; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - wp_add_inline_style( 'lsx-customizer', $styles ); |
|
| 58 | + wp_add_inline_style('lsx-customizer', $styles); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -66,30 +66,30 @@ discard block |
||
| 66 | 66 | public function get_theme_mods() { |
| 67 | 67 | $colors = parent::get_color_scheme(); |
| 68 | 68 | |
| 69 | - $background_color = get_theme_mod( 'background_color', $colors['background_color'] ); |
|
| 69 | + $background_color = get_theme_mod('background_color', $colors['background_color']); |
|
| 70 | 70 | |
| 71 | - if ( '#' !== substr( $background_color, 0, 1 ) ) { |
|
| 71 | + if ('#' !== substr($background_color, 0, 1)) { |
|
| 72 | 72 | $background_color = '#' . $background_color; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return apply_filters( 'lsx_customizer_colours_body', array( |
|
| 75 | + return apply_filters('lsx_customizer_colours_body', array( |
|
| 76 | 76 | 'background_color' => $background_color, |
| 77 | - 'body_line_color' => get_theme_mod( 'body_line_color', $colors['body_line_color'] ), |
|
| 78 | - 'body_text_heading_color' => get_theme_mod( 'body_text_heading_color', $colors['body_text_heading_color'] ), |
|
| 79 | - 'body_text_small_color' => get_theme_mod( 'body_text_small_color', $colors['body_text_small_color'] ), |
|
| 80 | - 'body_text_color' => get_theme_mod( 'body_text_color', $colors['body_text_color'] ), |
|
| 81 | - 'body_link_color' => get_theme_mod( 'body_link_color', $colors['body_link_color'] ), |
|
| 82 | - 'body_link_hover_color' => get_theme_mod( 'body_link_hover_color', $colors['body_link_hover_color'] ), |
|
| 83 | - 'body_section_full_background_color' => get_theme_mod( 'body_section_full_background_color', $colors['body_section_full_background_color'] ), |
|
| 84 | - 'body_section_full_text_color' => get_theme_mod( 'body_section_full_text_color', $colors['body_section_full_text_color'] ), |
|
| 85 | - 'body_section_full_link_color' => get_theme_mod( 'body_section_full_link_color', $colors['body_section_full_link_color'] ), |
|
| 86 | - 'body_section_full_link_hover_color' => get_theme_mod( 'body_section_full_link_hover_color', $colors['body_section_full_link_hover_color'] ), |
|
| 87 | - 'body_section_full_cta_background_color' => get_theme_mod( 'body_section_full_cta_background_color', $colors['body_section_full_cta_background_color'] ), |
|
| 88 | - 'body_section_full_cta_text_color' => get_theme_mod( 'body_section_full_cta_text_color', $colors['body_section_full_cta_text_color'] ), |
|
| 89 | - 'body_section_full_cta_link_color' => get_theme_mod( 'body_section_full_cta_link_color', $colors['body_section_full_cta_link_color'] ), |
|
| 90 | - 'body_section_full_cta_link_hover_color' => get_theme_mod( 'body_section_full_cta_link_hover_color', $colors['body_section_full_cta_link_hover_color'] ), |
|
| 91 | - 'primary_color' => get_theme_mod( 'primary_color', $colors['primary_color'] ), |
|
| 92 | - ) ); |
|
| 77 | + 'body_line_color' => get_theme_mod('body_line_color', $colors['body_line_color']), |
|
| 78 | + 'body_text_heading_color' => get_theme_mod('body_text_heading_color', $colors['body_text_heading_color']), |
|
| 79 | + 'body_text_small_color' => get_theme_mod('body_text_small_color', $colors['body_text_small_color']), |
|
| 80 | + 'body_text_color' => get_theme_mod('body_text_color', $colors['body_text_color']), |
|
| 81 | + 'body_link_color' => get_theme_mod('body_link_color', $colors['body_link_color']), |
|
| 82 | + 'body_link_hover_color' => get_theme_mod('body_link_hover_color', $colors['body_link_hover_color']), |
|
| 83 | + 'body_section_full_background_color' => get_theme_mod('body_section_full_background_color', $colors['body_section_full_background_color']), |
|
| 84 | + 'body_section_full_text_color' => get_theme_mod('body_section_full_text_color', $colors['body_section_full_text_color']), |
|
| 85 | + 'body_section_full_link_color' => get_theme_mod('body_section_full_link_color', $colors['body_section_full_link_color']), |
|
| 86 | + 'body_section_full_link_hover_color' => get_theme_mod('body_section_full_link_hover_color', $colors['body_section_full_link_hover_color']), |
|
| 87 | + 'body_section_full_cta_background_color' => get_theme_mod('body_section_full_cta_background_color', $colors['body_section_full_cta_background_color']), |
|
| 88 | + 'body_section_full_cta_text_color' => get_theme_mod('body_section_full_cta_text_color', $colors['body_section_full_cta_text_color']), |
|
| 89 | + 'body_section_full_cta_link_color' => get_theme_mod('body_section_full_cta_link_color', $colors['body_section_full_cta_link_color']), |
|
| 90 | + 'body_section_full_cta_link_hover_color' => get_theme_mod('body_section_full_cta_link_hover_color', $colors['body_section_full_cta_link_hover_color']), |
|
| 91 | + 'primary_color' => get_theme_mod('primary_color', $colors['primary_color']), |
|
| 92 | + )); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -97,32 +97,32 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @since 1.0.0 |
| 99 | 99 | */ |
| 100 | - function get_css( $colors ) { |
|
| 100 | + function get_css($colors) { |
|
| 101 | 101 | global $customizer_colour_names; |
| 102 | 102 | |
| 103 | 103 | $colors_template = array(); |
| 104 | 104 | |
| 105 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 106 | - $colors_template[ $key ] = ''; |
|
| 105 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 106 | + $colors_template[$key] = ''; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 110 | - |
|
| 111 | - if ( empty( $colors['background_color'] ) |
|
| 112 | - || empty( $colors['body_line_color'] ) |
|
| 113 | - || empty( $colors['body_text_heading_color'] ) |
|
| 114 | - || empty( $colors['body_text_color'] ) |
|
| 115 | - || empty( $colors['body_link_color'] ) |
|
| 116 | - || empty( $colors['body_link_hover_color'] ) |
|
| 117 | - || empty( $colors['body_text_small_color'] ) |
|
| 118 | - || empty( $colors['body_section_full_background_color'] ) |
|
| 119 | - || empty( $colors['body_section_full_text_color'] ) |
|
| 120 | - || empty( $colors['body_section_full_link_color'] ) |
|
| 121 | - || empty( $colors['body_section_full_link_hover_color'] ) |
|
| 122 | - || empty( $colors['body_section_full_cta_background_color'] ) |
|
| 123 | - || empty( $colors['body_section_full_cta_text_color'] ) |
|
| 124 | - || empty( $colors['body_section_full_cta_link_color'] ) |
|
| 125 | - || empty( $colors['body_section_full_cta_link_hover_color'] ) ) { |
|
| 109 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 110 | + |
|
| 111 | + if (empty($colors['background_color']) |
|
| 112 | + || empty($colors['body_line_color']) |
|
| 113 | + || empty($colors['body_text_heading_color']) |
|
| 114 | + || empty($colors['body_text_color']) |
|
| 115 | + || empty($colors['body_link_color']) |
|
| 116 | + || empty($colors['body_link_hover_color']) |
|
| 117 | + || empty($colors['body_text_small_color']) |
|
| 118 | + || empty($colors['body_section_full_background_color']) |
|
| 119 | + || empty($colors['body_section_full_text_color']) |
|
| 120 | + || empty($colors['body_section_full_link_color']) |
|
| 121 | + || empty($colors['body_section_full_link_hover_color']) |
|
| 122 | + || empty($colors['body_section_full_cta_background_color']) |
|
| 123 | + || empty($colors['body_section_full_cta_text_color']) |
|
| 124 | + || empty($colors['body_section_full_cta_link_color']) |
|
| 125 | + || empty($colors['body_section_full_cta_link_hover_color'])) { |
|
| 126 | 126 | return ''; |
| 127 | 127 | } |
| 128 | 128 | |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | ); |
| 153 | 153 | '; |
| 154 | 154 | |
| 155 | - $css = apply_filters( 'lsx_customizer_colour_selectors_body', $css, $colors ); |
|
| 156 | - $css = parent::scss_to_css( $css ); |
|
| 155 | + $css = apply_filters('lsx_customizer_colour_selectors_body', $css, $colors); |
|
| 156 | + $css = parent::scss_to_css($css); |
|
| 157 | 157 | |
| 158 | 158 | return $css; |
| 159 | 159 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Main Class |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | * @since 1.0.0 |
| 27 | 27 | */ |
| 28 | 28 | public function __construct() { |
| 29 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-admin.php' ); |
|
| 30 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-frontend.php' ); |
|
| 31 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-core.php' ); |
|
| 32 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour.php' ); |
|
| 33 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-login.php' ); |
|
| 29 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-admin.php'); |
|
| 30 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-frontend.php'); |
|
| 31 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-core.php'); |
|
| 32 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-colour.php'); |
|
| 33 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-login.php'); |
|
| 34 | 34 | |
| 35 | - add_action( 'plugins_loaded', array( $this, 'woocommerce' ) ); |
|
| 36 | - add_action( 'after_setup_theme', array( $this, 'wysiwyg_editor_control' ), 20 ); |
|
| 37 | - add_filter( 'login_headerurl', array( $this, 'custom_login_url' ) ); |
|
| 35 | + add_action('plugins_loaded', array($this, 'woocommerce')); |
|
| 36 | + add_action('after_setup_theme', array($this, 'wysiwyg_editor_control'), 20); |
|
| 37 | + add_filter('login_headerurl', array($this, 'custom_login_url')); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | * @since 1.1.1 |
| 44 | 44 | */ |
| 45 | 45 | public function woocommerce() { |
| 46 | - if ( class_exists( 'WooCommerce' ) ) { |
|
| 47 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-woocommerce.php' ); |
|
| 46 | + if (class_exists('WooCommerce')) { |
|
| 47 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-woocommerce.php'); |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | * @since 1.1.1 |
| 56 | 56 | */ |
| 57 | 57 | public function wysiwyg_editor_control() { |
| 58 | - if ( class_exists( 'WP_Customize_Control' ) ) { |
|
| 59 | - require_once( LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-wysiwyg-control.php' ); |
|
| 58 | + if (class_exists('WP_Customize_Control')) { |
|
| 59 | + require_once(LSX_CUSTOMIZER_PATH . 'classes/class-lsx-customizer-wysiwyg-control.php'); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * @since 1.0.0 |
| 67 | 67 | */ |
| 68 | - public function sanitize_checkbox( $input ) { |
|
| 69 | - return ( 1 === absint( $input ) ) ? 1 : 0; |
|
| 68 | + public function sanitize_checkbox($input) { |
|
| 69 | + return (1 === absint($input)) ? 1 : 0; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @since 1.1.1 |
| 76 | 76 | */ |
| 77 | - public function sanitize_select( $input ) { |
|
| 78 | - if ( is_string( $input ) || is_integer( $input ) || is_bool( $input ) ) { |
|
| 77 | + public function sanitize_select($input) { |
|
| 78 | + if (is_string($input) || is_integer($input) || is_bool($input)) { |
|
| 79 | 79 | return $input; |
| 80 | 80 | } else { |
| 81 | 81 | return ''; |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | * |
| 88 | 88 | * @since 1.1.1 |
| 89 | 89 | */ |
| 90 | - public function sanitize_textarea( $input ) { |
|
| 91 | - return wp_kses_post( $input ); |
|
| 90 | + public function sanitize_textarea($input) { |
|
| 91 | + return wp_kses_post($input); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | function custom_login_url() { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Banner' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Colour_Banner')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Colour Banner Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 22 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 21 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 22 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 23 | 23 | |
| 24 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 24 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function set_theme_mod() { |
| 33 | 33 | $theme_mods = $this->get_theme_mods(); |
| 34 | - $styles = $this->get_css( $theme_mods ); |
|
| 34 | + $styles = $this->get_css($theme_mods); |
|
| 35 | 35 | |
| 36 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
| 36 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | * @since 1.0.0 |
| 43 | 43 | */ |
| 44 | 44 | public function enqueue_css() { |
| 45 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__banner_theme_mod' ); |
|
| 45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__banner_theme_mod'); |
|
| 46 | 46 | |
| 47 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 47 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 48 | 48 | $theme_mods = $this->get_theme_mods(); |
| 49 | - $styles = $this->get_css( $theme_mods ); |
|
| 49 | + $styles = $this->get_css($theme_mods); |
|
| 50 | 50 | |
| 51 | - if ( false === $styles_from_theme_mod ) { |
|
| 52 | - set_theme_mod( 'lsx_customizer_colour__banner_theme_mod', $styles ); |
|
| 51 | + if (false === $styles_from_theme_mod) { |
|
| 52 | + set_theme_mod('lsx_customizer_colour__banner_theme_mod', $styles); |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | $styles = $styles_from_theme_mod; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - wp_add_inline_style( 'lsx-customizer', $styles ); |
|
| 58 | + wp_add_inline_style('lsx-customizer', $styles); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -66,14 +66,14 @@ discard block |
||
| 66 | 66 | public function get_theme_mods() { |
| 67 | 67 | $colors = parent::get_color_scheme(); |
| 68 | 68 | |
| 69 | - return apply_filters( 'lsx_customizer_colours_banner', array( |
|
| 70 | - 'banner_background_color' => get_theme_mod( 'banner_background_color', $colors['banner_background_color'] ), |
|
| 71 | - 'banner_text_color' => get_theme_mod( 'banner_text_color', $colors['banner_text_color'] ), |
|
| 72 | - 'banner_text_image_color' => get_theme_mod( 'banner_text_image_color', $colors['banner_text_image_color'] ), |
|
| 73 | - 'banner_breadcrumb_background_color' => get_theme_mod( 'banner_breadcrumb_background_color', $colors['banner_breadcrumb_background_color'] ), |
|
| 74 | - 'banner_breadcrumb_text_color' => get_theme_mod( 'banner_breadcrumb_text_color', $colors['banner_breadcrumb_text_color'] ), |
|
| 75 | - 'banner_breadcrumb_text_selected_color' => get_theme_mod( 'banner_breadcrumb_text_selected_color', $colors['banner_breadcrumb_text_selected_color'] ), |
|
| 76 | - ) ); |
|
| 69 | + return apply_filters('lsx_customizer_colours_banner', array( |
|
| 70 | + 'banner_background_color' => get_theme_mod('banner_background_color', $colors['banner_background_color']), |
|
| 71 | + 'banner_text_color' => get_theme_mod('banner_text_color', $colors['banner_text_color']), |
|
| 72 | + 'banner_text_image_color' => get_theme_mod('banner_text_image_color', $colors['banner_text_image_color']), |
|
| 73 | + 'banner_breadcrumb_background_color' => get_theme_mod('banner_breadcrumb_background_color', $colors['banner_breadcrumb_background_color']), |
|
| 74 | + 'banner_breadcrumb_text_color' => get_theme_mod('banner_breadcrumb_text_color', $colors['banner_breadcrumb_text_color']), |
|
| 75 | + 'banner_breadcrumb_text_selected_color' => get_theme_mod('banner_breadcrumb_text_selected_color', $colors['banner_breadcrumb_text_selected_color']), |
|
| 76 | + )); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -81,23 +81,23 @@ discard block |
||
| 81 | 81 | * |
| 82 | 82 | * @since 1.0.0 |
| 83 | 83 | */ |
| 84 | - function get_css( $colors ) { |
|
| 84 | + function get_css($colors) { |
|
| 85 | 85 | global $customizer_colour_names; |
| 86 | 86 | |
| 87 | 87 | $colors_template = array(); |
| 88 | 88 | |
| 89 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 90 | - $colors_template[ $key ] = ''; |
|
| 89 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 90 | + $colors_template[$key] = ''; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 93 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 94 | 94 | |
| 95 | - if ( empty( $colors['banner_background_color'] ) |
|
| 96 | - || empty( $colors['banner_text_color'] ) |
|
| 97 | - || empty( $colors['banner_text_image_color'] ) |
|
| 98 | - || empty( $colors['banner_breadcrumb_background_color'] ) |
|
| 99 | - || empty( $colors['banner_breadcrumb_text_color'] ) |
|
| 100 | - || empty( $colors['banner_breadcrumb_text_selected_color'] ) ) { |
|
| 95 | + if (empty($colors['banner_background_color']) |
|
| 96 | + || empty($colors['banner_text_color']) |
|
| 97 | + || empty($colors['banner_text_image_color']) |
|
| 98 | + || empty($colors['banner_breadcrumb_background_color']) |
|
| 99 | + || empty($colors['banner_breadcrumb_text_color']) |
|
| 100 | + || empty($colors['banner_breadcrumb_text_selected_color'])) { |
|
| 101 | 101 | return ''; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | ); |
| 118 | 118 | '; |
| 119 | 119 | |
| 120 | - $css = apply_filters( 'lsx_customizer_colour_selectors_banner', $css, $colors ); |
|
| 121 | - $css = parent::scss_to_css( $css ); |
|
| 120 | + $css = apply_filters('lsx_customizer_colour_selectors_banner', $css, $colors); |
|
| 121 | + $css = parent::scss_to_css($css); |
|
| 122 | 122 | |
| 123 | 123 | return $css; |
| 124 | 124 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Button' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Colour_Button')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Colour Button Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 22 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 21 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 22 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 23 | 23 | |
| 24 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 24 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function set_theme_mod() { |
| 33 | 33 | $theme_mods = $this->get_theme_mods(); |
| 34 | - $styles = $this->get_css( $theme_mods ); |
|
| 34 | + $styles = $this->get_css($theme_mods); |
|
| 35 | 35 | |
| 36 | - set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles ); |
|
| 36 | + set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | * @since 1.0.0 |
| 43 | 43 | */ |
| 44 | 44 | public function enqueue_css() { |
| 45 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_theme_mod' ); |
|
| 45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_theme_mod'); |
|
| 46 | 46 | |
| 47 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 47 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 48 | 48 | $theme_mods = $this->get_theme_mods(); |
| 49 | - $styles = $this->get_css( $theme_mods ); |
|
| 49 | + $styles = $this->get_css($theme_mods); |
|
| 50 | 50 | |
| 51 | - if ( false === $styles_from_theme_mod ) { |
|
| 52 | - set_theme_mod( 'lsx_customizer_colour__button_theme_mod', $styles ); |
|
| 51 | + if (false === $styles_from_theme_mod) { |
|
| 52 | + set_theme_mod('lsx_customizer_colour__button_theme_mod', $styles); |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | $styles = $styles_from_theme_mod; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - wp_add_inline_style( 'lsx-customizer', $styles ); |
|
| 58 | + wp_add_inline_style('lsx-customizer', $styles); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | public function get_theme_mods() { |
| 67 | 67 | $colors = parent::get_color_scheme(); |
| 68 | 68 | |
| 69 | - return apply_filters( 'lsx_customizer_colours_button', array( |
|
| 70 | - 'button_background_color' => get_theme_mod( 'button_background_color', $colors['button_background_color'] ), |
|
| 71 | - 'button_background_hover_color' => get_theme_mod( 'button_background_hover_color', $colors['button_background_hover_color'] ), |
|
| 72 | - 'button_text_color' => get_theme_mod( 'button_text_color', $colors['button_text_color'] ), |
|
| 73 | - 'button_text_color_hover' => get_theme_mod( 'button_text_color_hover', $colors['button_text_color_hover'] ), |
|
| 74 | - 'button_shadow' => get_theme_mod( 'button_shadow', $colors['button_shadow'] ), |
|
| 75 | - ) ); |
|
| 69 | + return apply_filters('lsx_customizer_colours_button', array( |
|
| 70 | + 'button_background_color' => get_theme_mod('button_background_color', $colors['button_background_color']), |
|
| 71 | + 'button_background_hover_color' => get_theme_mod('button_background_hover_color', $colors['button_background_hover_color']), |
|
| 72 | + 'button_text_color' => get_theme_mod('button_text_color', $colors['button_text_color']), |
|
| 73 | + 'button_text_color_hover' => get_theme_mod('button_text_color_hover', $colors['button_text_color_hover']), |
|
| 74 | + 'button_shadow' => get_theme_mod('button_shadow', $colors['button_shadow']), |
|
| 75 | + )); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -80,22 +80,22 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @since 1.0.0 |
| 82 | 82 | */ |
| 83 | - function get_css( $colors ) { |
|
| 83 | + function get_css($colors) { |
|
| 84 | 84 | global $customizer_colour_names; |
| 85 | 85 | |
| 86 | 86 | $colors_template = array(); |
| 87 | 87 | |
| 88 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 89 | - $colors_template[ $key ] = ''; |
|
| 88 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 89 | + $colors_template[$key] = ''; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 92 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 93 | 93 | |
| 94 | - if ( empty( $colors['button_text_color'] ) |
|
| 95 | - || empty( $colors['button_text_color_hover'] ) |
|
| 96 | - || empty( $colors['button_background_color'] ) |
|
| 97 | - || empty( $colors['button_background_hover_color'] ) |
|
| 98 | - || empty( $colors['button_shadow'] ) ) { |
|
| 94 | + if (empty($colors['button_text_color']) |
|
| 95 | + || empty($colors['button_text_color_hover']) |
|
| 96 | + || empty($colors['button_background_color']) |
|
| 97 | + || empty($colors['button_background_hover_color']) |
|
| 98 | + || empty($colors['button_shadow'])) { |
|
| 99 | 99 | return ''; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | ); |
| 115 | 115 | '; |
| 116 | 116 | |
| 117 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button', $css, $colors ); |
|
| 118 | - $css = parent::scss_to_css( $css ); |
|
| 117 | + $css = apply_filters('lsx_customizer_colour_selectors_button', $css, $colors); |
|
| 118 | + $css = parent::scss_to_css($css); |
|
| 119 | 119 | |
| 120 | 120 | return $css; |
| 121 | 121 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Footer' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Colour_Footer')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Colour Footer Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 22 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 21 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 22 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 23 | 23 | |
| 24 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 24 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function set_theme_mod() { |
| 33 | 33 | $theme_mods = $this->get_theme_mods(); |
| 34 | - $styles = $this->get_css( $theme_mods ); |
|
| 34 | + $styles = $this->get_css($theme_mods); |
|
| 35 | 35 | |
| 36 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
| 36 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | * @since 1.0.0 |
| 43 | 43 | */ |
| 44 | 44 | public function enqueue_css() { |
| 45 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__footer_theme_mod' ); |
|
| 45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__footer_theme_mod'); |
|
| 46 | 46 | |
| 47 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 47 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 48 | 48 | $theme_mods = $this->get_theme_mods(); |
| 49 | - $styles = $this->get_css( $theme_mods ); |
|
| 49 | + $styles = $this->get_css($theme_mods); |
|
| 50 | 50 | |
| 51 | - if ( false === $styles_from_theme_mod ) { |
|
| 52 | - set_theme_mod( 'lsx_customizer_colour__footer_theme_mod', $styles ); |
|
| 51 | + if (false === $styles_from_theme_mod) { |
|
| 52 | + set_theme_mod('lsx_customizer_colour__footer_theme_mod', $styles); |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | $styles = $styles_from_theme_mod; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - wp_add_inline_style( 'lsx-customizer', $styles ); |
|
| 58 | + wp_add_inline_style('lsx-customizer', $styles); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | public function get_theme_mods() { |
| 67 | 67 | $colors = parent::get_color_scheme(); |
| 68 | 68 | |
| 69 | - return apply_filters( 'lsx_customizer_colours_footer', array( |
|
| 70 | - 'footer_background_color' => get_theme_mod( 'footer_background_color', $colors['footer_background_color'] ), |
|
| 71 | - 'footer_text_color' => get_theme_mod( 'footer_text_color', $colors['footer_text_color'] ), |
|
| 72 | - 'footer_link_color' => get_theme_mod( 'footer_link_color', $colors['footer_link_color'] ), |
|
| 73 | - 'footer_link_hover_color' => get_theme_mod( 'footer_link_hover_color', $colors['footer_link_hover_color'] ), |
|
| 74 | - ) ); |
|
| 69 | + return apply_filters('lsx_customizer_colours_footer', array( |
|
| 70 | + 'footer_background_color' => get_theme_mod('footer_background_color', $colors['footer_background_color']), |
|
| 71 | + 'footer_text_color' => get_theme_mod('footer_text_color', $colors['footer_text_color']), |
|
| 72 | + 'footer_link_color' => get_theme_mod('footer_link_color', $colors['footer_link_color']), |
|
| 73 | + 'footer_link_hover_color' => get_theme_mod('footer_link_hover_color', $colors['footer_link_hover_color']), |
|
| 74 | + )); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -79,21 +79,21 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @since 1.0.0 |
| 81 | 81 | */ |
| 82 | - function get_css( $colors ) { |
|
| 82 | + function get_css($colors) { |
|
| 83 | 83 | global $customizer_colour_names; |
| 84 | 84 | |
| 85 | 85 | $colors_template = array(); |
| 86 | 86 | |
| 87 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 88 | - $colors_template[ $key ] = ''; |
|
| 87 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 88 | + $colors_template[$key] = ''; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 91 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 92 | 92 | |
| 93 | - if ( empty( $colors['footer_background_color'] ) |
|
| 94 | - || empty( $colors['footer_text_color'] ) |
|
| 95 | - || empty( $colors['footer_link_color'] ) |
|
| 96 | - || empty( $colors['footer_link_hover_color'] ) ) { |
|
| 93 | + if (empty($colors['footer_background_color']) |
|
| 94 | + || empty($colors['footer_text_color']) |
|
| 95 | + || empty($colors['footer_link_color']) |
|
| 96 | + || empty($colors['footer_link_hover_color'])) { |
|
| 97 | 97 | return ''; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | ); |
| 112 | 112 | '; |
| 113 | 113 | |
| 114 | - $css = apply_filters( 'lsx_customizer_colour_selectors_footer', $css, $colors ); |
|
| 115 | - $css = parent::scss_to_css( $css ); |
|
| 114 | + $css = apply_filters('lsx_customizer_colour_selectors_footer', $css, $colors); |
|
| 115 | + $css = parent::scss_to_css($css); |
|
| 116 | 116 | |
| 117 | 117 | return $css; |
| 118 | 118 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! class_exists( 'LSX_Customizer_Colour_Button_Secondary' ) ) { |
|
| 2 | +if ( ! class_exists('LSX_Customizer_Colour_Button_Secondary')) { |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX Customizer Colour Button Secondary Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * @since 1.0.0 |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'after_switch_theme', array( $this, 'set_theme_mod' ) ); |
|
| 22 | - add_action( 'customize_save_after', array( $this, 'set_theme_mod' ) ); |
|
| 21 | + add_action('after_switch_theme', array($this, 'set_theme_mod')); |
|
| 22 | + add_action('customize_save_after', array($this, 'set_theme_mod')); |
|
| 23 | 23 | |
| 24 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_css' ), 2999 ); |
|
| 24 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_css'), 2999); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function set_theme_mod() { |
| 33 | 33 | $theme_mods = $this->get_theme_mods(); |
| 34 | - $styles = $this->get_css( $theme_mods ); |
|
| 34 | + $styles = $this->get_css($theme_mods); |
|
| 35 | 35 | |
| 36 | - set_theme_mod( 'lsx_customizer_colour__button_secondary_theme_mod', $styles ); |
|
| 36 | + set_theme_mod('lsx_customizer_colour__button_secondary_theme_mod', $styles); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,20 +42,20 @@ discard block |
||
| 42 | 42 | * @since 1.0.0 |
| 43 | 43 | */ |
| 44 | 44 | public function enqueue_css() { |
| 45 | - $styles_from_theme_mod = get_theme_mod( 'lsx_customizer_colour__button_secondary_theme_mod' ); |
|
| 45 | + $styles_from_theme_mod = get_theme_mod('lsx_customizer_colour__button_secondary_theme_mod'); |
|
| 46 | 46 | |
| 47 | - if ( is_customize_preview() || false === $styles_from_theme_mod ) { |
|
| 47 | + if (is_customize_preview() || false === $styles_from_theme_mod) { |
|
| 48 | 48 | $theme_mods = $this->get_theme_mods(); |
| 49 | - $styles = $this->get_css( $theme_mods ); |
|
| 49 | + $styles = $this->get_css($theme_mods); |
|
| 50 | 50 | |
| 51 | - if ( false === $styles_from_theme_mod ) { |
|
| 52 | - set_theme_mod( 'lsx_customizer_colour__button_secondary_theme_mod', $styles ); |
|
| 51 | + if (false === $styles_from_theme_mod) { |
|
| 52 | + set_theme_mod('lsx_customizer_colour__button_secondary_theme_mod', $styles); |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | $styles = $styles_from_theme_mod; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - wp_add_inline_style( 'lsx-customizer', $styles ); |
|
| 58 | + wp_add_inline_style('lsx-customizer', $styles); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -66,13 +66,13 @@ discard block |
||
| 66 | 66 | public function get_theme_mods() { |
| 67 | 67 | $colors = parent::get_color_scheme(); |
| 68 | 68 | |
| 69 | - return apply_filters( 'lsx_customizer_colours_button_secondary', array( |
|
| 70 | - 'button_secondary_background_color' => get_theme_mod( 'button_secondary_background_color', $colors['button_secondary_background_color'] ), |
|
| 71 | - 'button_secondary_background_hover_color' => get_theme_mod( 'button_secondary_background_hover_color', $colors['button_secondary_background_hover_color'] ), |
|
| 72 | - 'button_secondary_text_color' => get_theme_mod( 'button_secondary_text_color', $colors['button_secondary_text_color'] ), |
|
| 73 | - 'button_secondary_text_color_hover' => get_theme_mod( 'button_secondary_text_color_hover', $colors['button_secondary_text_color_hover'] ), |
|
| 74 | - 'button_secondary_shadow' => get_theme_mod( 'button_secondary_shadow', $colors['button_secondary_shadow'] ), |
|
| 75 | - ) ); |
|
| 69 | + return apply_filters('lsx_customizer_colours_button_secondary', array( |
|
| 70 | + 'button_secondary_background_color' => get_theme_mod('button_secondary_background_color', $colors['button_secondary_background_color']), |
|
| 71 | + 'button_secondary_background_hover_color' => get_theme_mod('button_secondary_background_hover_color', $colors['button_secondary_background_hover_color']), |
|
| 72 | + 'button_secondary_text_color' => get_theme_mod('button_secondary_text_color', $colors['button_secondary_text_color']), |
|
| 73 | + 'button_secondary_text_color_hover' => get_theme_mod('button_secondary_text_color_hover', $colors['button_secondary_text_color_hover']), |
|
| 74 | + 'button_secondary_shadow' => get_theme_mod('button_secondary_shadow', $colors['button_secondary_shadow']), |
|
| 75 | + )); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -80,22 +80,22 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @since 1.0.0 |
| 82 | 82 | */ |
| 83 | - function get_css( $colors ) { |
|
| 83 | + function get_css($colors) { |
|
| 84 | 84 | global $customizer_colour_names; |
| 85 | 85 | |
| 86 | 86 | $colors_template = array(); |
| 87 | 87 | |
| 88 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 89 | - $colors_template[ $key ] = ''; |
|
| 88 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 89 | + $colors_template[$key] = ''; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $colors = wp_parse_args( $colors, $colors_template ); |
|
| 92 | + $colors = wp_parse_args($colors, $colors_template); |
|
| 93 | 93 | |
| 94 | - if ( empty( $colors['button_secondary_text_color'] ) |
|
| 95 | - || empty( $colors['button_secondary_text_color_hover'] ) |
|
| 96 | - || empty( $colors['button_secondary_background_color'] ) |
|
| 97 | - || empty( $colors['button_secondary_background_hover_color'] ) |
|
| 98 | - || empty( $colors['button_secondary_shadow'] ) ) { |
|
| 94 | + if (empty($colors['button_secondary_text_color']) |
|
| 95 | + || empty($colors['button_secondary_text_color_hover']) |
|
| 96 | + || empty($colors['button_secondary_background_color']) |
|
| 97 | + || empty($colors['button_secondary_background_hover_color']) |
|
| 98 | + || empty($colors['button_secondary_shadow'])) { |
|
| 99 | 99 | return ''; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | ); |
| 115 | 115 | '; |
| 116 | 116 | |
| 117 | - $css = apply_filters( 'lsx_customizer_colour_selectors_button_secondary', $css, $colors ); |
|
| 118 | - $css = parent::scss_to_css( $css ); |
|
| 117 | + $css = apply_filters('lsx_customizer_colour_selectors_button_secondary', $css, $colors); |
|
| 118 | + $css = parent::scss_to_css($css); |
|
| 119 | 119 | |
| 120 | 120 | return $css; |
| 121 | 121 | } |