@@ -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,50 +28,50 @@ 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( 'automatic-feed-links' ); |
|
41 | - add_theme_support( 'title-tag' ); |
|
42 | - add_theme_support( 'post-thumbnails' ); |
|
43 | - add_theme_support( 'post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside') ); |
|
40 | + add_theme_support('automatic-feed-links'); |
|
41 | + add_theme_support('title-tag'); |
|
42 | + add_theme_support('post-thumbnails'); |
|
43 | + add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside')); |
|
44 | 44 | |
45 | 45 | // This theme uses wp_nav_menu() in one location. |
46 | - register_nav_menus( array( |
|
47 | - 'primary' => __( 'Primary Menu', 'lsx' ), |
|
48 | - 'top-menu'=> __( 'Top Menu' , 'lsx' ), |
|
49 | - 'social'=> __( 'Social Menu' , 'lsx' ), |
|
50 | - 'footer'=> __( 'Footer Menu' , 'lsx' ) |
|
51 | - ) ); |
|
46 | + register_nav_menus(array( |
|
47 | + 'primary' => __('Primary Menu', 'lsx'), |
|
48 | + 'top-menu'=> __('Top Menu', 'lsx'), |
|
49 | + 'social'=> __('Social Menu', 'lsx'), |
|
50 | + 'footer'=> __('Footer Menu', 'lsx') |
|
51 | + )); |
|
52 | 52 | |
53 | 53 | //Set the content width |
54 | 54 | $content_width = 1140; |
55 | 55 | |
56 | - add_editor_style( get_template_directory_uri() . '/css/editor-style.css' ); |
|
57 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
56 | + add_editor_style(get_template_directory_uri() . '/css/editor-style.css'); |
|
57 | + add_theme_support('html5', array('caption')); |
|
58 | 58 | |
59 | - add_theme_support( 'woocommerce' ); |
|
60 | - add_theme_support( 'sensei' ); |
|
59 | + add_theme_support('woocommerce'); |
|
60 | + add_theme_support('sensei'); |
|
61 | 61 | } |
62 | 62 | endif; // lsx_setup |
63 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
63 | +add_action('after_setup_theme', 'lsx_setup'); |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Removes the "Custom Fields" meta box. |
67 | 67 | */ |
68 | 68 | function lsx_remove_meta_boxes() { |
69 | 69 | $post_types = get_post_types(); |
70 | - foreach($post_types as $post_type){ |
|
71 | - remove_meta_box( 'postcustom' , $post_type , 'normal' ); |
|
70 | + foreach ($post_types as $post_type) { |
|
71 | + remove_meta_box('postcustom', $post_type, 'normal'); |
|
72 | 72 | } |
73 | 73 | } |
74 | -add_action( 'admin_menu' , 'lsx_remove_meta_boxes' ); |
|
74 | +add_action('admin_menu', 'lsx_remove_meta_boxes'); |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -83,34 +83,34 @@ discard block |
||
83 | 83 | function lsx_process_content_width() { |
84 | 84 | global $content_width; |
85 | 85 | |
86 | - if( |
|
86 | + if ( |
|
87 | 87 | is_page_template('page-templates/template-portfolio.php') || |
88 | 88 | is_page_template('page-templates/template-front-page.php') || |
89 | 89 | is_page_template('page-templates/template-full-width.php') || |
90 | 90 | is_post_type_archive('jetpack-portfolio') || |
91 | - is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) || |
|
91 | + is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) || |
|
92 | 92 | is_singular('jetpack-portfolio') |
93 | - ){ |
|
93 | + ) { |
|
94 | 94 | $content_width = 1140; |
95 | 95 | } |
96 | 96 | } |
97 | -add_action('wp_head','lsx_process_content_width'); |
|
97 | +add_action('wp_head', 'lsx_process_content_width'); |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Disable the comments form by default for the page post type. |
101 | 101 | * @package lsx |
102 | 102 | * @subpackage config |
103 | 103 | */ |
104 | -function lsx_page_comments_off( $data ) { |
|
104 | +function lsx_page_comments_off($data) { |
|
105 | 105 | |
106 | - if( $data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft','lsx') ) { |
|
106 | + if ($data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft', 'lsx')) { |
|
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. |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function lsx_is_legacy($data) { |
121 | 121 | |
122 | - if( $data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft','lsx') ) { |
|
122 | + if ($data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft', 'lsx')) { |
|
123 | 123 | $data['comment_status'] = 0; |
124 | 124 | $data['ping_status'] = 0; |
125 | 125 | } |
126 | 126 | |
127 | 127 | return $data; |
128 | 128 | } |
129 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
129 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
130 | 130 | |
131 | 131 | /** |
132 | 132 | * Run the init command |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | * @subpackage config |
135 | 135 | */ |
136 | 136 | function lsx_init() { |
137 | - if(class_exists('WooCommerce')){ |
|
138 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); |
|
137 | + if (class_exists('WooCommerce')) { |
|
138 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); |
|
139 | 139 | } |
140 | 140 | } |
141 | -add_action( 'init', 'lsx_init',100 ); |
|
141 | +add_action('init', 'lsx_init', 100); |
|
142 | 142 | |
143 | 143 | /** |
144 | 144 | * Run on the wp_head |
@@ -147,11 +147,11 @@ discard block |
||
147 | 147 | */ |
148 | 148 | function lsx_wp_head() { |
149 | 149 | |
150 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
151 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
150 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
151 | + $layout = apply_filters('lsx_layout', $layout); |
|
152 | 152 | |
153 | - 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')) ){ |
|
154 | - remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
153 | + 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'))) { |
|
154 | + remove_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
155 | 155 | } |
156 | 156 | } |
157 | -add_action( 'wp_head', 'lsx_wp_head',100 ); |
|
157 | +add_action('wp_head', 'lsx_wp_head', 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 |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | * @category portfolio |
124 | 124 | */ |
125 | 125 | function lsx_remove_single_related_posts() { |
126 | - if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
127 | - $jprp = Jetpack_RelatedPosts::init(); |
|
128 | - $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
129 | - remove_filter( 'the_content', $callback, 40 ); |
|
130 | - } |
|
126 | + if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
127 | + $jprp = Jetpack_RelatedPosts::init(); |
|
128 | + $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
129 | + remove_filter( 'the_content', $callback, 40 ); |
|
130 | + } |
|
131 | 131 | } |
132 | 132 | add_filter( 'wp', 'lsx_remove_single_related_posts', 20 ); |
133 | 133 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if(is_array($types)){ |
312 | 312 | foreach ($types as $type) { |
313 | 313 | $content = '<li><a href="#" data-filter=".'.$type->slug.'">'; |
314 | - $content .= $type->name; |
|
314 | + $content .= $type->name; |
|
315 | 315 | $content .= '</a></li>'; |
316 | 316 | echo $content; |
317 | 317 | echo "\n"; |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function lsx_allowed_related_post_types($allowed_post_types) { |
21 | 21 | $allowed_post_types[] = 'jetpack-portfolio'; |
22 | - foreach($allowed_post_types as $key => $value){ |
|
23 | - if('page' == $value){ |
|
22 | + foreach ($allowed_post_types as $key => $value) { |
|
23 | + if ('page' == $value) { |
|
24 | 24 | unset($allowed_post_types[$key]); |
25 | 25 | } |
26 | 26 | } |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | * @category site-logo |
36 | 36 | */ |
37 | 37 | |
38 | -function lsx_site_logo_title_tag( $html) { |
|
38 | +function lsx_site_logo_title_tag($html) { |
|
39 | 39 | |
40 | - $html = str_replace('<a', '<a title="'.get_bloginfo('name').'" ', $html); |
|
40 | + $html = str_replace('<a', '<a title="' . get_bloginfo('name') . '" ', $html); |
|
41 | 41 | return $html; |
42 | 42 | } |
43 | -add_filter( 'jetpack_the_site_logo', 'lsx_site_logo_title_tag'); |
|
43 | +add_filter('jetpack_the_site_logo', 'lsx_site_logo_title_tag'); |
|
44 | 44 | |
45 | 45 | |
46 | 46 | /* |
@@ -54,19 +54,19 @@ discard block |
||
54 | 54 | * @subpackage jetpack |
55 | 55 | * @category portfolio |
56 | 56 | */ |
57 | -function lsx_portfolio_infinite_scroll(){ |
|
58 | - global $_wp_theme_features,$wp_query; |
|
57 | +function lsx_portfolio_infinite_scroll() { |
|
58 | + global $_wp_theme_features, $wp_query; |
|
59 | 59 | |
60 | - if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')){ |
|
60 | + if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')) { |
|
61 | 61 | |
62 | - if(class_exists('The_Neverending_Home_Page')){ |
|
62 | + if (class_exists('The_Neverending_Home_Page')) { |
|
63 | 63 | $_wp_theme_features['infinite-scroll'][0]['container'] = 'portfolio-infinite-scroll-wrapper'; |
64 | 64 | $_wp_theme_features['infinite-scroll'][0]['posts_per_page'] = 99; |
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | 68 | } |
69 | -add_action('wp_head','lsx_portfolio_infinite_scroll',1000); |
|
69 | +add_action('wp_head', 'lsx_portfolio_infinite_scroll', 1000); |
|
70 | 70 | |
71 | 71 | /** |
72 | 72 | * Disables the infinite scroll on the portfolio archive |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | * @subpackage jetpack |
76 | 76 | * @category portfolio |
77 | 77 | */ |
78 | -function lsx_portfolio_infinite_scroll_disable($supported){ |
|
79 | - if(is_post_type_archive('jetpack-portfolio')){ |
|
78 | +function lsx_portfolio_infinite_scroll_disable($supported) { |
|
79 | + if (is_post_type_archive('jetpack-portfolio')) { |
|
80 | 80 | $supported = false; |
81 | 81 | } |
82 | 82 | return $supported; |
83 | 83 | } |
84 | -add_filter( 'infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10 ); |
|
84 | +add_filter('infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10); |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Set the Portfolio to 9 posts per page |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | * @subpackage jetpack |
91 | 91 | * @category portfolio |
92 | 92 | */ |
93 | -function lsx_portfolio_archive_pagination( $query ) { |
|
94 | - if(!is_admin()){ |
|
95 | - if ( $query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) { |
|
96 | - $query->set( 'posts_per_page', -1 ); |
|
93 | +function lsx_portfolio_archive_pagination($query) { |
|
94 | + if ( ! is_admin()) { |
|
95 | + if ($query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) { |
|
96 | + $query->set('posts_per_page', -1); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
100 | -add_action( 'pre_get_posts', 'lsx_portfolio_archive_pagination' , 100 ); |
|
100 | +add_action('pre_get_posts', 'lsx_portfolio_archive_pagination', 100); |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * Remove the related posts from below the content area. |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | * @category portfolio |
108 | 108 | */ |
109 | 109 | function lsx_remove_portfolio_related_posts() { |
110 | - if ( is_single() && 'jetpack-portfolio' == get_post_type() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
110 | + if (is_single() && 'jetpack-portfolio' == get_post_type() && class_exists('Jetpack_RelatedPosts')) { |
|
111 | 111 | $jprp = Jetpack_RelatedPosts::init(); |
112 | - $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
113 | - remove_filter( 'the_content', $callback, 40 ); |
|
112 | + $callback = array($jprp, 'filter_add_target_to_dom'); |
|
113 | + remove_filter('the_content', $callback, 40); |
|
114 | 114 | } |
115 | 115 | } |
116 | -add_filter( 'wp', 'lsx_remove_portfolio_related_posts', 20 ); |
|
116 | +add_filter('wp', 'lsx_remove_portfolio_related_posts', 20); |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Remove the related posts from below the content area. |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | * @category portfolio |
124 | 124 | */ |
125 | 125 | function lsx_remove_single_related_posts() { |
126 | - if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
126 | + if (is_single() && class_exists('Jetpack_RelatedPosts')) { |
|
127 | 127 | $jprp = Jetpack_RelatedPosts::init(); |
128 | - $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
129 | - remove_filter( 'the_content', $callback, 40 ); |
|
128 | + $callback = array($jprp, 'filter_add_target_to_dom'); |
|
129 | + remove_filter('the_content', $callback, 40); |
|
130 | 130 | } |
131 | 131 | } |
132 | -add_filter( 'wp', 'lsx_remove_single_related_posts', 20 ); |
|
132 | +add_filter('wp', 'lsx_remove_single_related_posts', 20); |
|
133 | 133 | |
134 | 134 | /** |
135 | 135 | * A template tag to call the Portfolios Related posts |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | * @subpackage jetpack |
139 | 139 | * @category portfolio |
140 | 140 | */ |
141 | -function lsx_portfolio_related_posts(){ |
|
142 | - if(class_exists('Jetpack_RelatedPosts')){ ?> |
|
141 | +function lsx_portfolio_related_posts() { |
|
142 | + if (class_exists('Jetpack_RelatedPosts')) { ?> |
|
143 | 143 | <div class="row"> |
144 | 144 | <div class="col-md-12"> |
145 | 145 | <?php echo do_shortcode('[jetpack-related-posts]'); ?> |
@@ -156,16 +156,16 @@ discard block |
||
156 | 156 | * @category portfolio |
157 | 157 | */ |
158 | 158 | function lsx_portfolio_remove_share() { |
159 | - if ( ( is_single() && 'jetpack-portfolio' == get_post_type() ) || is_page_template( 'page-templates/template-portfolio.php' ) ) { |
|
160 | - remove_filter( 'the_content', 'sharing_display',19 ); |
|
161 | - remove_filter( 'the_excerpt', 'sharing_display',19 ); |
|
159 | + if ((is_single() && 'jetpack-portfolio' == get_post_type()) || is_page_template('page-templates/template-portfolio.php')) { |
|
160 | + remove_filter('the_content', 'sharing_display', 19); |
|
161 | + remove_filter('the_excerpt', 'sharing_display', 19); |
|
162 | 162 | |
163 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
164 | - remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); |
|
163 | + if (class_exists('Jetpack_Likes')) { |
|
164 | + remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | } |
168 | -add_action( 'loop_start', 'lsx_portfolio_remove_share' ); |
|
168 | +add_action('loop_start', 'lsx_portfolio_remove_share'); |
|
169 | 169 | |
170 | 170 | /** |
171 | 171 | * Remove the sharing from single |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | * @category post |
176 | 176 | */ |
177 | 177 | function lsx_single_remove_share() { |
178 | - if ( is_single() ) { |
|
179 | - remove_filter( 'the_content', 'sharing_display',19 ); |
|
180 | - remove_filter( 'the_excerpt', 'sharing_display',19 ); |
|
178 | + if (is_single()) { |
|
179 | + remove_filter('the_content', 'sharing_display', 19); |
|
180 | + remove_filter('the_excerpt', 'sharing_display', 19); |
|
181 | 181 | |
182 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
183 | - remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); |
|
182 | + if (class_exists('Jetpack_Likes')) { |
|
183 | + remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1); |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | } |
187 | -add_action( 'loop_start', 'lsx_single_remove_share' ); |
|
187 | +add_action('loop_start', 'lsx_single_remove_share'); |
|
188 | 188 | |
189 | 189 | /** |
190 | 190 | * Redirect the template archive to our one |
@@ -193,18 +193,18 @@ discard block |
||
193 | 193 | * @subpackage jetpack |
194 | 194 | * @category portfolio |
195 | 195 | */ |
196 | -function lsx_portfolio_taxonomy_template( $template ) { |
|
196 | +function lsx_portfolio_taxonomy_template($template) { |
|
197 | 197 | |
198 | - if ( is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) ) { |
|
199 | - $new_template = locate_template( array( 'archive-jetpack-portfolio.php' ) ); |
|
200 | - if ( '' != $new_template ) { |
|
201 | - return $new_template ; |
|
198 | + if (is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag'))) { |
|
199 | + $new_template = locate_template(array('archive-jetpack-portfolio.php')); |
|
200 | + if ('' != $new_template) { |
|
201 | + return $new_template; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
205 | 205 | return $template; |
206 | 206 | } |
207 | -add_filter( 'template_include', 'lsx_portfolio_taxonomy_template', 99 ); |
|
207 | +add_filter('template_include', 'lsx_portfolio_taxonomy_template', 99); |
|
208 | 208 | |
209 | 209 | |
210 | 210 | /** |
@@ -214,39 +214,39 @@ discard block |
||
214 | 214 | * @subpackage jetpack |
215 | 215 | * @category portfolio |
216 | 216 | */ |
217 | -add_action( 'add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes' ); |
|
218 | -add_action( 'save_post', 'lsx_save_portfolio_post_meta', 100, 2 ); |
|
217 | +add_action('add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes'); |
|
218 | +add_action('save_post', 'lsx_save_portfolio_post_meta', 100, 2); |
|
219 | 219 | |
220 | -function lsx_save_portfolio_post_meta( $post_id, $post ) { |
|
221 | - $lsx_website_nonce = sanitize_text_field( wp_unslash( $_POST['lsx_website_nonce'] ) ); |
|
222 | - $lsx_client_nonce = sanitize_text_field( wp_unslash( $_POST['lsx_client_nonce'] ) ); |
|
220 | +function lsx_save_portfolio_post_meta($post_id, $post) { |
|
221 | + $lsx_website_nonce = sanitize_text_field(wp_unslash($_POST['lsx_website_nonce'])); |
|
222 | + $lsx_client_nonce = sanitize_text_field(wp_unslash($_POST['lsx_client_nonce'])); |
|
223 | 223 | |
224 | - if ( ! wp_verify_nonce( $lsx_website_nonce, basename( __FILE__ ) ) || ! wp_verify_nonce( $lsx_client_nonce, basename( __FILE__ ) ) ) { |
|
224 | + if ( ! wp_verify_nonce($lsx_website_nonce, basename(__FILE__)) || ! wp_verify_nonce($lsx_client_nonce, basename(__FILE__))) { |
|
225 | 225 | return $post_id; |
226 | 226 | } |
227 | 227 | |
228 | - $post_type = get_post_type_object( $post->post_type ); |
|
228 | + $post_type = get_post_type_object($post->post_type); |
|
229 | 229 | |
230 | - if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) |
|
230 | + if ( ! current_user_can($post_type->cap->edit_post, $post_id)) |
|
231 | 231 | return $post_id; |
232 | 232 | |
233 | 233 | |
234 | - $meta_keys = array('lsx-website','lsx-client'); |
|
234 | + $meta_keys = array('lsx-website', 'lsx-client'); |
|
235 | 235 | |
236 | - foreach($meta_keys as $meta_key){ |
|
237 | - $new_meta_value = sanitize_text_field( wp_unslash( $_POST[$meta_key] ) ); |
|
238 | - $new_meta_value = ! empty( $new_meta_value ) ? $new_meta_value : ''; |
|
236 | + foreach ($meta_keys as $meta_key) { |
|
237 | + $new_meta_value = sanitize_text_field(wp_unslash($_POST[$meta_key])); |
|
238 | + $new_meta_value = ! empty($new_meta_value) ? $new_meta_value : ''; |
|
239 | 239 | |
240 | - $meta_value = get_post_meta( $post_id, $meta_key, true ); |
|
240 | + $meta_value = get_post_meta($post_id, $meta_key, true); |
|
241 | 241 | |
242 | - if ( $new_meta_value && '' == $meta_value ) |
|
243 | - add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
242 | + if ($new_meta_value && '' == $meta_value) |
|
243 | + add_post_meta($post_id, $meta_key, $new_meta_value, true); |
|
244 | 244 | |
245 | - elseif ( $new_meta_value && $new_meta_value != $meta_value ) |
|
246 | - update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
245 | + elseif ($new_meta_value && $new_meta_value != $meta_value) |
|
246 | + update_post_meta($post_id, $meta_key, $new_meta_value); |
|
247 | 247 | |
248 | - elseif ( '' == $new_meta_value && $meta_value ) |
|
249 | - delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
248 | + elseif ('' == $new_meta_value && $meta_value) |
|
249 | + delete_post_meta($post_id, $meta_key, $meta_value); |
|
250 | 250 | |
251 | 251 | } |
252 | 252 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | add_meta_box( |
257 | 257 | 'lsx_client_meta_box', |
258 | - esc_html__( 'Client', 'lsx' ), |
|
258 | + esc_html__('Client', 'lsx'), |
|
259 | 259 | 'lsx_client_meta_box', |
260 | 260 | 'jetpack-portfolio', |
261 | 261 | 'side', |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | |
265 | 265 | add_meta_box( |
266 | 266 | 'lsx_website_meta_box', |
267 | - esc_html__( 'Website', 'lsx' ), |
|
267 | + esc_html__('Website', 'lsx'), |
|
268 | 268 | 'lsx_website_meta_box', |
269 | 269 | 'jetpack-portfolio', |
270 | 270 | 'side', |
@@ -272,25 +272,25 @@ discard block |
||
272 | 272 | ); |
273 | 273 | } |
274 | 274 | |
275 | -function lsx_client_meta_box( $object, $box ) { ?> |
|
275 | +function lsx_client_meta_box($object, $box) { ?> |
|
276 | 276 | |
277 | - <?php wp_nonce_field( basename( __FILE__ ), 'lsx_client_nonce' ); ?> |
|
277 | + <?php wp_nonce_field(basename(__FILE__), 'lsx_client_nonce'); ?> |
|
278 | 278 | |
279 | 279 | <p> |
280 | - <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-client', true ) ); ?>" size="30" /> |
|
280 | + <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-client', true)); ?>" size="30" /> |
|
281 | 281 | <br /><br /> |
282 | - <label for="lsx-client"><?php esc_html_e( 'Enter the name of the project client', 'lsx' ); ?></label> |
|
282 | + <label for="lsx-client"><?php esc_html_e('Enter the name of the project client', 'lsx'); ?></label> |
|
283 | 283 | </p> |
284 | 284 | <?php } |
285 | 285 | |
286 | -function lsx_website_meta_box( $object, $box ) { ?> |
|
286 | +function lsx_website_meta_box($object, $box) { ?> |
|
287 | 287 | |
288 | - <?php wp_nonce_field( basename( __FILE__ ), 'lsx_website_nonce' ); ?> |
|
288 | + <?php wp_nonce_field(basename(__FILE__), 'lsx_website_nonce'); ?> |
|
289 | 289 | |
290 | 290 | <p> |
291 | - <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-website', true ) ); ?>" size="30" /> |
|
291 | + <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-website', true)); ?>" size="30" /> |
|
292 | 292 | <br /><br /> |
293 | - <label for="lsx-website"><?php esc_html_e( 'Enter the URL of the project website', 'lsx' ); ?></label> |
|
293 | + <label for="lsx-website"><?php esc_html_e('Enter the URL of the project website', 'lsx'); ?></label> |
|
294 | 294 | </p> |
295 | 295 | <?php } |
296 | 296 | |
@@ -303,18 +303,18 @@ discard block |
||
303 | 303 | * @category portfolio |
304 | 304 | */ |
305 | 305 | |
306 | -function lsx_portfolio_sorter(){ ?> |
|
306 | +function lsx_portfolio_sorter() { ?> |
|
307 | 307 | <ul id="filterNav" class="clearfix"> |
308 | - <li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e( 'All', 'lsx' ); ?></a></li> |
|
308 | + <li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e('All', 'lsx'); ?></a></li> |
|
309 | 309 | <?php |
310 | 310 | $types = get_terms('jetpack-portfolio-type'); |
311 | 311 | |
312 | - if(is_array($types)){ |
|
312 | + if (is_array($types)) { |
|
313 | 313 | foreach ($types as $type) { |
314 | - $content = '<li><a href="#" data-filter=".'.$type->slug.'">'; |
|
314 | + $content = '<li><a href="#" data-filter=".' . $type->slug . '">'; |
|
315 | 315 | $content .= $type->name; |
316 | 316 | $content .= '</a></li>'; |
317 | - echo wp_kses_post( $content ); |
|
317 | + echo wp_kses_post($content); |
|
318 | 318 | echo "\n"; |
319 | 319 | } |
320 | 320 | }?> |
@@ -329,18 +329,18 @@ discard block |
||
329 | 329 | * @category portfolio |
330 | 330 | */ |
331 | 331 | |
332 | -function lsx_portfolio_naviagtion_labels($labels){ |
|
332 | +function lsx_portfolio_naviagtion_labels($labels) { |
|
333 | 333 | |
334 | - if(is_post_type_archive('jetpack-portfolio')){ |
|
334 | + if (is_post_type_archive('jetpack-portfolio')) { |
|
335 | 335 | $labels = array( |
336 | - 'next' => '<span class="meta-nav">←</span> '.__( 'Older', 'lsx' ), |
|
337 | - 'previous' => __( 'Newer', 'lsx' ).' <span class="meta-nav">→</span>', |
|
338 | - 'title' => __( 'Portfolio navigation', 'lsx' ) |
|
336 | + 'next' => '<span class="meta-nav">←</span> ' . __('Older', 'lsx'), |
|
337 | + 'previous' => __('Newer', 'lsx') . ' <span class="meta-nav">→</span>', |
|
338 | + 'title' => __('Portfolio navigation', 'lsx') |
|
339 | 339 | ); |
340 | 340 | } |
341 | 341 | return $labels; |
342 | 342 | } |
343 | -add_filter('lsx_post_navigation_labels','lsx_portfolio_naviagtion_labels',1,10); |
|
343 | +add_filter('lsx_post_navigation_labels', 'lsx_portfolio_naviagtion_labels', 1, 10); |
|
344 | 344 | |
345 | 345 | |
346 | 346 | /* |
@@ -354,11 +354,11 @@ discard block |
||
354 | 354 | * @subpackage jetpack |
355 | 355 | * @category related-posts |
356 | 356 | */ |
357 | -function lsx_remove_related_post_context(){ |
|
358 | - add_filter( 'jetpack_relatedposts_filter_post_context', '__return_empty_string' ); |
|
359 | - add_filter( 'rest_api_allowed_post_types', 'lsx_allowed_related_post_types' ); |
|
357 | +function lsx_remove_related_post_context() { |
|
358 | + add_filter('jetpack_relatedposts_filter_post_context', '__return_empty_string'); |
|
359 | + add_filter('rest_api_allowed_post_types', 'lsx_allowed_related_post_types'); |
|
360 | 360 | } |
361 | -add_action('init','lsx_remove_related_post_context',20); |
|
361 | +add_action('init', 'lsx_remove_related_post_context', 20); |
|
362 | 362 | |
363 | 363 | |
364 | 364 | /* |
@@ -375,13 +375,13 @@ discard block |
||
375 | 375 | $infinite_scroll_args = array( |
376 | 376 | 'container' => 'main', |
377 | 377 | 'type' => 'click', |
378 | - 'posts_per_page' => get_option('posts_per_page',10), |
|
378 | + 'posts_per_page' => get_option('posts_per_page', 10), |
|
379 | 379 | 'render' => 'lsx_infinite_scroll_render' |
380 | 380 | ); |
381 | 381 | |
382 | - add_theme_support( 'infinite-scroll', $infinite_scroll_args ); |
|
382 | + add_theme_support('infinite-scroll', $infinite_scroll_args); |
|
383 | 383 | } |
384 | -add_action( 'after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup' ); |
|
384 | +add_action('after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup'); |
|
385 | 385 | |
386 | 386 | /** |
387 | 387 | * Set the code to be rendered on for calling posts, |
@@ -394,13 +394,13 @@ discard block |
||
394 | 394 | function lsx_infinite_scroll_render() { |
395 | 395 | global $wp_query; |
396 | 396 | |
397 | - while(have_posts()){ |
|
397 | + while (have_posts()) { |
|
398 | 398 | the_post(); |
399 | 399 | |
400 | - if('jetpack-portfolio' == get_post_type()){ |
|
401 | - get_template_part( 'content', 'portfolio' ); |
|
402 | - }else{ |
|
403 | - get_template_part( 'content', get_post_type() ); |
|
400 | + if ('jetpack-portfolio' == get_post_type()) { |
|
401 | + get_template_part('content', 'portfolio'); |
|
402 | + } else { |
|
403 | + get_template_part('content', get_post_type()); |
|
404 | 404 | } |
405 | 405 | } |
406 | 406 | } |
@@ -412,8 +412,8 @@ discard block |
||
412 | 412 | * @subpackage jetpack |
413 | 413 | * @category related posts |
414 | 414 | */ |
415 | -function lsx_related_posts_headline( $headline ) { |
|
416 | - $headline = sprintf( '<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html( 'Related Posts' ) ); |
|
415 | +function lsx_related_posts_headline($headline) { |
|
416 | + $headline = sprintf('<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html('Related Posts')); |
|
417 | 417 | return $headline; |
418 | 418 | } |
419 | -add_filter( 'jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline' ); |
|
419 | +add_filter('jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline'); |
@@ -227,8 +227,9 @@ discard block |
||
227 | 227 | |
228 | 228 | $post_type = get_post_type_object( $post->post_type ); |
229 | 229 | |
230 | - if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) |
|
231 | - return $post_id; |
|
230 | + if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) { |
|
231 | + return $post_id; |
|
232 | + } |
|
232 | 233 | |
233 | 234 | |
234 | 235 | $meta_keys = array('lsx-website','lsx-client'); |
@@ -239,14 +240,13 @@ discard block |
||
239 | 240 | |
240 | 241 | $meta_value = get_post_meta( $post_id, $meta_key, true ); |
241 | 242 | |
242 | - if ( $new_meta_value && '' == $meta_value ) |
|
243 | - add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
244 | - |
|
245 | - elseif ( $new_meta_value && $new_meta_value != $meta_value ) |
|
246 | - update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
247 | - |
|
248 | - elseif ( '' == $new_meta_value && $meta_value ) |
|
249 | - delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
243 | + if ( $new_meta_value && '' == $meta_value ) { |
|
244 | + add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
245 | + } elseif ( $new_meta_value && $new_meta_value != $meta_value ) { |
|
246 | + update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
247 | + } elseif ( '' == $new_meta_value && $meta_value ) { |
|
248 | + delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
249 | + } |
|
250 | 250 | |
251 | 251 | } |
252 | 252 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | |
400 | 400 | if('jetpack-portfolio' == get_post_type()){ |
401 | 401 | get_template_part( 'content', 'portfolio' ); |
402 | - }else{ |
|
402 | + } else{ |
|
403 | 403 | get_template_part( 'content', get_post_type() ); |
404 | 404 | } |
405 | 405 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @category styles |
126 | 126 | */ |
127 | 127 | function lsx_sensei_styles() { |
128 | - wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css' ); |
|
128 | + wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css' ); |
|
129 | 129 | } |
130 | 130 | add_action( 'wp_enqueue_scripts', 'lsx_sensei_styles' ); |
131 | 131 | |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | * @category styles |
137 | 137 | */ |
138 | 138 | function lsx_sensei_redirect_to_home( $query ){ |
139 | - if(!is_admin() && is_post_type_archive( 'lesson' ) ) { |
|
140 | - wp_redirect( home_url() . '/courses-overview' ); |
|
141 | - exit; |
|
142 | - } |
|
139 | + if(!is_admin() && is_post_type_archive( 'lesson' ) ) { |
|
140 | + wp_redirect( home_url() . '/courses-overview' ); |
|
141 | + exit; |
|
142 | + } |
|
143 | 143 | } |
144 | 144 | add_action( 'parse_query', 'lsx_sensei_redirect_to_home' ); |
145 | 145 |
@@ -12,26 +12,26 @@ discard block |
||
12 | 12 | * Hooks |
13 | 13 | */ |
14 | 14 | |
15 | -remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 ); |
|
16 | -remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 ); |
|
15 | +remove_action('sensei_before_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper'), 10); |
|
16 | +remove_action('sensei_after_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper_end'), 10); |
|
17 | 17 | |
18 | 18 | add_action('sensei_before_main_content', 'lsx_sensei_before_content', 10); |
19 | 19 | add_action('sensei_after_main_content', 'lsx_sensei_after_content', 10); |
20 | 20 | |
21 | 21 | //Switching the course filters and the headers around |
22 | -remove_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 ); |
|
23 | -remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ) ); |
|
24 | -remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ) ); |
|
25 | -add_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 ); |
|
26 | -add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ),12 ); |
|
27 | -add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ),12 ); |
|
22 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0); |
|
23 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting')); |
|
24 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters')); |
|
25 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0); |
|
26 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12); |
|
27 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12); |
|
28 | 28 | |
29 | 29 | // Moving course image up in DOM |
30 | -remove_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,10, 1 ); |
|
31 | -add_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,1, 1 ); |
|
30 | +remove_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 10, 1); |
|
31 | +add_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 1, 1); |
|
32 | 32 | |
33 | -remove_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 20 ); |
|
34 | -add_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 12 ); |
|
33 | +remove_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 20); |
|
34 | +add_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 12); |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Adds the top and primary divs for the layout. |
@@ -39,22 +39,22 @@ discard block |
||
39 | 39 | * @subpackage sensei |
40 | 40 | * @category layout |
41 | 41 | */ |
42 | -function lsx_sensei_wp_head(){ |
|
42 | +function lsx_sensei_wp_head() { |
|
43 | 43 | |
44 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
45 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
44 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
45 | + $layout = apply_filters('lsx_layout', $layout); |
|
46 | 46 | |
47 | - if('1c' === $layout && is_post_type_archive(array('course','lesson'))) { |
|
48 | - add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11 ); |
|
47 | + if ('1c' === $layout && is_post_type_archive(array('course', 'lesson'))) { |
|
48 | + add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11); |
|
49 | 49 | } |
50 | 50 | |
51 | - if('1c' === $layout && is_tax(array('module','course-category'))) { |
|
51 | + if ('1c' === $layout && is_tax(array('module', 'course-category'))) { |
|
52 | 52 | remove_action('lsx_content_top', 'lsx_breadcrumbs'); |
53 | - add_action( 'sensei_loop_course_before', 'lsx_breadcrumbs', 80 , 1 ); |
|
53 | + add_action('sensei_loop_course_before', 'lsx_breadcrumbs', 80, 1); |
|
54 | 54 | |
55 | - if(is_tax('module')){ |
|
56 | - remove_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 20 ); |
|
57 | - add_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 40 ); |
|
55 | + if (is_tax('module')) { |
|
56 | + remove_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 20); |
|
57 | + add_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 40); |
|
58 | 58 | |
59 | 59 | remove_action('sensei_content_lesson_inside_before', array('Sensei_Core_Modules', 'module_archive_description'), 11); |
60 | 60 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * @subpackage sensei |
74 | 74 | * @category layout |
75 | 75 | */ |
76 | -function lsx_sensei_before_content(){ ?> |
|
76 | +function lsx_sensei_before_content() { ?> |
|
77 | 77 | <?php lsx_content_wrap_before(); ?> |
78 | 78 | |
79 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
79 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
80 | 80 | |
81 | 81 | <?php lsx_content_before(); ?> |
82 | 82 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @subpackage sensei |
93 | 93 | * @category layout |
94 | 94 | */ |
95 | -function lsx_sensei_after_content(){ ?> |
|
95 | +function lsx_sensei_after_content() { ?> |
|
96 | 96 | <?php lsx_content_bottom(); ?> |
97 | 97 | |
98 | 98 | </main><!-- #main --> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @subpackage sensei |
117 | 117 | * @category redirect |
118 | 118 | */ |
119 | -add_filter( 'sensei_disable_styles', '__return_true' ); |
|
119 | +add_filter('sensei_disable_styles', '__return_true'); |
|
120 | 120 | |
121 | 121 | /** |
122 | 122 | * Includes the sensei specific styles. |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | * @category styles |
126 | 126 | */ |
127 | 127 | function lsx_sensei_styles() { |
128 | - wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css' ); |
|
128 | + wp_enqueue_style('sensei', get_template_directory_uri() . '/css/sensei.css'); |
|
129 | 129 | } |
130 | -add_action( 'wp_enqueue_scripts', 'lsx_sensei_styles' ); |
|
130 | +add_action('wp_enqueue_scripts', 'lsx_sensei_styles'); |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Redirects Lessons Archive to Courses Overview |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | * @subpackage woocommerce |
136 | 136 | * @category styles |
137 | 137 | */ |
138 | -function lsx_sensei_redirect_to_home( $query ){ |
|
139 | - if(!is_admin() && is_post_type_archive( 'lesson' ) ) { |
|
140 | - wp_redirect( home_url() . '/courses-overview' ); |
|
138 | +function lsx_sensei_redirect_to_home($query) { |
|
139 | + if ( ! is_admin() && is_post_type_archive('lesson')) { |
|
140 | + wp_redirect(home_url() . '/courses-overview'); |
|
141 | 141 | exit; |
142 | 142 | } |
143 | 143 | } |
144 | -add_action( 'parse_query', 'lsx_sensei_redirect_to_home' ); |
|
144 | +add_action('parse_query', 'lsx_sensei_redirect_to_home'); |
|
145 | 145 | |
146 | 146 | /** |
147 | 147 | * Filters the archive title |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | * @subpackage woocommerce |
150 | 150 | * @category styles |
151 | 151 | */ |
152 | -function lsx_sensei_category_title( $html,$term_id ){ |
|
153 | - $html = str_replace('h2','h1',$html); |
|
154 | - $html = str_replace('sensei-category-title','archive-title',$html); |
|
152 | +function lsx_sensei_category_title($html, $term_id) { |
|
153 | + $html = str_replace('h2', 'h1', $html); |
|
154 | + $html = str_replace('sensei-category-title', 'archive-title', $html); |
|
155 | 155 | |
156 | - return '<header class="archive-header">'.$html.'</header>'; |
|
156 | + return '<header class="archive-header">' . $html . '</header>'; |
|
157 | 157 | } |
158 | -add_filter( 'course_category_title', 'lsx_sensei_category_title',1,10 ); |
|
159 | 158 | \ No newline at end of file |
159 | +add_filter('course_category_title', 'lsx_sensei_category_title', 1, 10); |
|
160 | 160 | \ No newline at end of file |
@@ -19,10 +19,10 @@ |
||
19 | 19 | */ |
20 | 20 | function lsx_buddypress_page_columns($layout) { |
21 | 21 | |
22 | - if(bp_is_profile_component()|| bp_is_settings_component() || bp_is_activity_component() || bp_is_group() || bp_is_messages_component() |
|
23 | - || bp_is_members_directory() || bp_is_groups_directory() || bp_is_groups_component() || bp_is_members_component()){ |
|
22 | + if (bp_is_profile_component() || bp_is_settings_component() || bp_is_activity_component() || bp_is_group() || bp_is_messages_component() |
|
23 | + || bp_is_members_directory() || bp_is_groups_directory() || bp_is_groups_component() || bp_is_members_component()) { |
|
24 | 24 | $layout = '1c'; |
25 | 25 | } |
26 | 26 | return $layout; |
27 | 27 | } |
28 | - add_filter( 'lsx_layout', 'lsx_buddypress_page_columns' , 1 , 100 ); |
|
29 | 28 | \ No newline at end of file |
29 | + add_filter('lsx_layout', 'lsx_buddypress_page_columns', 1, 100); |
|
30 | 30 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Cleaner walker for wp_nav_menu() |
@@ -25,7 +25,7 @@ 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 | |
@@ -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 || ($max_depth === 0)))); |
|
48 | + $element->is_dropdown = (( ! empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth || ($max_depth === 0)))); |
|
49 | 49 | |
50 | 50 | if ($element->is_dropdown) { |
51 | - if ($depth>0) { |
|
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 |
@@ -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,5 @@ |
||
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 Class |
5 | 5 | **/ |
@@ -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 |
@@ -14,27 +14,27 @@ 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 | - extract($args, EXTR_SKIP);?> |
|
37 | + extract($args, EXTR_SKIP);?> |
|
38 | 38 | |
39 | 39 | <li id="comment-<?php comment_ID(); ?>" <?php comment_class('media comment-' . get_comment_ID()); ?>> |
40 | 40 | <?php get_template_part('comment'); ?> |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | function end_el(&$output, $comment, $depth = 0, $args = array()) { |
45 | - if (!empty($args['end-callback'])) { |
|
46 | - call_user_func($args['end-callback'], $comment, $args, $depth); |
|
47 | - return; |
|
48 | - } |
|
49 | - echo "</div></li>\n"; |
|
45 | + if (!empty($args['end-callback'])) { |
|
46 | + call_user_func($args['end-callback'], $comment, $args, $depth); |
|
47 | + return; |
|
48 | + } |
|
49 | + echo "</div></li>\n"; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | } |
@@ -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,12 +29,12 @@ 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 | } |
36 | 36 | |
37 | - extract($args, EXTR_SKIP);?> |
|
37 | + extract($args, EXTR_SKIP); ?> |
|
38 | 38 | |
39 | 39 | <li id="comment-<?php comment_ID(); ?>" <?php comment_class('media comment-' . get_comment_ID()); ?>> |
40 | 40 | <?php get_template_part('comment'); ?> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | function end_el(&$output, $comment, $depth = 0, $args = array()) { |
45 | - if (!empty($args['end-callback'])) { |
|
45 | + if ( ! empty($args['end-callback'])) { |
|
46 | 46 | call_user_func($args['end-callback'], $comment, $args, $depth); |
47 | 47 | return; |
48 | 48 | } |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | * @subpackage layout |
65 | 65 | */ |
66 | 66 | function lsx_comment_form_fields_filter($fields) { |
67 | - foreach($fields as &$field){ |
|
68 | - if(stristr('class=', $field)){ |
|
67 | + foreach ($fields as &$field) { |
|
68 | + if (stristr('class=', $field)) { |
|
69 | 69 | $field = str_replace('class="', 'class="form-control ', $field); |
70 | - }else{ |
|
70 | + } else { |
|
71 | 71 | $field = str_replace('<input', '<input class="form-control" ', $field); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | return $fields; |
75 | 75 | } |
76 | -add_filter( 'comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
|
76 | +add_filter('comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
@@ -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 | } |
@@ -46,16 +46,16 @@ |
||
46 | 46 | |
47 | 47 | function lsx_sidebar_footer_params( $params ) { |
48 | 48 | |
49 | - $sidebar_id = $params[0]['id']; |
|
49 | + $sidebar_id = $params[0]['id']; |
|
50 | 50 | |
51 | - if ( $sidebar_id == 'sidebar-footer' ) { |
|
51 | + if ( $sidebar_id == 'sidebar-footer' ) { |
|
52 | 52 | |
53 | - $total_widgets = wp_get_sidebars_widgets(); |
|
54 | - $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
53 | + $total_widgets = wp_get_sidebars_widgets(); |
|
54 | + $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
55 | 55 | |
56 | - $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
57 | - } |
|
56 | + $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
57 | + } |
|
58 | 58 | |
59 | - return $params; |
|
59 | + return $params; |
|
60 | 60 | } |
61 | 61 | add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
62 | 62 | \ No newline at end of file |
@@ -1,54 +1,54 @@ 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 | |
49 | 49 | $sidebar_id = $params[0]['id']; |
50 | 50 | |
51 | - if ( $sidebar_id == 'sidebar-footer' ) { |
|
51 | + if ($sidebar_id == 'sidebar-footer') { |
|
52 | 52 | |
53 | 53 | $total_widgets = wp_get_sidebars_widgets(); |
54 | 54 | $sidebar_widgets = count($total_widgets[$sidebar_id]); |
@@ -58,4 +58,4 @@ discard block |
||
58 | 58 | |
59 | 59 | return $params; |
60 | 60 | } |
61 | -add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
|
62 | 61 | \ No newline at end of file |
62 | +add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); |
|
63 | 63 | \ 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 |
@@ -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' ); |
|
17 | + wp_enqueue_style( 'wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css' ); |
|
18 | 18 | } |
19 | 19 | add_action( 'wp_enqueue_scripts', 'lsx_wp_job_manager_styles' ); |
20 | 20 | \ No newline at end of file |
@@ -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' ); |
|
17 | + wp_enqueue_style('wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css'); |
|
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 |