@@ -1,5 +1,8 @@ discard block |
||
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 | * lsx Comment Walker |
@@ -67,7 +70,7 @@ discard block |
||
67 | 70 | foreach($fields as &$field){ |
68 | 71 | if(stristr('class=', $field)){ |
69 | 72 | $field = str_replace('class="', 'class="form-control ', $field); |
70 | - }else{ |
|
73 | + } else{ |
|
71 | 74 | $field = str_replace('<input', '<input class="form-control" ', $field); |
72 | 75 | } |
73 | 76 | } |
@@ -14,25 +14,25 @@ discard block |
||
14 | 14 | */ |
15 | 15 | class LSX_Walker_Comment extends Walker_Comment { |
16 | 16 | function start_lvl(&$output, $depth = 0, $args = array()) { |
17 | - $GLOBALS['comment_depth'] = $depth + 1; ?> |
|
17 | + $GLOBALS['comment_depth'] = $depth + 1; ?> |
|
18 | 18 | <ul <?php comment_class('media unstyled comment-' . get_comment_ID()); ?>> |
19 | 19 | <?php |
20 | 20 | } |
21 | 21 | |
22 | 22 | function end_lvl(&$output, $depth = 0, $args = array()) { |
23 | - $GLOBALS['comment_depth'] = $depth + 1; |
|
24 | - echo '</ul>'; |
|
23 | + $GLOBALS['comment_depth'] = $depth + 1; |
|
24 | + echo '</ul>'; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0) { |
28 | - $depth++; |
|
29 | - $GLOBALS['comment_depth'] = $depth; |
|
30 | - $GLOBALS['comment'] = $comment; |
|
28 | + $depth++; |
|
29 | + $GLOBALS['comment_depth'] = $depth; |
|
30 | + $GLOBALS['comment'] = $comment; |
|
31 | 31 | |
32 | - if (!empty($args['callback'])) { |
|
33 | - call_user_func($args['callback'], $comment, $args, $depth); |
|
34 | - return; |
|
35 | - }?> |
|
32 | + if (!empty($args['callback'])) { |
|
33 | + call_user_func($args['callback'], $comment, $args, $depth); |
|
34 | + return; |
|
35 | + }?> |
|
36 | 36 | |
37 | 37 | <li id="comment-<?php comment_ID(); ?>" <?php comment_class('media comment-' . get_comment_ID()); ?>> |
38 | 38 | <?php get_template_part('comment'); ?> |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | function end_el(&$output, $comment, $depth = 0, $args = array()) { |
43 | - if (!empty($args['end-callback'])) { |
|
44 | - call_user_func($args['end-callback'], $comment, $args, $depth); |
|
45 | - return; |
|
46 | - } |
|
47 | - echo "</div></li>\n"; |
|
43 | + if (!empty($args['end-callback'])) { |
|
44 | + call_user_func($args['end-callback'], $comment, $args, $depth); |
|
45 | + return; |
|
46 | + } |
|
47 | + echo "</div></li>\n"; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | } |
@@ -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 | * lsx Comment Walker |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $GLOBALS['comment_depth'] = $depth; |
30 | 30 | $GLOBALS['comment'] = $comment; |
31 | 31 | |
32 | - if (!empty($args['callback'])) { |
|
32 | + if ( ! empty($args['callback'])) { |
|
33 | 33 | call_user_func($args['callback'], $comment, $args, $depth); |
34 | 34 | return; |
35 | 35 | }?> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | function end_el(&$output, $comment, $depth = 0, $args = array()) { |
43 | - if (!empty($args['end-callback'])) { |
|
43 | + if ( ! empty($args['end-callback'])) { |
|
44 | 44 | call_user_func($args['end-callback'], $comment, $args, $depth); |
45 | 45 | return; |
46 | 46 | } |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | } |
57 | 57 | add_filter('get_avatar', 'lsx_get_avatar'); |
58 | 58 | |
59 | -add_action( 'admin_bar_menu', function() { remove_filter( 'get_avatar','lsx_get_avatar' ); }, 0 ); |
|
60 | -add_action( 'wp_after_admin_bar_render', function() { add_filter( 'get_avatar','lsx_get_avatar' ); } ); |
|
59 | +add_action('admin_bar_menu', function() { remove_filter('get_avatar', 'lsx_get_avatar'); }, 0); |
|
60 | +add_action('wp_after_admin_bar_render', function() { add_filter('get_avatar', 'lsx_get_avatar'); } ); |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Comment Form Field Filter |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | * @subpackage layout |
67 | 67 | */ |
68 | 68 | function lsx_comment_form_fields_filter($fields) { |
69 | - foreach($fields as &$field){ |
|
70 | - if(stristr('class=', $field)){ |
|
69 | + foreach ($fields as &$field) { |
|
70 | + if (stristr('class=', $field)) { |
|
71 | 71 | $field = str_replace('class="', 'class="form-control ', $field); |
72 | - }else{ |
|
72 | + } else { |
|
73 | 73 | $field = str_replace('<input', '<input class="form-control" ', $field); |
74 | 74 | } |
75 | 75 | } |
76 | 76 | return $fields; |
77 | 77 | } |
78 | -add_filter( 'comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
|
78 | +add_filter('comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
@@ -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 | * Register widgetized area and update sidebar with default widgets. |
@@ -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' => esc_html__( 'Home', 'lsx' ), |
|
9 | + register_sidebar(array( |
|
10 | + 'name' => esc_html__('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' => esc_html__( 'Sidebar', 'lsx' ), |
|
18 | + register_sidebar(array( |
|
19 | + 'name' => esc_html__('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' => esc_html__( 'Footer', 'lsx' ), |
|
27 | + register_sidebar(array( |
|
28 | + 'name' => esc_html__('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' => esc_html__( 'Footer Call to Action', 'lsx' ), |
|
36 | + register_sidebar(array( |
|
37 | + 'name' => esc_html__('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 | * Customizer Header 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 | * Google Font_Collection Class |
5 | 8 | **/ |
@@ -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 | * Google Font_Collection Class |
5 | 5 | **/ |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | **/ |
16 | 16 | public function __construct($fonts) |
17 | 17 | { |
18 | - if(empty($fonts)) |
|
18 | + if (empty($fonts)) |
|
19 | 19 | { |
20 | 20 | //we didn't get the required data |
21 | 21 | return false; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // create fonts |
25 | 25 | foreach ($fonts as $key => $value) |
26 | 26 | { |
27 | - if( empty( $value["system"] ) ){ |
|
27 | + if (empty($value["system"])) { |
|
28 | 28 | $this->fonts[$value["title"]] = new LSX_Google_Font($value["title"], $value["location"], $value["cssDeclaration"], $value["cssClass"]); |
29 | 29 | } |
30 | 30 | } |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | foreach ($this->fonts as $key => $value) |
107 | 107 | { |
108 | 108 | $protocol = 'http'; |
109 | - if(is_ssl()){ $protocol.='s'; } |
|
109 | + if (is_ssl()) { $protocol .= 's'; } |
|
110 | 110 | ?> |
111 | - <link href="<?php echo esc_attr( $protocol ); ?>://fonts.googleapis.com/css?family=<?php echo esc_attr( $value->__get( "location" ) ); ?>" rel='stylesheet'> |
|
111 | + <link href="<?php echo esc_attr($protocol); ?>://fonts.googleapis.com/css?family=<?php echo esc_attr($value->__get("location")); ?>" rel='stylesheet'> |
|
112 | 112 | <?php |
113 | 113 | } |
114 | 114 | } |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | foreach ($this->fonts as $key => $value) |
126 | 126 | { |
127 | 127 | ?> |
128 | - .<?php echo esc_attr( $value->__get( "cssClass" ) ); ?>{ |
|
129 | - font-family: <?php echo esc_attr( $value->__get( "cssDeclaration" ) ); ?>; |
|
128 | + .<?php echo esc_attr($value->__get("cssClass")); ?>{ |
|
129 | + font-family: <?php echo esc_attr($value->__get("cssDeclaration")); ?>; |
|
130 | 130 | } |
131 | 131 | <?php |
132 | 132 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Constructor |
15 | - **/ |
|
15 | + **/ |
|
16 | 16 | public function __construct($fonts) |
17 | 17 | { |
18 | 18 | if(empty($fonts)) |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * get_font_family_name_array Function |
35 | 35 | * this function returns an array containing all of the font family names |
36 | - **/ |
|
36 | + **/ |
|
37 | 37 | function get_font_family_name_array() |
38 | 38 | { |
39 | 39 | $result; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * get_title |
49 | 49 | * this function returns the font title |
50 | - **/ |
|
50 | + **/ |
|
51 | 51 | function get_title($key) |
52 | 52 | { |
53 | 53 | return $this->fonts[$key]->__get("title"); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * get_location |
58 | 58 | * this function returns the font location |
59 | - **/ |
|
59 | + **/ |
|
60 | 60 | function get_location($key) |
61 | 61 | { |
62 | 62 | return $this->fonts[$key]->__get("location"); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | /** |
66 | 66 | * get_css_declaration |
67 | 67 | * this function returns the font css declaration |
68 | - **/ |
|
68 | + **/ |
|
69 | 69 | function get_css_declaration($key) |
70 | 70 | { |
71 | 71 | return $this->fonts[$key]->__get("cssDeclaration"); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * this function returns an array of css classes |
78 | 78 | * this function is used when displaying the fancy list of fonts in the theme customizer |
79 | 79 | * this function is used to send a JS file an array for the postMessage transport option in the theme customizer |
80 | - **/ |
|
80 | + **/ |
|
81 | 81 | function get_css_class_array() |
82 | 82 | { |
83 | 83 | $result; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * get_total_number_of_fonts |
93 | 93 | * this function returns the total number of fonts |
94 | - **/ |
|
94 | + **/ |
|
95 | 95 | function get_total_number_of_fonts() |
96 | 96 | { |
97 | 97 | return count($this->fonts); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * print_theme_customizer_css_locations |
102 | 102 | * this function prints the links to the css files for the theme customizer |
103 | - **/ |
|
103 | + **/ |
|
104 | 104 | function print_theme_customizer_css_locations() |
105 | 105 | { |
106 | 106 | foreach ($this->fonts as $key => $value) |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | /** |
117 | 117 | * print_theme_customizer_css_classes |
118 | 118 | * this function prints the theme customizer css classes necessary to display all of the fonts |
119 | - **/ |
|
119 | + **/ |
|
120 | 120 | function print_theme_customizer_css_classes() |
121 | 121 | { |
122 | 122 | ?> |
@@ -1,5 +1,8 @@ discard block |
||
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 | * Customizer Configuration File |
@@ -164,7 +167,7 @@ discard block |
||
164 | 167 | $control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) ); |
165 | 168 | $wp_customize->add_control( $control ); |
166 | 169 | |
167 | - }else{ |
|
170 | + } else{ |
|
168 | 171 | |
169 | 172 | if( isset( $args['control'] ) ){ |
170 | 173 | unset( $args['control'] ); |
@@ -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 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | <?php lsx_content_top(); ?> |
19 | 19 | |
20 | - <?php while ( have_posts() ) : the_post(); ?> |
|
20 | + <?php while (have_posts()) : the_post(); ?> |
|
21 | 21 | |
22 | - <?php get_template_part( 'content', get_post_type() ); ?> |
|
22 | + <?php get_template_part('content', get_post_type()); ?> |
|
23 | 23 | |
24 | 24 | <?php endwhile; // end of the loop. ?> |
25 | 25 | |
@@ -35,6 +35,6 @@ discard block |
||
35 | 35 | <?php lsx_content_wrap_after(); ?> |
36 | 36 | |
37 | 37 | <?php get_sidebar(); ?> |
38 | -<?php get_sidebar( 'alt' ); ?> |
|
38 | +<?php get_sidebar('alt'); ?> |
|
39 | 39 | |
40 | 40 | <?php get_footer(); |
41 | 41 | \ No newline at end of file |
@@ -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; ?> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | <?php lsx_content_wrap_before(); ?> |
7 | 7 | |
8 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
8 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
9 | 9 | |
10 | 10 | <?php lsx_content_before(); ?> |
11 | 11 | |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | <?php lsx_content_top(); ?> |
15 | 15 | |
16 | - <?php while ( have_posts() ) : the_post(); ?> |
|
16 | + <?php while (have_posts()) : the_post(); ?> |
|
17 | 17 | |
18 | 18 | <?php lsx_entry_before(); ?> |
19 | 19 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | <?php lsx_sitemap_custom_post_type(); ?> |
29 | 29 | |
30 | 30 | </div><!-- .entry-content --> |
31 | - <?php edit_post_link( __( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
31 | + <?php edit_post_link(__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
32 | 32 | |
33 | 33 | <?php lsx_entry_bottom(); ?> |
34 | 34 |