@@ -1,24 +1,24 @@ |
||
1 | 1 | <?php |
2 | - if ( isset( $GLOBALS['comment_depth'] ) ) { |
|
3 | - $depth = intval( $GLOBALS['comment_depth'] ); |
|
2 | + if (isset($GLOBALS['comment_depth'])) { |
|
3 | + $depth = intval($GLOBALS['comment_depth']); |
|
4 | 4 | } else { |
5 | 5 | $depth = 1; |
6 | 6 | } |
7 | 7 | |
8 | - $max_depth = intval( get_option( 'thread_comments_depth' ) ); |
|
8 | + $max_depth = intval(get_option('thread_comments_depth')); |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <?php echo get_avatar($comment, '64'); ?> |
12 | 12 | <div class="media-body"> |
13 | 13 | <h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4> |
14 | - <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(), get_comment_time()); ?></a></time> |
|
14 | + <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(), get_comment_time()); ?></a></time> |
|
15 | 15 | <?php edit_comment_link(esc_html__('(Edit)', 'lsx'), '', ''); ?> |
16 | 16 | |
17 | - <?php if ( '0' == $comment->comment_approved ) : ?> |
|
17 | + <?php if ('0' == $comment->comment_approved) : ?> |
|
18 | 18 | <div class="alert alert-info"> |
19 | 19 | <?php esc_html_e('Your comment is awaiting moderation.', 'lsx'); ?> |
20 | 20 | </div> |
21 | 21 | <?php endif; ?> |
22 | 22 | |
23 | 23 | <?php comment_text(); ?> |
24 | -<?php comment_reply_link( array( 'depth' => $depth, 'max_depth' => $max_depth ) ); |
|
25 | 24 | \ No newline at end of file |
25 | +<?php comment_reply_link(array('depth' => $depth, 'max_depth' => $max_depth)); |
|
26 | 26 | \ No newline at end of file |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Customizer Header Swatch Control Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Header_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), LSX_VERSION, true ); |
|
55 | + wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), LSX_VERSION, true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,30 +62,30 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function render_content() { |
64 | 64 | |
65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
67 | 67 | $value = $this->value(); |
68 | 68 | |
69 | 69 | ?> |
70 | 70 | <label> |
71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
71 | + <?php if ( ! empty($this->label)) { ?> |
|
72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
73 | 73 | <?php } |
74 | - if ( ! empty( $this->description ) ) { ?> |
|
75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
74 | + if ( ! empty($this->description)) { ?> |
|
75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
76 | 76 | <?php } ?> |
77 | 77 | <div class="header-layouts-selector"> |
78 | 78 | <?php |
79 | - foreach( $this->layouts as $layout ){ |
|
79 | + foreach ($this->layouts as $layout) { |
|
80 | 80 | $sel = 'border: 1px solid transparent;'; |
81 | - if( $value == $layout ){ |
|
81 | + if ($value == $layout) { |
|
82 | 82 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
83 | 83 | } |
84 | - echo '<img class="header-layout-button" style="padding:2px;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/header-' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">'; |
|
84 | + echo '<img class="header-layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/header-' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | ?> |
88 | - <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>> |
|
88 | + <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> |
|
89 | 89 | </div> |
90 | 90 | </label> |
91 | 91 | <?php |
@@ -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' ), LSX_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'), LSX_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 | } |
@@ -14,6 +14,6 @@ |
||
14 | 14 | */ |
15 | 15 | |
16 | 16 | function lsx_wp_job_manager_styles() { |
17 | - wp_enqueue_style( 'wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css', array(), LSX_VERSION ); |
|
17 | + wp_enqueue_style('wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css', array(), LSX_VERSION); |
|
18 | 18 | } |
19 | -add_action( 'wp_enqueue_scripts', 'lsx_wp_job_manager_styles' ); |
|
20 | 19 | \ No newline at end of file |
20 | +add_action('wp_enqueue_scripts', 'lsx_wp_job_manager_styles'); |
|
21 | 21 | \ No newline at end of file |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | /* |
10 | 10 | * Hooks |
11 | 11 | */ |
12 | -remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
13 | -remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
12 | +remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
13 | +remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
14 | 14 | |
15 | 15 | add_action('woocommerce_before_main_content', 'lsx_woocommerce_before_content', 10); |
16 | 16 | add_action('woocommerce_after_main_content', 'lsx_woocommerce_after_content', 10); |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | * @subpackage woocommerce |
26 | 26 | * @category layout |
27 | 27 | */ |
28 | -function lsx_woocommerce_before_content(){ ?> |
|
28 | +function lsx_woocommerce_before_content() { ?> |
|
29 | 29 | <?php lsx_content_wrap_before(); ?> |
30 | 30 | |
31 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
31 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
32 | 32 | |
33 | 33 | <?php lsx_content_before(); ?> |
34 | 34 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @subpackage woocommerce |
44 | 44 | * @category layout |
45 | 45 | */ |
46 | -function lsx_woocommerce_after_content(){ ?> |
|
46 | +function lsx_woocommerce_after_content() { ?> |
|
47 | 47 | <?php lsx_content_bottom(); ?> |
48 | 48 | |
49 | 49 | </main><!-- #main --> |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | * @subpackage woocommerce |
67 | 67 | * @category styles |
68 | 68 | */ |
69 | -add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
|
69 | +add_filter('woocommerce_enqueue_styles', '__return_empty_array'); |
|
70 | 70 | |
71 | 71 | function lsx_woocommerce_styles() { |
72 | - wp_enqueue_style( 'woocommerce-layout', get_template_directory_uri() . '/css/woocommerce-layout.css', array(), LSX_VERSION, 'all' ); |
|
73 | - wp_enqueue_style( 'woocommerce-smallscreen', get_template_directory_uri() . '/css/woocommerce-smallscreen.css', array( 'woocommerce-layout' ), LSX_VERSION, 'only screen and (max-width: 767px)' ); |
|
74 | - wp_enqueue_style( 'woocommerce-general', get_template_directory_uri() . '/css/woocommerce.css', array(), LSX_VERSION, 'all' ); |
|
72 | + wp_enqueue_style('woocommerce-layout', get_template_directory_uri() . '/css/woocommerce-layout.css', array(), LSX_VERSION, 'all'); |
|
73 | + wp_enqueue_style('woocommerce-smallscreen', get_template_directory_uri() . '/css/woocommerce-smallscreen.css', array('woocommerce-layout'), LSX_VERSION, 'only screen and (max-width: 767px)'); |
|
74 | + wp_enqueue_style('woocommerce-general', get_template_directory_uri() . '/css/woocommerce.css', array(), LSX_VERSION, 'all'); |
|
75 | 75 | } |
76 | -add_action( 'wp_enqueue_scripts', 'lsx_woocommerce_styles' ); |
|
77 | 76 | \ No newline at end of file |
77 | +add_action('wp_enqueue_scripts', 'lsx_woocommerce_styles'); |
|
78 | 78 | \ No newline at end of file |
@@ -1,42 +1,42 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX_Customize_Font_Control Class |
6 | 6 | **/ |
7 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
7 | +if ( ! class_exists('WP_Customize_Control')) { |
|
8 | 8 | return; |
9 | 9 | } |
10 | -class LSX_Customize_Font_Control extends WP_Customize_Control{ |
|
10 | +class LSX_Customize_Font_Control extends WP_Customize_Control { |
|
11 | 11 | public $fonts; |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Enqueue the styles and scripts |
15 | 15 | **/ |
16 | - public function enqueue(){ |
|
16 | + public function enqueue() { |
|
17 | 17 | // styles |
18 | - wp_enqueue_style( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/css/customizer-font.css', array(), LSX_VERSION ); |
|
18 | + wp_enqueue_style('lsx-font-picker-custom-control', get_template_directory_uri() . '/css/customizer-font.css', array(), LSX_VERSION); |
|
19 | 19 | |
20 | 20 | // scripts |
21 | - wp_enqueue_script( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/js/customizer-font.js', array(), LSX_VERSION ); |
|
21 | + wp_enqueue_script('lsx-font-picker-custom-control', get_template_directory_uri() . '/js/customizer-font.js', array(), LSX_VERSION); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Render the content on the theme customizer page |
26 | 26 | **/ |
27 | - public function render_content(){ |
|
28 | - if ( empty( $this->choices ) ){ |
|
27 | + public function render_content() { |
|
28 | + if (empty($this->choices)) { |
|
29 | 29 | // if there are no choices then don't print anything |
30 | 30 | return; |
31 | 31 | } |
32 | 32 | $fonts = array(); |
33 | - foreach( $this->choices as $slug=>$font ){ |
|
33 | + foreach ($this->choices as $slug=>$font) { |
|
34 | 34 | $fonts[] = $font['header']; |
35 | 35 | $fonts[] = $font['body']; |
36 | 36 | $this->choices[$slug] = $font; |
37 | 37 | } |
38 | 38 | |
39 | - $this->fonts = new LSX_Google_Font_Collection( $fonts ); |
|
39 | + $this->fonts = new LSX_Google_Font_Collection($fonts); |
|
40 | 40 | |
41 | 41 | $fonts = $this->fonts->get_font_family_name_array(); |
42 | 42 | //print links to css files |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | <div class="fontPickerCustomControl"> |
52 | 52 | <select <?php $this->link(); ?>> |
53 | 53 | <?php |
54 | - foreach ( $this->choices as $value => $conf ){ |
|
55 | - echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $value ) . '</option>'; |
|
54 | + foreach ($this->choices as $value => $conf) { |
|
55 | + echo '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>'; |
|
56 | 56 | } |
57 | 57 | ?> |
58 | 58 | </select> |
@@ -60,16 +60,16 @@ discard block |
||
60 | 60 | <ul> |
61 | 61 | <?php |
62 | 62 | //$cssClassArray = $this->fonts->get_css_class_array(); |
63 | - foreach ($this->choices as $key => $font){ |
|
63 | + foreach ($this->choices as $key => $font) { |
|
64 | 64 | $class = null; |
65 | - if( $key == $set_value ){ |
|
65 | + if ($key == $set_value) { |
|
66 | 66 | $class = ' selected'; |
67 | 67 | } |
68 | 68 | |
69 | 69 | ?> |
70 | - <li class="font-choice <?php echo esc_attr( $class ); ?>"> |
|
71 | - <div class="<?php echo esc_attr( $font['header']['cssClass'] ); ?>"><?php echo esc_html( $font['header']['title'] ); ?></div> |
|
72 | - <small class="<?php echo esc_attr( $font['body']['cssClass'] ); ?>"><?php echo esc_html( $font['body']['title'] ); ?></small> |
|
70 | + <li class="font-choice <?php echo esc_attr($class); ?>"> |
|
71 | + <div class="<?php echo esc_attr($font['header']['cssClass']); ?>"><?php echo esc_html($font['header']['title']); ?></div> |
|
72 | + <small class="<?php echo esc_attr($font['body']['cssClass']); ?>"><?php echo esc_html($font['body']['title']); ?></small> |
|
73 | 73 | </li> |
74 | 74 | <?php |
75 | 75 | } |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Customizer Header Fixed Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Header_Fixed_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-header-fixed-control', get_template_directory_uri() .'/js/customizer-header-fixed.js', array('jquery'), LSX_VERSION, true ); |
|
55 | + wp_enqueue_script('lsx-header-fixed-control', get_template_directory_uri() . '/js/customizer-header-fixed.js', array('jquery'), LSX_VERSION, true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function render_content() { |
64 | 64 | |
65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
67 | 67 | $value = $this->value(); |
68 | 68 | |
69 | 69 | ?> |
70 | 70 | <label> |
71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
71 | + <?php if ( ! empty($this->label)) { ?> |
|
72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
73 | 73 | <?php } |
74 | - if ( ! empty( $this->description ) ) { ?> |
|
75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
74 | + if ( ! empty($this->description)) { ?> |
|
75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
76 | 76 | <?php } ?> |
77 | 77 | <div class="header-fixed"> |
78 | 78 | <label> |
79 | - <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr( $post_id ); ?>" class="header-fixed <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
79 | + <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr($post_id); ?>" class="header-fixed <?php echo esc_attr($class); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
80 | 80 | </label> |
81 | 81 | </div> |
82 | 82 | </label> |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Customize Swatch Control Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-layout-control', get_template_directory_uri() .'/js/customizer-layout.js', array('jquery'), LSX_VERSION, true ); |
|
55 | + wp_enqueue_script('lsx-layout-control', get_template_directory_uri() . '/js/customizer-layout.js', array('jquery'), LSX_VERSION, true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,30 +62,30 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function render_content() { |
64 | 64 | |
65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
67 | 67 | $value = $this->value(); |
68 | 68 | |
69 | 69 | ?> |
70 | 70 | <label> |
71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
71 | + <?php if ( ! empty($this->label)) { ?> |
|
72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
73 | 73 | <?php } |
74 | - if ( ! empty( $this->description ) ) { ?> |
|
75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
74 | + if ( ! empty($this->description)) { ?> |
|
75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
76 | 76 | <?php } ?> |
77 | 77 | <div class="layouts-selector"> |
78 | 78 | <?php |
79 | - foreach( $this->layouts as $layout ){ |
|
79 | + foreach ($this->layouts as $layout) { |
|
80 | 80 | $sel = 'border: 1px solid transparent;'; |
81 | - if( $value == $layout ){ |
|
81 | + if ($value == $layout) { |
|
82 | 82 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
83 | 83 | } |
84 | - echo '<img class="layout-button" style="padding:2px;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">'; |
|
84 | + echo '<img class="layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | ?> |
88 | - <input <?php $this->link(); ?> class="selected-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>> |
|
88 | + <input <?php $this->link(); ?> class="selected-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> |
|
89 | 89 | </div> |
90 | 90 | </label> |
91 | 91 | <?php |
@@ -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 | * Enqueue scripts and styles. |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | |
15 | 15 | wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', array(), LSX_VERSION); |
16 | 16 | |
17 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
18 | - wp_enqueue_script( 'comment-reply' ); |
|
17 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
18 | + wp_enqueue_script('comment-reply'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, false); |
@@ -26,38 +26,38 @@ discard block |
||
26 | 26 | wp_enqueue_script('picturefill', get_template_directory_uri() . '/js/vendor/picturefill.min.js', array(), LSX_VERSION, false); |
27 | 27 | |
28 | 28 | wp_enqueue_script('masonry'); |
29 | - wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry'), LSX_VERSION); |
|
30 | - if(defined('WP_DEBUG') && true === WP_DEBUG){ |
|
29 | + wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/js/vendor/imagesloaded.pkgd.min.js', array('jquery', 'masonry'), LSX_VERSION); |
|
30 | + if (defined('WP_DEBUG') && true === WP_DEBUG) { |
|
31 | 31 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), LSX_VERSION, false); |
32 | - }else{ |
|
32 | + } else { |
|
33 | 33 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), LSX_VERSION, false); |
34 | 34 | } |
35 | 35 | |
36 | 36 | //Set some parameters that we can use in the JS |
37 | 37 | $is_portfolio = false; |
38 | - if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')){ |
|
38 | + if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')) { |
|
39 | 39 | $is_portfolio = true; |
40 | 40 | } |
41 | 41 | $param_array = array( |
42 | 42 | 'is_portfolio' => $is_portfolio |
43 | 43 | ); |
44 | 44 | //Set the columns for the archives |
45 | - $param_array['columns'] = apply_filters('lsx_archive_column_number',3); |
|
46 | - wp_localize_script( 'lsx_script', 'lsx_params', $param_array ); |
|
45 | + $param_array['columns'] = apply_filters('lsx_archive_column_number', 3); |
|
46 | + wp_localize_script('lsx_script', 'lsx_params', $param_array); |
|
47 | 47 | |
48 | 48 | |
49 | - wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION ); |
|
49 | + wp_enqueue_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION); |
|
50 | 50 | |
51 | 51 | |
52 | - if(is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) { |
|
53 | - wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/custom.css', array(), LSX_VERSION ); |
|
52 | + if (is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) { |
|
53 | + wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/custom.css', array(), LSX_VERSION); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | wp_enqueue_style('medium-break', get_template_directory_uri() . '/css/medium-nav-break.css', array(), LSX_VERSION); |
57 | 57 | |
58 | 58 | |
59 | - $font = get_theme_mod('lsx_font','raleway_open_sans'); |
|
60 | - switch($font){ |
|
59 | + $font = get_theme_mod('lsx_font', 'raleway_open_sans'); |
|
60 | + switch ($font) { |
|
61 | 61 | case 'raleway_open_sans': |
62 | 62 | $header_font_location = 'Raleway'; |
63 | 63 | $body_font_location = 'Open+Sans'; |
@@ -86,18 +86,18 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | $http_var = 'http'; |
89 | - if(is_ssl()){ $http_var .= 's'; } |
|
89 | + if (is_ssl()) { $http_var .= 's'; } |
|
90 | 90 | |
91 | 91 | //Call the Google Fonts and then Enque them. |
92 | - wp_register_style('lsx-header-font', $http_var.'://fonts.googleapis.com/css?family='.$header_font_location); |
|
93 | - wp_register_style('lsx-body-font', $http_var.'://fonts.googleapis.com/css?family='.$body_font_location); |
|
94 | - wp_enqueue_style( 'lsx-header-font' ); |
|
95 | - wp_enqueue_style( 'lsx-body-font' ); |
|
92 | + wp_register_style('lsx-header-font', $http_var . '://fonts.googleapis.com/css?family=' . $header_font_location); |
|
93 | + wp_register_style('lsx-body-font', $http_var . '://fonts.googleapis.com/css?family=' . $body_font_location); |
|
94 | + wp_enqueue_style('lsx-header-font'); |
|
95 | + wp_enqueue_style('lsx-body-font'); |
|
96 | 96 | |
97 | - wp_enqueue_style('lsx_font_scheme', esc_url( get_template_directory_uri() . '/css/'.$font.'.css' ), array(), LSX_VERSION); |
|
97 | + wp_enqueue_style('lsx_font_scheme', esc_url(get_template_directory_uri() . '/css/' . $font . '.css'), array(), LSX_VERSION); |
|
98 | 98 | |
99 | 99 | } |
100 | -add_action( 'wp_enqueue_scripts', 'lsx_scripts' ); |
|
100 | +add_action('wp_enqueue_scripts', 'lsx_scripts'); |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * Defer JavaScript |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | * @package lsx |
106 | 106 | * @subpackage scripts |
107 | 107 | */ |
108 | -function lsx_scripts_defer_parsing( $url ) { |
|
109 | - if ( ! ( is_admin() ) ) { |
|
110 | - if ( FALSE === strpos( $url, '.js' ) ) return $url; |
|
111 | - if ( strpos( $url, 'jquery.js' ) ) return $url; |
|
112 | - if ( strpos( $url, ' defer ' ) ) return $url; |
|
108 | +function lsx_scripts_defer_parsing($url) { |
|
109 | + if ( ! (is_admin())) { |
|
110 | + if (FALSE === strpos($url, '.js')) return $url; |
|
111 | + if (strpos($url, 'jquery.js')) return $url; |
|
112 | + if (strpos($url, ' defer ')) return $url; |
|
113 | 113 | return "$url' defer onload='"; |
114 | 114 | } |
115 | 115 | |
116 | 116 | return $url; |
117 | 117 | } |
118 | -add_filter( 'clean_url', 'lsx_scripts_defer_parsing', 11, 1 ); |
|
118 | +add_filter('clean_url', 'lsx_scripts_defer_parsing', 11, 1); |