@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Customize Swatch Control Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Core_Control extends WP_Customize_Control { |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | public function render_content() { |
23 | 23 | ?> |
24 | 24 | <label> |
25 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
26 | - <span class="customize-control-title"><?php echo esc_html( $this->label ) ?></span> |
|
25 | + <?php if ( ! empty($this->label)) { ?> |
|
26 | + <span class="customize-control-title"><?php echo esc_html($this->label) ?></span> |
|
27 | 27 | <?php } |
28 | - if ( ! empty( $this->description ) ) { ?> |
|
29 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ) ?></span> |
|
28 | + if ( ! empty($this->description)) { ?> |
|
29 | + <span class="description customize-control-description"><?php echo esc_html($this->description) ?></span> |
|
30 | 30 | <?php } ?> |
31 | - <input <?php $this->link() ?> type="checkbox" value="<?php echo esc_attr( $this->value() ) ?>" <?php $this->input_attrs() ?>> |
|
31 | + <input <?php $this->link() ?> type="checkbox" value="<?php echo esc_attr($this->value()) ?>" <?php $this->input_attrs() ?>> |
|
32 | 32 | </label> |
33 | 33 | <?php |
34 | 34 | } |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Customizer Header Fixed Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Header_Fixed_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-header-fixed-control', get_template_directory_uri() .'/js/customizer-header-fixed.js', array('jquery'), 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> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Constructor |
15 | - **/ |
|
15 | + **/ |
|
16 | 16 | public function __construct($title, $location, $cssDeclaration, $cssClass) |
17 | 17 | { |
18 | 18 | $this->title = $title; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * Getters |
26 | 26 | * taken from: http://stackoverflow.com/questions/4478661/getter-and-setter |
27 | - **/ |
|
27 | + **/ |
|
28 | 28 | public function __get($property) |
29 | 29 | { |
30 | 30 | if (property_exists($this, $property)) { |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,42 +1,42 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX_Customize_Font_Control Class |
6 | 6 | **/ |
7 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
7 | +if ( ! class_exists('WP_Customize_Control')) { |
|
8 | 8 | return; |
9 | 9 | } |
10 | -class LSX_Customize_Font_Control extends WP_Customize_Control{ |
|
10 | +class LSX_Customize_Font_Control extends WP_Customize_Control { |
|
11 | 11 | public $fonts; |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Enqueue the styles and scripts |
15 | 15 | **/ |
16 | - public function enqueue(){ |
|
16 | + public function enqueue() { |
|
17 | 17 | // styles |
18 | - wp_enqueue_style( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/css/customizer-font.css', 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,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Customizer Header Swatch Control Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Header_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), 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,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -45,15 +45,15 @@ |
||
45 | 45 | add_action( 'widgets_init', 'lsx_widget_area_init' ); |
46 | 46 | |
47 | 47 | function lsx_sidebar_footer_params( $params ) { |
48 | - $sidebar_id = $params[0]['id']; |
|
48 | + $sidebar_id = $params[0]['id']; |
|
49 | 49 | |
50 | - if ( 'sidebar-footer' == $sidebar_id ) { |
|
51 | - $total_widgets = wp_get_sidebars_widgets(); |
|
52 | - $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
50 | + if ( 'sidebar-footer' == $sidebar_id ) { |
|
51 | + $total_widgets = wp_get_sidebars_widgets(); |
|
52 | + $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
53 | 53 | |
54 | - $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
55 | - } |
|
54 | + $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
55 | + } |
|
56 | 56 | |
57 | - return $params; |
|
57 | + return $params; |
|
58 | 58 | } |
59 | 59 | add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
60 | 60 | \ No newline at end of file |
@@ -1,53 +1,53 @@ 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 | * Register widgetized area and update sidebar with default widgets. |
6 | 6 | */ |
7 | 7 | function lsx_widget_area_init() { |
8 | 8 | |
9 | - register_sidebar( array( |
|
10 | - 'name' => __( 'Home', 'lsx' ), |
|
9 | + register_sidebar(array( |
|
10 | + 'name' => __('Home', 'lsx'), |
|
11 | 11 | 'id' => 'sidebar-home', |
12 | 12 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
13 | 13 | 'after_widget' => '</aside>', |
14 | 14 | 'before_title' => '<h3 class="widget-title">', |
15 | 15 | 'after_title' => '</h3>', |
16 | - ) ); |
|
16 | + )); |
|
17 | 17 | |
18 | - register_sidebar( array( |
|
19 | - 'name' => __( 'Sidebar', 'lsx' ), |
|
18 | + register_sidebar(array( |
|
19 | + 'name' => __('Sidebar', 'lsx'), |
|
20 | 20 | 'id' => 'sidebar-1', |
21 | 21 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
22 | 22 | 'after_widget' => '</aside>', |
23 | 23 | 'before_title' => '<h3 class="widget-title">', |
24 | 24 | 'after_title' => '</h3>', |
25 | - ) ); |
|
25 | + )); |
|
26 | 26 | |
27 | - register_sidebar( array( |
|
28 | - 'name' => __( 'Footer', 'lsx' ), |
|
27 | + register_sidebar(array( |
|
28 | + 'name' => __('Footer', 'lsx'), |
|
29 | 29 | 'id' => 'sidebar-footer', |
30 | 30 | 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
31 | 31 | 'after_widget' => '</aside></div>', |
32 | 32 | 'before_title' => '<h3 class="widget-title">', |
33 | 33 | 'after_title' => '</h3>', |
34 | - ) ); |
|
34 | + )); |
|
35 | 35 | |
36 | - register_sidebar( array( |
|
37 | - 'name' => __( 'Footer Call to Action', 'lsx' ), |
|
36 | + register_sidebar(array( |
|
37 | + 'name' => __('Footer Call to Action', 'lsx'), |
|
38 | 38 | 'id' => 'sidebar-footer-cta', |
39 | 39 | 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
40 | 40 | 'after_widget' => '</aside></div>', |
41 | 41 | 'before_title' => '<h3 class="widget-title">', |
42 | 42 | 'after_title' => '</h3>', |
43 | - ) ); |
|
43 | + )); |
|
44 | 44 | } |
45 | -add_action( 'widgets_init', 'lsx_widget_area_init' ); |
|
45 | +add_action('widgets_init', 'lsx_widget_area_init'); |
|
46 | 46 | |
47 | -function lsx_sidebar_footer_params( $params ) { |
|
47 | +function lsx_sidebar_footer_params($params) { |
|
48 | 48 | $sidebar_id = $params[0]['id']; |
49 | 49 | |
50 | - if ( 'sidebar-footer' == $sidebar_id ) { |
|
50 | + if ('sidebar-footer' == $sidebar_id) { |
|
51 | 51 | $total_widgets = wp_get_sidebars_widgets(); |
52 | 52 | $sidebar_widgets = count($total_widgets[$sidebar_id]); |
53 | 53 | |
@@ -56,4 +56,4 @@ discard block |
||
56 | 56 | |
57 | 57 | return $params; |
58 | 58 | } |
59 | -add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
|
60 | 59 | \ No newline at end of file |
60 | +add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); |
|
61 | 61 | \ No newline at end of file |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,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 | * Cleaner walker for wp_nav_menu() |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | $item_html = ''; |
26 | 26 | |
27 | 27 | //If there is no menu set, dont use the pages, the objects are not the same as whats supposed to be used. |
28 | - if(isset($item->title)){ |
|
28 | + if (isset($item->title)) { |
|
29 | 29 | |
30 | 30 | parent::start_el($item_html, $item, $depth, $args); |
31 | 31 | |
32 | - if ( $item->is_dropdown && ( 0 === $depth ) ) { |
|
32 | + if ($item->is_dropdown && (0 === $depth)) { |
|
33 | 33 | $item_html = str_replace('<a', '<a class="dropdown-toggle" data-target="#"', $item_html); |
34 | 34 | $item_html = str_replace('</a>', ' <b class="caret"></b></a>', $item_html); |
35 | - } elseif ( stristr( $item_html, 'li class="divider"' ) ) { |
|
35 | + } elseif (stristr($item_html, 'li class="divider"')) { |
|
36 | 36 | $item_html = preg_replace('/<a[^>]*>.*?<\/a>/iU', '', $item_html); |
37 | - } elseif ( stristr( $item_html, 'li class="dropdown-header"' ) ) { |
|
38 | - $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html ); |
|
37 | + } elseif (stristr($item_html, 'li class="dropdown-header"')) { |
|
38 | + $item_html = preg_replace('/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $item_html = apply_filters('lsx_wp_nav_menu_item', $item_html); |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) { |
48 | - $element->is_dropdown = ( ( ! empty( $children_elements[$element->ID] ) && ( ( $depth + 1 ) < $max_depth || ( 0 === $max_depth ) ) ) ); |
|
48 | + $element->is_dropdown = (( ! empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth || (0 === $max_depth)))); |
|
49 | 49 | |
50 | - if ( $element->is_dropdown ) { |
|
51 | - if ( $depth > 0 ) { |
|
50 | + if ($element->is_dropdown) { |
|
51 | + if ($depth > 0) { |
|
52 | 52 | $element->classes[] = 'dropdown-submenu'; |
53 | 53 | } else { |
54 | 54 | $element->classes[] = 'dropdown'; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes); |
69 | 69 | $classes = preg_replace('/^((menu|page)[-_\w+]+)+/', '', $classes); |
70 | 70 | |
71 | - $classes[] = 'menu-'.$slug; |
|
71 | + $classes[] = 'menu-' . $slug; |
|
72 | 72 | |
73 | 73 | $classes = array_unique($classes); |
74 | 74 | |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | function lsx_nav_menu_args($args = '') { |
87 | 87 | $roots_nav_menu_args['container'] = false; |
88 | 88 | |
89 | - if (!$args['items_wrap']) { |
|
89 | + if ( ! $args['items_wrap']) { |
|
90 | 90 | $roots_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>'; |
91 | 91 | } |
92 | 92 | |
93 | - if (current_theme_supports('bootstrap-top-navbar') && !$args['depth']) { |
|
93 | + if (current_theme_supports('bootstrap-top-navbar') && ! $args['depth']) { |
|
94 | 94 | $roots_nav_menu_args['depth'] = 2; |
95 | 95 | } |
96 | 96 | |
97 | - if (!$args['walker']) { |
|
97 | + if ( ! $args['walker']) { |
|
98 | 98 | $roots_nav_menu_args['walker'] = new LSX_Nav_Walker(); |
99 | 99 | } |
100 | 100 |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Theme Configuration File |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @package lsx |
9 | 9 | */ |
10 | 10 | |
11 | -if ( ! function_exists( 'lsx_setup' ) ) : |
|
11 | +if ( ! function_exists('lsx_setup')) : |
|
12 | 12 | /** |
13 | 13 | * Sets up theme defaults and registers support for various WordPress features. |
14 | 14 | * |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | function lsx_setup() { |
20 | 20 | global $content_width; |
21 | 21 | |
22 | - load_theme_textdomain( 'lsx', get_template_directory() . '/languages' ); |
|
22 | + load_theme_textdomain('lsx', get_template_directory() . '/languages'); |
|
23 | 23 | |
24 | 24 | $args = array( |
25 | 25 | 'header-text' => array( |
@@ -28,51 +28,51 @@ discard block |
||
28 | 28 | ), |
29 | 29 | 'size' => 'medium', |
30 | 30 | ); |
31 | - add_theme_support( 'site-logo', $args ); |
|
31 | + add_theme_support('site-logo', $args); |
|
32 | 32 | |
33 | - add_theme_support( 'custom-logo', array( |
|
33 | + add_theme_support('custom-logo', array( |
|
34 | 34 | 'height' => 50, |
35 | 35 | 'width' => 150, |
36 | 36 | 'flex-width' => true, |
37 | 37 | 'flex-height' => true, |
38 | - ) ); |
|
38 | + )); |
|
39 | 39 | |
40 | - add_theme_support( 'custom-background' ); |
|
41 | - add_theme_support( 'automatic-feed-links' ); |
|
42 | - add_theme_support( 'title-tag' ); |
|
43 | - add_theme_support( 'post-thumbnails' ); |
|
44 | - add_theme_support( 'post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside') ); |
|
40 | + add_theme_support('custom-background'); |
|
41 | + add_theme_support('automatic-feed-links'); |
|
42 | + add_theme_support('title-tag'); |
|
43 | + add_theme_support('post-thumbnails'); |
|
44 | + add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside')); |
|
45 | 45 | |
46 | 46 | // This theme uses wp_nav_menu() in one location. |
47 | - register_nav_menus( array( |
|
48 | - 'primary' => __( 'Primary Menu', 'lsx' ), |
|
49 | - 'top-menu'=> __( 'Top Menu' , 'lsx' ), |
|
50 | - 'social'=> __( 'Social Menu' , 'lsx' ), |
|
51 | - 'footer'=> __( 'Footer Menu' , 'lsx' ) |
|
52 | - ) ); |
|
47 | + register_nav_menus(array( |
|
48 | + 'primary' => __('Primary Menu', 'lsx'), |
|
49 | + 'top-menu'=> __('Top Menu', 'lsx'), |
|
50 | + 'social'=> __('Social Menu', 'lsx'), |
|
51 | + 'footer'=> __('Footer Menu', 'lsx') |
|
52 | + )); |
|
53 | 53 | |
54 | 54 | //Set the content width |
55 | 55 | $content_width = 1140; |
56 | 56 | |
57 | - add_editor_style( get_template_directory_uri() . '/css/editor-style.css' ); |
|
58 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
57 | + add_editor_style(get_template_directory_uri() . '/css/editor-style.css'); |
|
58 | + add_theme_support('html5', array('caption')); |
|
59 | 59 | |
60 | - add_theme_support( 'woocommerce' ); |
|
61 | - add_theme_support( 'sensei' ); |
|
60 | + add_theme_support('woocommerce'); |
|
61 | + add_theme_support('sensei'); |
|
62 | 62 | } |
63 | 63 | endif; // lsx_setup |
64 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
64 | +add_action('after_setup_theme', 'lsx_setup'); |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Removes the "Custom Fields" meta box. |
68 | 68 | */ |
69 | 69 | function lsx_remove_meta_boxes() { |
70 | 70 | $post_types = get_post_types(); |
71 | - foreach($post_types as $post_type){ |
|
72 | - remove_meta_box( 'postcustom' , $post_type , 'normal' ); |
|
71 | + foreach ($post_types as $post_type) { |
|
72 | + remove_meta_box('postcustom', $post_type, 'normal'); |
|
73 | 73 | } |
74 | 74 | } |
75 | -add_action( 'admin_menu' , 'lsx_remove_meta_boxes' ); |
|
75 | +add_action('admin_menu', 'lsx_remove_meta_boxes'); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -84,33 +84,33 @@ discard block |
||
84 | 84 | function lsx_process_content_width() { |
85 | 85 | global $content_width; |
86 | 86 | |
87 | - if( |
|
87 | + if ( |
|
88 | 88 | is_page_template('page-templates/template-portfolio.php') || |
89 | 89 | is_page_template('page-templates/template-front-page.php') || |
90 | 90 | is_page_template('page-templates/template-full-width.php') || |
91 | 91 | is_post_type_archive('jetpack-portfolio') || |
92 | - is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) || |
|
92 | + is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) || |
|
93 | 93 | is_singular('jetpack-portfolio') |
94 | - ){ |
|
94 | + ) { |
|
95 | 95 | $content_width = 1140; |
96 | 96 | } |
97 | 97 | } |
98 | -add_action('wp_head','lsx_process_content_width'); |
|
98 | +add_action('wp_head', 'lsx_process_content_width'); |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Disable the comments form by default for the page post type. |
102 | 102 | * @package lsx |
103 | 103 | * @subpackage config |
104 | 104 | */ |
105 | -function lsx_page_comments_off( $data ) { |
|
106 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
105 | +function lsx_page_comments_off($data) { |
|
106 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
107 | 107 | $data['comment_status'] = 0; |
108 | 108 | $data['ping_status'] = 0; |
109 | 109 | } |
110 | 110 | |
111 | 111 | return $data; |
112 | 112 | } |
113 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
113 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
114 | 114 | |
115 | 115 | /** |
116 | 116 | * Disable the comments form by default for the page post type. |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | * @subpackage config |
119 | 119 | */ |
120 | 120 | function lsx_is_legacy($data) { |
121 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
121 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
122 | 122 | $data['comment_status'] = 0; |
123 | 123 | $data['ping_status'] = 0; |
124 | 124 | } |
125 | 125 | |
126 | 126 | return $data; |
127 | 127 | } |
128 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
128 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
129 | 129 | |
130 | 130 | /** |
131 | 131 | * Run the init command |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | * @subpackage config |
134 | 134 | */ |
135 | 135 | function lsx_init() { |
136 | - if(class_exists('WooCommerce')){ |
|
137 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); |
|
136 | + if (class_exists('WooCommerce')) { |
|
137 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); |
|
138 | 138 | } |
139 | 139 | } |
140 | -add_action( 'init', 'lsx_init',100 ); |
|
140 | +add_action('init', 'lsx_init', 100); |
|
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Run on the wp_head |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | */ |
147 | 147 | function lsx_wp_head() { |
148 | 148 | |
149 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
150 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
149 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
150 | + $layout = apply_filters('lsx_layout', $layout); |
|
151 | 151 | |
152 | - if('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post','page','jetpack-portfolio')) && !is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format')) ){ |
|
153 | - remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
152 | + if ('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post', 'page', 'jetpack-portfolio')) && ! is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format'))) { |
|
153 | + remove_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
154 | 154 | } |
155 | 155 | } |
156 | -add_action( 'wp_head', 'lsx_wp_head',100 ); |
|
156 | +add_action('wp_head', 'lsx_wp_head', 100); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | <?php lsx_content_wrap_before(); ?> |
16 | 16 | |
17 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
17 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
18 | 18 | |
19 | 19 | <?php lsx_content_before(); ?> |
20 | 20 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | <?php lsx_content_top(); ?> |
24 | 24 | |
25 | - <?php while ( have_posts() ) : the_post(); ?> |
|
25 | + <?php while (have_posts()) : the_post(); ?> |
|
26 | 26 | |
27 | - <?php get_template_part( 'content', get_post_type() ); ?> |
|
27 | + <?php get_template_part('content', get_post_type()); ?> |
|
28 | 28 | |
29 | 29 | <?php endwhile; // end of the loop. ?> |
30 | 30 |
@@ -10,23 +10,23 @@ discard block |
||
10 | 10 | |
11 | 11 | <?php lsx_content_top(); ?> |
12 | 12 | |
13 | - <?php if(is_tax()){ ?> |
|
13 | + <?php if (is_tax()) { ?> |
|
14 | 14 | <div class="entry-content"> |
15 | 15 | <?php the_archive_description(); ?> |
16 | 16 | </div> |
17 | 17 | <?php } ?> |
18 | 18 | |
19 | 19 | <?php |
20 | - if ( post_type_exists( 'jetpack-portfolio' ) && have_posts() ) : |
|
20 | + if (post_type_exists('jetpack-portfolio') && have_posts()) : |
|
21 | 21 | ?> |
22 | 22 | |
23 | - <?php if(!is_tax()){ lsx_portfolio_sorter(); } ?> |
|
23 | + <?php if ( ! is_tax()) { lsx_portfolio_sorter(); } ?> |
|
24 | 24 | |
25 | 25 | <div class="filter-items-wrapper lsx-portfolio-wrapper"> |
26 | 26 | <div id="portfolio-infinite-scroll-wrapper" class="filter-items-container lsx-portfolio masonry"> |
27 | - <?php while ( have_posts() ) : the_post(); ?> |
|
27 | + <?php while (have_posts()) : the_post(); ?> |
|
28 | 28 | |
29 | - <?php get_template_part( 'content', 'portfolio' ); ?> |
|
29 | + <?php get_template_part('content', 'portfolio'); ?> |
|
30 | 30 | |
31 | 31 | <?php endwhile; ?> |
32 | 32 | </div> |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | |
41 | 41 | <section class="no-results not-found"> |
42 | 42 | <header class="page-header"> |
43 | - <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); ?></h1> |
|
43 | + <h1 class="page-title"><?php esc_html_e('Nothing Found', 'lsx'); ?></h1> |
|
44 | 44 | </header><!-- .page-header --> |
45 | 45 | |
46 | 46 | <div class="page-content"> |
47 | - <?php if ( current_user_can( 'publish_posts' ) ) : ?> |
|
47 | + <?php if (current_user_can('publish_posts')) : ?> |
|
48 | 48 | |
49 | - <p><?php esc_html_e( 'Ready to publish your first project?', 'lsx' ); ?> <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=jetpack-portfolio' ) ) ?>"><?php esc_html_e( 'Get started here', 'lsx' ); ?></a></p> |
|
49 | + <p><?php esc_html_e('Ready to publish your first project?', 'lsx'); ?> <a href="<?php echo esc_url(admin_url('post-new.php?post_type=jetpack-portfolio')) ?>"><?php esc_html_e('Get started here', 'lsx'); ?></a></p> |
|
50 | 50 | |
51 | 51 | <?php else : ?> |
52 | 52 | |
53 | - <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); ?></p> |
|
53 | + <p><?php esc_html_e('It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx'); ?></p> |
|
54 | 54 | <?php get_search_form(); ?> |
55 | 55 | |
56 | 56 | <?php endif; ?> |
@@ -36,11 +36,14 @@ discard block |
||
36 | 36 | |
37 | 37 | <?php lsx_paging_nav(); ?> |
38 | 38 | |
39 | - <?php else : ?> |
|
39 | + <?php else { |
|
40 | + : ?> |
|
40 | 41 | |
41 | 42 | <section class="no-results not-found"> |
42 | 43 | <header class="page-header"> |
43 | - <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); ?></h1> |
|
44 | + <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); |
|
45 | +} |
|
46 | +?></h1> |
|
44 | 47 | </header><!-- .page-header --> |
45 | 48 | |
46 | 49 | <div class="page-content"> |
@@ -48,9 +51,12 @@ discard block |
||
48 | 51 | |
49 | 52 | <p><?php esc_html_e( 'Ready to publish your first project?', 'lsx' ); ?> <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=jetpack-portfolio' ) ) ?>"><?php esc_html_e( 'Get started here', 'lsx' ); ?></a></p> |
50 | 53 | |
51 | - <?php else : ?> |
|
54 | + <?php else { |
|
55 | + : ?> |
|
52 | 56 | |
53 | - <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); ?></p> |
|
57 | + <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); |
|
58 | +} |
|
59 | +?></p> |
|
54 | 60 | <?php get_search_form(); ?> |
55 | 61 | |
56 | 62 | <?php endif; ?> |