@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @subpackage Gutenberg |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
@@ -14,41 +14,41 @@ discard block |
||
| 14 | 14 | * Enqueue Admin styles on admin area |
| 15 | 15 | */ |
| 16 | 16 | function load_gutenberg_admin_style() { |
| 17 | - wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/assets/css/admin/gutenberg-admin.css', false, '1.0.0' ); |
|
| 17 | + wp_enqueue_style('admin_css', get_template_directory_uri() . '/assets/css/admin/gutenberg-admin.css', false, '1.0.0'); |
|
| 18 | 18 | } |
| 19 | -add_action( 'admin_enqueue_scripts', 'load_gutenberg_admin_style' ); |
|
| 19 | +add_action('admin_enqueue_scripts', 'load_gutenberg_admin_style'); |
|
| 20 | 20 | |
| 21 | 21 | // Gutenberg Compatibility. |
| 22 | -require_once( get_template_directory() . '/lib/theme-support.php' ); |
|
| 22 | +require_once(get_template_directory() . '/lib/theme-support.php'); |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Add custom class for Gutenberg Compatible template |
| 26 | 26 | */ |
| 27 | -function add_gutenberg_compatible_body_class( $classes ) { |
|
| 27 | +function add_gutenberg_compatible_body_class($classes) { |
|
| 28 | 28 | // if ( ! is_home() && ! is_front_page() ). |
| 29 | - if ( is_page() || is_page_template() || is_single() ) |
|
| 29 | + if (is_page() || is_page_template() || is_single()) |
|
| 30 | 30 | $classes[] = 'gutenberg-compatible-template'; |
| 31 | 31 | |
| 32 | 32 | // Add a class if the page is using the Content and Media block. |
| 33 | 33 | $post = get_post(); |
| 34 | - if ( function_exists( 'has_blocks' ) && isset( $post->post_content ) && has_blocks( $post->post_content ) && ( ! is_search() ) && ( ! is_archive() ) ) { |
|
| 35 | - $blocks = parse_blocks( $post->post_content ); |
|
| 34 | + if (function_exists('has_blocks') && isset($post->post_content) && has_blocks($post->post_content) && ( ! is_search()) && ( ! is_archive())) { |
|
| 35 | + $blocks = parse_blocks($post->post_content); |
|
| 36 | 36 | |
| 37 | - if ( 'core/media-text' === $blocks[0]['blockName'] ) { |
|
| 37 | + if ('core/media-text' === $blocks[0]['blockName']) { |
|
| 38 | 38 | $classes[] = 'has-block-media-text'; |
| 39 | 39 | } |
| 40 | - if ( 'core/cover' === $blocks[0]['blockName'] ) { |
|
| 40 | + if ('core/cover' === $blocks[0]['blockName']) { |
|
| 41 | 41 | $classes[] = 'has-block-cover'; |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | return $classes; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -add_filter( 'body_class', __NAMESPACE__ . '\add_gutenberg_compatible_body_class' ); |
|
| 47 | +add_filter('body_class', __NAMESPACE__ . '\add_gutenberg_compatible_body_class'); |
|
| 48 | 48 | |
| 49 | 49 | // Add custom class for templates that are using the Gutenberg editor. |
| 50 | -add_action('body_class', function( $classes ) { |
|
| 51 | - if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) && ( ! is_search() ) && ( ! is_archive() ) && ( ! is_singular( 'project' ) ) ) |
|
| 50 | +add_action('body_class', function($classes) { |
|
| 51 | + if (function_exists('has_blocks') && has_blocks(get_the_ID()) && ( ! is_search()) && ( ! is_archive()) && ( ! is_singular('project'))) |
|
| 52 | 52 | $classes[] = 'using-gutenberg'; |
| 53 | 53 | return $classes; |
| 54 | 54 | }); |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | * @return void |
| 60 | 60 | */ |
| 61 | 61 | function remove_lsx_page_banner_when_using_blocks() { |
| 62 | - if ( function_exists( 'has_blocks' ) && ( ! class_exists( 'LSX_Banners' ) ) ) { |
|
| 63 | - add_filter( 'lsx_page_banner_disable', '__return_true' ); |
|
| 62 | + if (function_exists('has_blocks') && ( ! class_exists('LSX_Banners'))) { |
|
| 63 | + add_filter('lsx_page_banner_disable', '__return_true'); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | -add_filter( 'init', 'remove_lsx_page_banner_when_using_blocks' ); |
|
| 66 | +add_filter('init', 'remove_lsx_page_banner_when_using_blocks'); |
|
@@ -26,8 +26,9 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | function add_gutenberg_compatible_body_class( $classes ) { |
| 28 | 28 | // if ( ! is_home() && ! is_front_page() ). |
| 29 | - if ( is_page() || is_page_template() || is_single() ) |
|
| 30 | - $classes[] = 'gutenberg-compatible-template'; |
|
| 29 | + if ( is_page() || is_page_template() || is_single() ) { |
|
| 30 | + $classes[] = 'gutenberg-compatible-template'; |
|
| 31 | + } |
|
| 31 | 32 | |
| 32 | 33 | // Add a class if the page is using the Content and Media block. |
| 33 | 34 | $post = get_post(); |
@@ -48,8 +49,9 @@ discard block |
||
| 48 | 49 | |
| 49 | 50 | // Add custom class for templates that are using the Gutenberg editor. |
| 50 | 51 | add_action('body_class', function( $classes ) { |
| 51 | - if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) && ( ! is_search() ) && ( ! is_archive() ) && ( ! is_singular( 'project' ) ) ) |
|
| 52 | - $classes[] = 'using-gutenberg'; |
|
| 52 | + if ( function_exists( 'has_blocks' ) && has_blocks( get_the_ID() ) && ( ! is_search() ) && ( ! is_archive() ) && ( ! is_singular( 'project' ) ) ) { |
|
| 53 | + $classes[] = 'using-gutenberg'; |
|
| 54 | + } |
|
| 53 | 55 | return $classes; |
| 54 | 56 | }); |
| 55 | 57 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @subpackage hooks |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * This is the 1st action in the theme that fires after <head>. |
| 15 | 15 | */ |
| 16 | 16 | function lsx_head_top() { |
| 17 | - do_action( 'lsx_head_top' ); |
|
| 17 | + do_action('lsx_head_top'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -23,14 +23,14 @@ discard block |
||
| 23 | 23 | * @return void |
| 24 | 24 | */ |
| 25 | 25 | function lsx_head_bottom() { |
| 26 | - do_action( 'lsx_head_bottom' ); |
|
| 26 | + do_action('lsx_head_bottom'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * The 3rd action thta fires after <body> |
| 31 | 31 | */ |
| 32 | 32 | function lsx_body_top() { |
| 33 | - do_action( 'lsx_body_top' ); |
|
| 33 | + do_action('lsx_body_top'); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * $lsx_supports[] = 'header'; |
| 40 | 40 | */ |
| 41 | 41 | function lsx_header_before() { |
| 42 | - do_action( 'lsx_header_before' ); |
|
| 42 | + do_action('lsx_header_before'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @return void |
| 49 | 49 | */ |
| 50 | 50 | function lsx_header_top() { |
| 51 | - do_action( 'lsx_header_top' ); |
|
| 51 | + do_action('lsx_header_top'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @return void |
| 58 | 58 | */ |
| 59 | 59 | function lsx_nav_before() { |
| 60 | - do_action( 'lsx_nav_before' ); |
|
| 60 | + do_action('lsx_nav_before'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @return void |
| 67 | 67 | */ |
| 68 | 68 | function lsx_nav_after() { |
| 69 | - do_action( 'lsx_nav_after' ); |
|
| 69 | + do_action('lsx_nav_after'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * @return void |
| 76 | 76 | */ |
| 77 | 77 | function lsx_header_bottom() { |
| 78 | - do_action( 'lsx_header_bottom' ); |
|
| 78 | + do_action('lsx_header_bottom'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @return void |
| 85 | 85 | */ |
| 86 | 86 | function lsx_header_after() { |
| 87 | - do_action( 'lsx_header_after' ); |
|
| 87 | + do_action('lsx_header_after'); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @return void |
| 94 | 94 | */ |
| 95 | 95 | function lsx_header_wrap_after() { |
| 96 | - do_action( 'lsx_header_wrap_after' ); |
|
| 96 | + do_action('lsx_header_wrap_after'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @return void |
| 103 | 103 | */ |
| 104 | 104 | function lsx_body_bottom() { |
| 105 | - do_action( 'lsx_body_bottom' ); |
|
| 105 | + do_action('lsx_body_bottom'); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * $lsx_supports[] = 'banner'; |
| 112 | 112 | */ |
| 113 | 113 | function lsx_banner_content() { |
| 114 | - do_action( 'lsx_banner_content' ); |
|
| 114 | + do_action('lsx_banner_content'); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @return void |
| 121 | 121 | */ |
| 122 | 122 | function lsx_banner_inner_top() { |
| 123 | - do_action( 'lsx_banner_inner_top' ); |
|
| 123 | + do_action('lsx_banner_inner_top'); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @return void |
| 130 | 130 | */ |
| 131 | 131 | function lsx_banner_inner_bottom() { |
| 132 | - do_action( 'lsx_banner_inner_bottom' ); |
|
| 132 | + do_action('lsx_banner_inner_bottom'); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * $lsx_supports[] = 'global_header'; |
| 139 | 139 | */ |
| 140 | 140 | function lsx_global_header_inner_bottom() { |
| 141 | - do_action( 'lsx_global_header_inner_bottom' ); |
|
| 141 | + do_action('lsx_global_header_inner_bottom'); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * $lsx_supports[] = 'content'; |
| 148 | 148 | */ |
| 149 | 149 | function lsx_content_wrap_before() { |
| 150 | - do_action( 'lsx_content_wrap_before' ); |
|
| 150 | + do_action('lsx_content_wrap_before'); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @return void |
| 157 | 157 | */ |
| 158 | 158 | function lsx_content_wrap_after() { |
| 159 | - do_action( 'lsx_content_wrap_after' ); |
|
| 159 | + do_action('lsx_content_wrap_after'); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @return void |
| 166 | 166 | */ |
| 167 | 167 | function lsx_content_before() { |
| 168 | - do_action( 'lsx_content_before' ); |
|
| 168 | + do_action('lsx_content_before'); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * @return void |
| 175 | 175 | */ |
| 176 | 176 | function lsx_content_after() { |
| 177 | - do_action( 'lsx_content_after' ); |
|
| 177 | + do_action('lsx_content_after'); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * @return void |
| 184 | 184 | */ |
| 185 | 185 | function lsx_content_top() { |
| 186 | - do_action( 'lsx_content_top' ); |
|
| 186 | + do_action('lsx_content_top'); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * @return void |
| 193 | 193 | */ |
| 194 | 194 | function lsx_content_bottom() { |
| 195 | - do_action( 'lsx_content_bottom' ); |
|
| 195 | + do_action('lsx_content_bottom'); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * @return void |
| 202 | 202 | */ |
| 203 | 203 | function lsx_content_post_tags() { |
| 204 | - do_action( 'lsx_content_post_tags' ); |
|
| 204 | + do_action('lsx_content_post_tags'); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * @return void |
| 211 | 211 | */ |
| 212 | 212 | function lsx_content_sharing() { |
| 213 | - do_action( 'lsx_content_sharing' ); |
|
| 213 | + do_action('lsx_content_sharing'); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * $lsx_supports[] = 'entry'; |
| 220 | 220 | */ |
| 221 | 221 | function lsx_entry_before() { |
| 222 | - do_action( 'lsx_entry_before' ); |
|
| 222 | + do_action('lsx_entry_before'); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | /** |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | * @return void |
| 229 | 229 | */ |
| 230 | 230 | function lsx_entry_after() { |
| 231 | - do_action( 'lsx_entry_after' ); |
|
| 231 | + do_action('lsx_entry_after'); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | * @return void |
| 238 | 238 | */ |
| 239 | 239 | function lsx_entry_top() { |
| 240 | - do_action( 'lsx_entry_top' ); |
|
| 240 | + do_action('lsx_entry_top'); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | * @return void |
| 247 | 247 | */ |
| 248 | 248 | function lsx_entry_inside_top() { |
| 249 | - do_action( 'lsx_entry_inside_top' ); |
|
| 249 | + do_action('lsx_entry_inside_top'); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
@@ -255,14 +255,14 @@ discard block |
||
| 255 | 255 | * @return void |
| 256 | 256 | */ |
| 257 | 257 | function lsx_entry_bottom() { |
| 258 | - do_action( 'lsx_entry_bottom' ); |
|
| 258 | + do_action('lsx_entry_bottom'); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
| 262 | 262 | * Semantic <entry> hooks |
| 263 | 263 | */ |
| 264 | 264 | function lsx_post_meta_top() { |
| 265 | - do_action( 'lsx_post_meta_top' ); |
|
| 265 | + do_action('lsx_post_meta_top'); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | * $lsx_supports[] = 'entry'; |
| 272 | 272 | */ |
| 273 | 273 | function lsx_widget_entry_before() { |
| 274 | - do_action( 'lsx_widget_entry_before' ); |
|
| 274 | + do_action('lsx_widget_entry_before'); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | * @return void |
| 281 | 281 | */ |
| 282 | 282 | function lsx_widget_entry_after() { |
| 283 | - do_action( 'lsx_widget_entry_after' ); |
|
| 283 | + do_action('lsx_widget_entry_after'); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * @return void |
| 290 | 290 | */ |
| 291 | 291 | function lsx_widget_entry_top() { |
| 292 | - do_action( 'lsx_widget_entry_top' ); |
|
| 292 | + do_action('lsx_widget_entry_top'); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | * @return void |
| 299 | 299 | */ |
| 300 | 300 | function lsx_widget_entry_bottom() { |
| 301 | - do_action( 'lsx_widget_entry_bottom' ); |
|
| 301 | + do_action('lsx_widget_entry_bottom'); |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /** |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * @return void |
| 308 | 308 | */ |
| 309 | 309 | function lsx_widget_entry_content_top() { |
| 310 | - do_action( 'lsx_widget_entry_content_top' ); |
|
| 310 | + do_action('lsx_widget_entry_content_top'); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | * @return void |
| 317 | 317 | */ |
| 318 | 318 | function lsx_widget_entry_content_bottom() { |
| 319 | - do_action( 'lsx_widget_entry_content_bottom' ); |
|
| 319 | + do_action('lsx_widget_entry_content_bottom'); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | * $lsx_supports[] = 'comments'; |
| 326 | 326 | */ |
| 327 | 327 | function lsx_comments_before() { |
| 328 | - do_action( 'lsx_comments_before' ); |
|
| 328 | + do_action('lsx_comments_before'); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | * @return void |
| 335 | 335 | */ |
| 336 | 336 | function lsx_comments_after() { |
| 337 | - do_action( 'lsx_comments_after' ); |
|
| 337 | + do_action('lsx_comments_after'); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | * $lsx_supports[] = 'sidebar'; |
| 344 | 344 | */ |
| 345 | 345 | function lsx_sidebars_before() { |
| 346 | - do_action( 'lsx_sidebars_before' ); |
|
| 346 | + do_action('lsx_sidebars_before'); |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | /** |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | * @return void |
| 353 | 353 | */ |
| 354 | 354 | function lsx_sidebars_after() { |
| 355 | - do_action( 'lsx_sidebars_after' ); |
|
| 355 | + do_action('lsx_sidebars_after'); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | * @return void |
| 362 | 362 | */ |
| 363 | 363 | function lsx_sidebar_top() { |
| 364 | - do_action( 'lsx_sidebar_top' ); |
|
| 364 | + do_action('lsx_sidebar_top'); |
|
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | /** |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | * @return void |
| 371 | 371 | */ |
| 372 | 372 | function lsx_sidebar_bottom() { |
| 373 | - do_action( 'lsx_sidebar_bottom' ); |
|
| 373 | + do_action('lsx_sidebar_bottom'); |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | /** |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | * $lsx_supports[] = 'footer'; |
| 380 | 380 | */ |
| 381 | 381 | function lsx_footer_before() { |
| 382 | - do_action( 'lsx_footer_before' ); |
|
| 382 | + do_action('lsx_footer_before'); |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /** |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | * @return void |
| 389 | 389 | */ |
| 390 | 390 | function lsx_footer_after() { |
| 391 | - do_action( 'lsx_footer_after' ); |
|
| 391 | + do_action('lsx_footer_after'); |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /** |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | * @return void |
| 398 | 398 | */ |
| 399 | 399 | function lsx_footer_top() { |
| 400 | - do_action( 'lsx_footer_top' ); |
|
| 400 | + do_action('lsx_footer_top'); |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | /** |
@@ -406,5 +406,5 @@ discard block |
||
| 406 | 406 | * @return void |
| 407 | 407 | */ |
| 408 | 408 | function lsx_footer_bottom() { |
| 409 | - do_action( 'lsx_footer_bottom' ); |
|
| 409 | + do_action('lsx_footer_bottom'); |
|
| 410 | 410 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @subpackage extras |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | * @package lsx |
| 17 | 17 | * @subpackage extras |
| 18 | 18 | */ |
| 19 | -add_filter( 'widget_text', 'shortcode_unautop' ); |
|
| 20 | -add_filter( 'widget_text', 'do_shortcode' ); |
|
| 19 | +add_filter('widget_text', 'shortcode_unautop'); |
|
| 20 | +add_filter('widget_text', 'do_shortcode'); |
|
| 21 | 21 | |
| 22 | -if ( ! function_exists( 'lsx_kses_allowed_html' ) ) : |
|
| 22 | +if ( ! function_exists('lsx_kses_allowed_html')) : |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Enable extra attributes (srcset, sizes) in img tag. |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @package lsx |
| 28 | 28 | * @subpackage extras |
| 29 | 29 | */ |
| 30 | - function lsx_kses_allowed_html( $allowedtags, $context ) { |
|
| 30 | + function lsx_kses_allowed_html($allowedtags, $context) { |
|
| 31 | 31 | $allowedtags['img']['srcset'] = true; |
| 32 | 32 | $allowedtags['img']['sizes'] = true; |
| 33 | 33 | |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | endif; |
| 44 | 44 | |
| 45 | -add_filter( 'wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2 ); |
|
| 45 | +add_filter('wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2); |
|
| 46 | 46 | |
| 47 | -if ( ! function_exists( 'lsx_body_class' ) ) : |
|
| 47 | +if ( ! function_exists('lsx_body_class')) : |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Add and remove body_class() classes. |
@@ -52,60 +52,60 @@ discard block |
||
| 52 | 52 | * @package lsx |
| 53 | 53 | * @subpackage extras |
| 54 | 54 | */ |
| 55 | - function lsx_body_class( $classes ) { |
|
| 55 | + function lsx_body_class($classes) { |
|
| 56 | 56 | global $post; |
| 57 | 57 | |
| 58 | - $header_layout = get_theme_mod( 'lsx_header_layout', 'inline' ); |
|
| 58 | + $header_layout = get_theme_mod('lsx_header_layout', 'inline'); |
|
| 59 | 59 | $classes[] = 'header-' . $header_layout; |
| 60 | 60 | |
| 61 | - $mobile_header_layout = get_theme_mod( 'lsx_header_mobile_layout', 'navigation-bar' ); |
|
| 61 | + $mobile_header_layout = get_theme_mod('lsx_header_mobile_layout', 'navigation-bar'); |
|
| 62 | 62 | $classes[] = 'mobile-header-' . $mobile_header_layout; |
| 63 | 63 | |
| 64 | - if ( isset( $post ) ) { |
|
| 64 | + if (isset($post)) { |
|
| 65 | 65 | $classes[] = $post->post_name; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - if ( class_exists( 'LSX_Banners' ) && empty( apply_filters( 'lsx_banner_plugin_disable', false ) ) ) { |
|
| 69 | - $post_types = array( 'page', 'post' ); |
|
| 70 | - $post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types ); |
|
| 68 | + if (class_exists('LSX_Banners') && empty(apply_filters('lsx_banner_plugin_disable', false))) { |
|
| 69 | + $post_types = array('page', 'post'); |
|
| 70 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
| 71 | 71 | |
| 72 | - $img_group = get_post_meta( $post->ID, 'image_group', true ); |
|
| 72 | + $img_group = get_post_meta($post->ID, 'image_group', true); |
|
| 73 | 73 | |
| 74 | - if ( is_singular( $post_types ) && ! empty( $img_group ) && is_array( $img_group ) && ! empty( $img_group['banner_image'] ) ) { |
|
| 74 | + if (is_singular($post_types) && ! empty($img_group) && is_array($img_group) && ! empty($img_group['banner_image'])) { |
|
| 75 | 75 | $classes[] = 'page-has-banner'; |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if ( function_exists( 'tour_operator' ) ) { |
|
| 80 | - $post_types = array( 'page', 'post' ); |
|
| 79 | + if (function_exists('tour_operator')) { |
|
| 80 | + $post_types = array('page', 'post'); |
|
| 81 | 81 | |
| 82 | 82 | $classes[] = 'to-active'; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) { |
|
| 85 | + if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) { |
|
| 86 | 86 | $classes[] = 'has-top-menu'; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $fixed_header = get_theme_mod( 'lsx_header_fixed', false ); |
|
| 89 | + $fixed_header = get_theme_mod('lsx_header_fixed', false); |
|
| 90 | 90 | |
| 91 | - if ( false !== $fixed_header ) { |
|
| 91 | + if (false !== $fixed_header) { |
|
| 92 | 92 | $classes[] = 'top-menu-fixed'; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $search_form = get_theme_mod( 'lsx_header_search', false ); |
|
| 95 | + $search_form = get_theme_mod('lsx_header_search', false); |
|
| 96 | 96 | |
| 97 | - if ( false !== $search_form ) { |
|
| 97 | + if (false !== $search_form) { |
|
| 98 | 98 | $classes[] = 'has-header-search'; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $preloader_content = get_theme_mod( 'lsx_preloader_content_status', false ); |
|
| 101 | + $preloader_content = get_theme_mod('lsx_preloader_content_status', false); |
|
| 102 | 102 | |
| 103 | - if ( false !== $preloader_content ) { |
|
| 103 | + if (false !== $preloader_content) { |
|
| 104 | 104 | $classes[] = 'preloader-content-enable'; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - $register_enabled = get_option( 'users_can_register', false ); |
|
| 108 | - if ( ( $register_enabled ) && is_page( 'my-account' ) && is_singular() ) { |
|
| 107 | + $register_enabled = get_option('users_can_register', false); |
|
| 108 | + if (($register_enabled) && is_page('my-account') && is_singular()) { |
|
| 109 | 109 | $classes[] = 'register-enabled'; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | endif; |
| 116 | 116 | |
| 117 | -add_filter( 'body_class', 'lsx_body_class' ); |
|
| 117 | +add_filter('body_class', 'lsx_body_class'); |
|
| 118 | 118 | |
| 119 | -if ( ! function_exists( 'lsx_embed_wrap' ) ) : |
|
| 119 | +if ( ! function_exists('lsx_embed_wrap')) : |
|
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * Wrap embedded media as suggested by Readability. |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | * @link https://gist.github.com/965956 |
| 128 | 128 | * @link http://www.readability.com/publishers/guidelines#publisher |
| 129 | 129 | */ |
| 130 | - function lsx_embed_wrap( $cache, $url, $attr = '', $post_id = '' ) { |
|
| 131 | - if ( false !== strpos( $cache, '<iframe' ) ) { |
|
| 130 | + function lsx_embed_wrap($cache, $url, $attr = '', $post_id = '') { |
|
| 131 | + if (false !== strpos($cache, '<iframe')) { |
|
| 132 | 132 | return '<div class="entry-content-asset">' . $cache . '</div>'; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | endif; |
| 139 | 139 | |
| 140 | -add_filter( 'embed_oembed_html', 'lsx_embed_wrap', 10, 4 ); |
|
| 140 | +add_filter('embed_oembed_html', 'lsx_embed_wrap', 10, 4); |
|
| 141 | 141 | |
| 142 | -if ( ! function_exists( 'lsx_remove_self_closing_tags' ) ) : |
|
| 142 | +if ( ! function_exists('lsx_remove_self_closing_tags')) : |
|
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | 145 | * Remove unnecessary self-closing tags. |
@@ -147,17 +147,17 @@ discard block |
||
| 147 | 147 | * @package lsx |
| 148 | 148 | * @subpackage extras |
| 149 | 149 | */ |
| 150 | - function lsx_remove_self_closing_tags( $input ) { |
|
| 151 | - return str_replace( ' />', '>', $input ); |
|
| 150 | + function lsx_remove_self_closing_tags($input) { |
|
| 151 | + return str_replace(' />', '>', $input); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | endif; |
| 155 | 155 | |
| 156 | -add_filter( 'get_avatar', 'lsx_remove_self_closing_tags' ); // <img /> |
|
| 157 | -add_filter( 'comment_id_fields', 'lsx_remove_self_closing_tags' ); // <input /> |
|
| 158 | -add_filter( 'post_thumbnail_html', 'lsx_remove_self_closing_tags' ); // <img /> |
|
| 156 | +add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img /> |
|
| 157 | +add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input /> |
|
| 158 | +add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img /> |
|
| 159 | 159 | |
| 160 | -if ( ! function_exists( 'lsx_is_element_empty' ) ) : |
|
| 160 | +if ( ! function_exists('lsx_is_element_empty')) : |
|
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | 163 | * Checks if a Nav $element is empty or not. |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | * @package lsx |
| 166 | 166 | * @subpackage extras |
| 167 | 167 | */ |
| 168 | - function lsx_is_element_empty( $element ) { |
|
| 169 | - $element = trim( $element ); |
|
| 170 | - return empty( $element ) ? false : true; |
|
| 168 | + function lsx_is_element_empty($element) { |
|
| 169 | + $element = trim($element); |
|
| 170 | + return empty($element) ? false : true; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | endif; |
| 174 | 174 | |
| 175 | -if ( ! function_exists( 'lsx_get_thumbnail' ) ) : |
|
| 175 | +if ( ! function_exists('lsx_get_thumbnail')) : |
|
| 176 | 176 | |
| 177 | 177 | /** |
| 178 | 178 | * return the responsive images. |
@@ -180,62 +180,62 @@ discard block |
||
| 180 | 180 | * @package lsx |
| 181 | 181 | * @subpackage extras |
| 182 | 182 | */ |
| 183 | - function lsx_get_thumbnail( $size, $image_src = false ) { |
|
| 184 | - if ( false === $image_src ) { |
|
| 183 | + function lsx_get_thumbnail($size, $image_src = false) { |
|
| 184 | + if (false === $image_src) { |
|
| 185 | 185 | $post_id = get_the_ID(); |
| 186 | - $post_thumbnail_id = get_post_thumbnail_id( $post_id ); |
|
| 187 | - } elseif ( false !== $image_src ) { |
|
| 188 | - if ( is_numeric( $image_src ) ) { |
|
| 186 | + $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
| 187 | + } elseif (false !== $image_src) { |
|
| 188 | + if (is_numeric($image_src)) { |
|
| 189 | 189 | $post_thumbnail_id = $image_src; |
| 190 | 190 | } else { |
| 191 | - $post_thumbnail_id = lsx_get_attachment_id_from_src( $image_src ); |
|
| 191 | + $post_thumbnail_id = lsx_get_attachment_id_from_src($image_src); |
|
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - $size = apply_filters( 'lsx_thumbnail_size', $size ); |
|
| 195 | + $size = apply_filters('lsx_thumbnail_size', $size); |
|
| 196 | 196 | $img = ''; |
| 197 | 197 | $lazy_img = ''; |
| 198 | 198 | $image_url = ''; |
| 199 | 199 | |
| 200 | - if ( 'lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size ) { |
|
| 200 | + if ('lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size) { |
|
| 201 | 201 | $srcset = false; |
| 202 | - if ( ( ( 'team' === get_post_type() ) || ( 'testimonial' === get_post_type() ) ) && is_search() ) { |
|
| 203 | - $img = get_the_post_thumbnail_url( get_the_ID(), 'lsx-thumbnail-wide' ); |
|
| 202 | + if ((('team' === get_post_type()) || ('testimonial' === get_post_type())) && is_search()) { |
|
| 203 | + $img = get_the_post_thumbnail_url(get_the_ID(), 'lsx-thumbnail-wide'); |
|
| 204 | 204 | } else { |
| 205 | - $temp_img = wp_get_attachment_image_src( $post_thumbnail_id, $size ); |
|
| 206 | - if ( ! empty( $temp_img ) ) { |
|
| 205 | + $temp_img = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
| 206 | + if ( ! empty($temp_img)) { |
|
| 207 | 207 | $img = $temp_img[0]; |
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | } else { |
| 211 | 211 | $srcset = true; |
| 212 | - $img = wp_get_attachment_image_srcset( $post_thumbnail_id, $size ); |
|
| 212 | + $img = wp_get_attachment_image_srcset($post_thumbnail_id, $size); |
|
| 213 | 213 | |
| 214 | - $temp_lazy = wp_get_attachment_image_src( $post_thumbnail_id, $size ); |
|
| 215 | - if ( ! empty( $temp_lazy ) ) { |
|
| 214 | + $temp_lazy = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
| 215 | + if ( ! empty($temp_lazy)) { |
|
| 216 | 216 | $lazy_img = $temp_lazy[0]; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - if ( empty( $img ) ) { |
|
| 219 | + if (empty($img)) { |
|
| 220 | 220 | $srcset = false; |
| 221 | - if ( ! empty( $lazy_img ) ) { |
|
| 221 | + if ( ! empty($lazy_img)) { |
|
| 222 | 222 | $img = $lazy_img; |
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if ( '' !== $img ) { |
|
| 227 | + if ('' !== $img) { |
|
| 228 | 228 | $image_url = $img; |
| 229 | - $img = '<img title="' . the_title_attribute( 'echo=0' ) . '" alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" '; |
|
| 230 | - if ( $srcset ) { |
|
| 231 | - $img .= 'srcset="' . esc_attr( $image_url ) . '" '; |
|
| 229 | + $img = '<img title="' . the_title_attribute('echo=0') . '" alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" '; |
|
| 230 | + if ($srcset) { |
|
| 231 | + $img .= 'srcset="' . esc_attr($image_url) . '" '; |
|
| 232 | 232 | } else { |
| 233 | - $img .= 'src="' . esc_url( $image_url ) . '" '; |
|
| 233 | + $img .= 'src="' . esc_url($image_url) . '" '; |
|
| 234 | 234 | } |
| 235 | 235 | $img .= '/>'; |
| 236 | 236 | |
| 237 | - $img = apply_filters( 'lsx_lazyload_filter_images', $img ); |
|
| 238 | - $img = apply_filters( 'lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url ); |
|
| 237 | + $img = apply_filters('lsx_lazyload_filter_images', $img); |
|
| 238 | + $img = apply_filters('lsx_lazyload_slider_images', $img, $post_thumbnail_id, $size, $srcset, $image_url); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | return $img; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | endif; |
| 245 | 245 | |
| 246 | -if ( ! function_exists( 'lsx_thumbnail' ) ) : |
|
| 246 | +if ( ! function_exists('lsx_thumbnail')) : |
|
| 247 | 247 | |
| 248 | 248 | /** |
| 249 | 249 | * Output the Resonsive Images. |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | * @package lsx |
| 252 | 252 | * @subpackage extras |
| 253 | 253 | */ |
| 254 | - function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) { |
|
| 255 | - echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) ); |
|
| 254 | + function lsx_thumbnail($size = 'thumbnail', $image_src = false) { |
|
| 255 | + echo wp_kses_post(lsx_get_thumbnail($size, $image_src)); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | endif; |
| 259 | 259 | |
| 260 | -if ( ! function_exists( 'lsx_get_attachment_id_from_src' ) ) : |
|
| 260 | +if ( ! function_exists('lsx_get_attachment_id_from_src')) : |
|
| 261 | 261 | |
| 262 | 262 | /** |
| 263 | 263 | * Gets the attachments ID from the src. |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | * @package lsx |
| 266 | 266 | * @subpackage extras |
| 267 | 267 | */ |
| 268 | - function lsx_get_attachment_id_from_src( $image_src ) { |
|
| 269 | - $post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' ); |
|
| 268 | + function lsx_get_attachment_id_from_src($image_src) { |
|
| 269 | + $post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src'); |
|
| 270 | 270 | |
| 271 | - if ( false === $post_id ) { |
|
| 271 | + if (false === $post_id) { |
|
| 272 | 272 | global $wpdb; |
| 273 | - $post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) ); |
|
| 274 | - wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 ); |
|
| 273 | + $post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src)); |
|
| 274 | + wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | return $post_id; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | endif; |
| 281 | 281 | |
| 282 | -if ( ! function_exists( 'lsx_page_banner' ) ) : |
|
| 282 | +if ( ! function_exists('lsx_page_banner')) : |
|
| 283 | 283 | |
| 284 | 284 | /** |
| 285 | 285 | * Add Featured Image as Banner on Single Pages. |
@@ -288,30 +288,30 @@ discard block |
||
| 288 | 288 | * @subpackage extras |
| 289 | 289 | */ |
| 290 | 290 | function lsx_page_banner() { |
| 291 | - if ( true === apply_filters( 'lsx_page_banner_disable', false ) ) { |
|
| 291 | + if (true === apply_filters('lsx_page_banner_disable', false)) { |
|
| 292 | 292 | return; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - $post_types = array( 'page', 'post' ); |
|
| 296 | - $post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types ); |
|
| 295 | + $post_types = array('page', 'post'); |
|
| 296 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
| 297 | 297 | |
| 298 | - if ( is_singular( $post_types ) && has_post_thumbnail() ) : |
|
| 298 | + if (is_singular($post_types) && has_post_thumbnail()) : |
|
| 299 | 299 | $bg_image = ''; |
| 300 | 300 | |
| 301 | - if ( has_post_thumbnail() ) { |
|
| 302 | - $temp_bg_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' ); |
|
| 303 | - if ( ! empty( $temp_bg_image ) ) { |
|
| 301 | + if (has_post_thumbnail()) { |
|
| 302 | + $temp_bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); |
|
| 303 | + if ( ! empty($temp_bg_image)) { |
|
| 304 | 304 | $bg_image = $temp_bg_image[0]; |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - if ( '' !== $bg_image ) : |
|
| 308 | + if ('' !== $bg_image) : |
|
| 309 | 309 | ?> |
| 310 | 310 | <div class="page-banner-wrap"> |
| 311 | 311 | <div class="page-banner"> |
| 312 | 312 | <?php lsx_banner_inner_top(); ?> |
| 313 | 313 | |
| 314 | - <div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div> |
|
| 314 | + <div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div> |
|
| 315 | 315 | |
| 316 | 316 | <div class="container"> |
| 317 | 317 | <header class="page-header"> |
@@ -330,11 +330,11 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | endif; |
| 332 | 332 | |
| 333 | -add_filter( 'lsx_banner_disable', 'lsx_disable_banner_for_blocks' ); |
|
| 334 | -add_filter( 'lsx_global_header_disable', 'lsx_disable_banner_for_blocks' ); |
|
| 333 | +add_filter('lsx_banner_disable', 'lsx_disable_banner_for_blocks'); |
|
| 334 | +add_filter('lsx_global_header_disable', 'lsx_disable_banner_for_blocks'); |
|
| 335 | 335 | |
| 336 | 336 | |
| 337 | -if ( ! function_exists( 'lsx_disable_banner_for_blocks' ) ) : |
|
| 337 | +if ( ! function_exists('lsx_disable_banner_for_blocks')) : |
|
| 338 | 338 | |
| 339 | 339 | /** |
| 340 | 340 | * Disable the Banner if the page is using Blocks |
@@ -345,20 +345,20 @@ discard block |
||
| 345 | 345 | * @param $disable boolean |
| 346 | 346 | * @return boolean |
| 347 | 347 | */ |
| 348 | - function lsx_disable_banner_for_blocks( $disable ) { |
|
| 348 | + function lsx_disable_banner_for_blocks($disable) { |
|
| 349 | 349 | $queried_object = get_queried_object_id(); |
| 350 | - $show_on_front = get_option( 'show_on_front' ); |
|
| 350 | + $show_on_front = get_option('show_on_front'); |
|
| 351 | 351 | |
| 352 | - if ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object ) { |
|
| 352 | + if ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object) { |
|
| 353 | 353 | return $disable; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - if ( function_exists( 'has_blocks' ) && has_blocks() && ( ! is_archive() ) ) { |
|
| 356 | + if (function_exists('has_blocks') && has_blocks() && ( ! is_archive())) { |
|
| 357 | 357 | $disable = true; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | // Single projects will still have banners. |
| 361 | - if ( function_exists( 'has_blocks' ) && has_blocks() && ( is_singular( 'project' ) ) ) { |
|
| 361 | + if (function_exists('has_blocks') && has_blocks() && (is_singular('project'))) { |
|
| 362 | 362 | $disable = false; |
| 363 | 363 | } |
| 364 | 364 | return $disable; |
@@ -366,9 +366,9 @@ discard block |
||
| 366 | 366 | |
| 367 | 367 | endif; |
| 368 | 368 | |
| 369 | -add_action( 'lsx_header_after', 'lsx_page_banner' ); |
|
| 369 | +add_action('lsx_header_after', 'lsx_page_banner'); |
|
| 370 | 370 | |
| 371 | -if ( ! function_exists( 'lsx_form_submit_button' ) ) : |
|
| 371 | +if ( ! function_exists('lsx_form_submit_button')) : |
|
| 372 | 372 | |
| 373 | 373 | /** |
| 374 | 374 | * filter the Gravity Forms button type. |
@@ -380,15 +380,15 @@ discard block |
||
| 380 | 380 | * @param $form Object |
| 381 | 381 | * @return String |
| 382 | 382 | */ |
| 383 | - function lsx_form_submit_button( $button, $form ) { |
|
| 383 | + function lsx_form_submit_button($button, $form) { |
|
| 384 | 384 | return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>"; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | endif; |
| 388 | 388 | |
| 389 | -add_filter( 'gform_submit_button', 'lsx_form_submit_button', 10, 2 ); |
|
| 389 | +add_filter('gform_submit_button', 'lsx_form_submit_button', 10, 2); |
|
| 390 | 390 | |
| 391 | -if ( ! function_exists( 'lsx_excerpt_more' ) ) : |
|
| 391 | +if ( ! function_exists('lsx_excerpt_more')) : |
|
| 392 | 392 | |
| 393 | 393 | /** |
| 394 | 394 | * Replaces the excerpt "more" text by a link. |
@@ -396,15 +396,15 @@ discard block |
||
| 396 | 396 | * @package lsx |
| 397 | 397 | * @subpackage extras |
| 398 | 398 | */ |
| 399 | - function lsx_excerpt_more( $more ) { |
|
| 399 | + function lsx_excerpt_more($more) { |
|
| 400 | 400 | return '...'; |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | endif; |
| 404 | 404 | |
| 405 | -add_filter( 'excerpt_more', 'lsx_excerpt_more' ); |
|
| 405 | +add_filter('excerpt_more', 'lsx_excerpt_more'); |
|
| 406 | 406 | |
| 407 | -if ( ! function_exists( 'lsx_the_excerpt_filter' ) ) : |
|
| 407 | +if ( ! function_exists('lsx_the_excerpt_filter')) : |
|
| 408 | 408 | |
| 409 | 409 | /** |
| 410 | 410 | * Add a continue reading link to the excerpt. |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | * @package lsx |
| 413 | 413 | * @subpackage extras |
| 414 | 414 | */ |
| 415 | - function lsx_the_excerpt_filter( $excerpt ) { |
|
| 415 | + function lsx_the_excerpt_filter($excerpt) { |
|
| 416 | 416 | |
| 417 | 417 | $post_formats = array( |
| 418 | 418 | 'aside' => 'aside', |
@@ -425,10 +425,10 @@ discard block |
||
| 425 | 425 | 'audio' => 'audio', |
| 426 | 426 | ); |
| 427 | 427 | |
| 428 | - $show_full_content = has_post_format( apply_filters( 'lsx_the_excerpt_filter_post_types', $post_formats ) ); |
|
| 428 | + $show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', $post_formats)); |
|
| 429 | 429 | |
| 430 | - if ( ! $show_full_content ) { |
|
| 431 | - if ( '' !== $excerpt && ! stristr( $excerpt, 'moretag' ) ) { |
|
| 430 | + if ( ! $show_full_content) { |
|
| 431 | + if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) { |
|
| 432 | 432 | $pagination = wp_link_pages( |
| 433 | 433 | array( |
| 434 | 434 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
@@ -439,11 +439,11 @@ discard block |
||
| 439 | 439 | ) |
| 440 | 440 | ); |
| 441 | 441 | |
| 442 | - if ( ! empty( $pagination ) ) { |
|
| 442 | + if ( ! empty($pagination)) { |
|
| 443 | 443 | $excerpt .= $pagination; |
| 444 | 444 | } else { |
| 445 | - $excerpt_more = '<p><a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Read More', 'lsx' ) . '</a></p>'; |
|
| 446 | - $excerpt .= apply_filters( 'excerpt_more_p', $excerpt_more ); |
|
| 445 | + $excerpt_more = '<p><a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('Read More', 'lsx') . '</a></p>'; |
|
| 446 | + $excerpt .= apply_filters('excerpt_more_p', $excerpt_more); |
|
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | } |
@@ -453,9 +453,9 @@ discard block |
||
| 453 | 453 | |
| 454 | 454 | endif; |
| 455 | 455 | |
| 456 | -add_filter( 'the_excerpt', 'lsx_the_excerpt_filter', 1, 20 ); |
|
| 456 | +add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20); |
|
| 457 | 457 | |
| 458 | -if ( ! function_exists( 'lsx_full_width_widget_classes' ) ) : |
|
| 458 | +if ( ! function_exists('lsx_full_width_widget_classes')) : |
|
| 459 | 459 | |
| 460 | 460 | /** |
| 461 | 461 | * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget. |
@@ -463,8 +463,8 @@ discard block |
||
| 463 | 463 | * @package lsx |
| 464 | 464 | * @subpackage extras |
| 465 | 465 | */ |
| 466 | - function lsx_full_width_widget_classes( $params ) { |
|
| 467 | - if ( is_admin() ) { |
|
| 466 | + function lsx_full_width_widget_classes($params) { |
|
| 467 | + if (is_admin()) { |
|
| 468 | 468 | return $params; |
| 469 | 469 | } |
| 470 | 470 | |
@@ -473,9 +473,9 @@ discard block |
||
| 473 | 473 | $widget_id = $params[0]['widget_id']; |
| 474 | 474 | $widget_name = $params[0]['widget_name']; |
| 475 | 475 | |
| 476 | - if ( 'Text' === $widget_name ) { |
|
| 477 | - $wp_registered_widgets[ $widget_id ]['original_callback'] = $wp_registered_widgets[ $widget_id ]['callback']; |
|
| 478 | - $wp_registered_widgets[ $widget_id ]['callback'] = 'lsx_full_width_widget_custom_callback'; |
|
| 476 | + if ('Text' === $widget_name) { |
|
| 477 | + $wp_registered_widgets[$widget_id]['original_callback'] = $wp_registered_widgets[$widget_id]['callback']; |
|
| 478 | + $wp_registered_widgets[$widget_id]['callback'] = 'lsx_full_width_widget_custom_callback'; |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | return $params; |
@@ -483,9 +483,9 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | endif; |
| 485 | 485 | |
| 486 | -add_filter( 'dynamic_sidebar_params', 'lsx_full_width_widget_classes' ); |
|
| 486 | +add_filter('dynamic_sidebar_params', 'lsx_full_width_widget_classes'); |
|
| 487 | 487 | |
| 488 | -if ( ! function_exists( 'lsx_full_width_widget_custom_callback' ) ) : |
|
| 488 | +if ( ! function_exists('lsx_full_width_widget_custom_callback')) : |
|
| 489 | 489 | |
| 490 | 490 | /** |
| 491 | 491 | * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget. |
@@ -499,25 +499,25 @@ discard block |
||
| 499 | 499 | $original_callback_params = func_get_args(); |
| 500 | 500 | $widget_id = $original_callback_params[0]['widget_id']; |
| 501 | 501 | |
| 502 | - $original_callback = $wp_registered_widgets[ $widget_id ]['original_callback']; |
|
| 503 | - $wp_registered_widgets[ $widget_id ]['callback'] = $original_callback; |
|
| 502 | + $original_callback = $wp_registered_widgets[$widget_id]['original_callback']; |
|
| 503 | + $wp_registered_widgets[$widget_id]['callback'] = $original_callback; |
|
| 504 | 504 | |
| 505 | - $widget_id_base = $wp_registered_widgets[ $widget_id ]['callback'][0]->id_base; |
|
| 505 | + $widget_id_base = $wp_registered_widgets[$widget_id]['callback'][0]->id_base; |
|
| 506 | 506 | |
| 507 | 507 | $widget_classname = ''; |
| 508 | 508 | |
| 509 | - if ( is_callable( $original_callback ) ) { |
|
| 509 | + if (is_callable($original_callback)) { |
|
| 510 | 510 | ob_start(); |
| 511 | - call_user_func_array( $original_callback, $original_callback_params ); |
|
| 511 | + call_user_func_array($original_callback, $original_callback_params); |
|
| 512 | 512 | $widget_output = ob_get_clean(); |
| 513 | 513 | |
| 514 | - echo wp_kses_post( apply_filters( 'lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id ) ); |
|
| 514 | + echo wp_kses_post(apply_filters('lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id)); |
|
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | endif; |
| 519 | 519 | |
| 520 | -if ( ! function_exists( 'lsx_full_width_widget_output' ) ) : |
|
| 520 | +if ( ! function_exists('lsx_full_width_widget_output')) : |
|
| 521 | 521 | |
| 522 | 522 | /** |
| 523 | 523 | * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget. |
@@ -525,12 +525,12 @@ discard block |
||
| 525 | 525 | * @package lsx |
| 526 | 526 | * @subpackage extras |
| 527 | 527 | */ |
| 528 | - function lsx_full_width_widget_output( $widget_output, $widget_id_base, $widget_id ) { |
|
| 529 | - if ( 'text' === $widget_id_base ) { |
|
| 530 | - if ( false !== strpos( $widget_output, '<div class="lsx-full-width-alt">' ) ) { |
|
| 531 | - $widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output ); |
|
| 532 | - } elseif ( false !== strpos( $widget_output, '<div class="lsx-full-width">' ) ) { |
|
| 533 | - $widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output ); |
|
| 528 | + function lsx_full_width_widget_output($widget_output, $widget_id_base, $widget_id) { |
|
| 529 | + if ('text' === $widget_id_base) { |
|
| 530 | + if (false !== strpos($widget_output, '<div class="lsx-full-width-alt">')) { |
|
| 531 | + $widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output); |
|
| 532 | + } elseif (false !== strpos($widget_output, '<div class="lsx-full-width">')) { |
|
| 533 | + $widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output); |
|
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | |
@@ -539,13 +539,13 @@ discard block |
||
| 539 | 539 | |
| 540 | 540 | endif; |
| 541 | 541 | |
| 542 | -add_filter( 'lsx_widget_output', 'lsx_full_width_widget_output', 10, 3 ); |
|
| 542 | +add_filter('lsx_widget_output', 'lsx_full_width_widget_output', 10, 3); |
|
| 543 | 543 | |
| 544 | 544 | /** |
| 545 | 545 | * Check if the content has a restricted post format that needs to show a full excerpt. |
| 546 | 546 | */ |
| 547 | 547 | function lsx_post_format_force_content_on_list() { |
| 548 | - $post_formats = apply_filters( 'lsx_post_format_force_content_on_list', |
|
| 548 | + $post_formats = apply_filters('lsx_post_format_force_content_on_list', |
|
| 549 | 549 | array( |
| 550 | 550 | 'video' => 'video', |
| 551 | 551 | 'audio' => 'audio', |
@@ -553,8 +553,8 @@ discard block |
||
| 553 | 553 | 'link' => 'link', |
| 554 | 554 | ) |
| 555 | 555 | ); |
| 556 | - $return = false; |
|
| 557 | - if ( ! has_post_format( $post_formats ) ) { |
|
| 556 | + $return = false; |
|
| 557 | + if ( ! has_post_format($post_formats)) { |
|
| 558 | 558 | $return = true; |
| 559 | 559 | } |
| 560 | 560 | return $return; |
@@ -563,38 +563,38 @@ discard block |
||
| 563 | 563 | /** |
| 564 | 564 | * Remove the Hentry Class Every |
| 565 | 565 | */ |
| 566 | -function lsx_remove_hentry( $classes ) { |
|
| 567 | - if ( 'post' !== get_post_type() ) { |
|
| 568 | - $classes = array_diff( $classes, array( 'hentry' ) ); |
|
| 566 | +function lsx_remove_hentry($classes) { |
|
| 567 | + if ('post' !== get_post_type()) { |
|
| 568 | + $classes = array_diff($classes, array('hentry')); |
|
| 569 | 569 | } |
| 570 | 570 | return $classes; |
| 571 | 571 | } |
| 572 | -add_filter( 'post_class', 'lsx_remove_hentry' ); |
|
| 572 | +add_filter('post_class', 'lsx_remove_hentry'); |
|
| 573 | 573 | |
| 574 | 574 | /** |
| 575 | 575 | * Strip Excerpts. |
| 576 | 576 | */ |
| 577 | -function lsx_strip_excerpt( $content ) { |
|
| 578 | - if ( is_search() || is_archive() || ( is_blog_installed() && ! is_single() && ! is_page() ) ) { |
|
| 579 | - $content = strip_shortcodes( $content ); |
|
| 580 | - $content = str_replace( ']]>', ']]>', $content ); |
|
| 581 | - $content = strip_tags( $content ); |
|
| 577 | +function lsx_strip_excerpt($content) { |
|
| 578 | + if (is_search() || is_archive() || (is_blog_installed() && ! is_single() && ! is_page())) { |
|
| 579 | + $content = strip_shortcodes($content); |
|
| 580 | + $content = str_replace(']]>', ']]>', $content); |
|
| 581 | + $content = strip_tags($content); |
|
| 582 | 582 | } |
| 583 | 583 | return $content; |
| 584 | 584 | } |
| 585 | -add_filter( 'the_content', 'lsx_strip_excerpt' ); |
|
| 585 | +add_filter('the_content', 'lsx_strip_excerpt'); |
|
| 586 | 586 | |
| 587 | 587 | /** |
| 588 | 588 | * Disable Gutenberg for LSX Custom Post Types. |
| 589 | 589 | */ |
| 590 | -function lsx_disable_gutenberg_product_type( $is_enabled, $post_type ) { |
|
| 591 | - if ( 'testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type ) { |
|
| 590 | +function lsx_disable_gutenberg_product_type($is_enabled, $post_type) { |
|
| 591 | + if ('testimonial' === $post_type || 'team' === $post_type || 'project' === $post_type) { |
|
| 592 | 592 | return false; |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | return $is_enabled; |
| 596 | 596 | } |
| 597 | -add_filter( 'gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2 ); |
|
| 597 | +add_filter('gutenberg_add_edit_link_for_post_type', 'lsx_disable_gutenberg_product_type', 10, 2); |
|
| 598 | 598 | |
| 599 | 599 | /** |
| 600 | 600 | * Add the "Blog" link to the breadcrumbs |
@@ -602,27 +602,27 @@ discard block |
||
| 602 | 602 | * @param $crumbs |
| 603 | 603 | * @return array |
| 604 | 604 | */ |
| 605 | -function lsx_breadcrumbs_blog_link( $crumbs ) { |
|
| 605 | +function lsx_breadcrumbs_blog_link($crumbs) { |
|
| 606 | 606 | |
| 607 | - $show_on_front = get_option( 'show_on_front' ); |
|
| 607 | + $show_on_front = get_option('show_on_front'); |
|
| 608 | 608 | |
| 609 | - if ( 'page' === $show_on_front && ( is_category() || is_tag() ) ) { |
|
| 609 | + if ('page' === $show_on_front && (is_category() || is_tag())) { |
|
| 610 | 610 | |
| 611 | - $blog_page = get_option( 'page_for_posts' ); |
|
| 612 | - if ( false !== $blog_page && '' !== $blog_page ) { |
|
| 611 | + $blog_page = get_option('page_for_posts'); |
|
| 612 | + if (false !== $blog_page && '' !== $blog_page) { |
|
| 613 | 613 | |
| 614 | 614 | $new_crumbs = array(); |
| 615 | 615 | $new_crumbs[0] = $crumbs[0]; |
| 616 | 616 | |
| 617 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
| 617 | + if (function_exists('woocommerce_breadcrumb')) { |
|
| 618 | 618 | $new_crumbs[1] = array( |
| 619 | - 0 => get_the_title( $blog_page ), |
|
| 620 | - 1 => get_permalink( $blog_page ), |
|
| 619 | + 0 => get_the_title($blog_page), |
|
| 620 | + 1 => get_permalink($blog_page), |
|
| 621 | 621 | ); |
| 622 | 622 | } else { |
| 623 | 623 | $new_crumbs[1] = array( |
| 624 | - 'text' => get_the_title( $blog_page ), |
|
| 625 | - 'url' => get_permalink( $blog_page ), |
|
| 624 | + 'text' => get_the_title($blog_page), |
|
| 625 | + 'url' => get_permalink($blog_page), |
|
| 626 | 626 | ); |
| 627 | 627 | } |
| 628 | 628 | $new_crumbs[2] = $crumbs[1]; |
@@ -632,5 +632,5 @@ discard block |
||
| 632 | 632 | } |
| 633 | 633 | return $crumbs; |
| 634 | 634 | } |
| 635 | -add_filter( 'wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1 ); |
|
| 636 | -add_filter( 'woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1 ); |
|
| 635 | +add_filter('wpseo_breadcrumb_links', 'lsx_breadcrumbs_blog_link', 30, 1); |
|
| 636 | +add_filter('woocommerce_get_breadcrumb', 'lsx_breadcrumbs_blog_link', 30, 1); |
|
@@ -6,11 +6,11 @@ discard block |
||
| 6 | 6 | * @subpackage woocommerce |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -if ( ! function_exists( 'lsx_wc_support' ) ) : |
|
| 13 | +if ( ! function_exists('lsx_wc_support')) : |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * WooCommerce support. |
@@ -19,17 +19,17 @@ discard block |
||
| 19 | 19 | * @subpackage woocommerce |
| 20 | 20 | */ |
| 21 | 21 | function lsx_wc_support() { |
| 22 | - add_theme_support( 'woocommerce' ); |
|
| 23 | - add_theme_support( 'wc-product-gallery-zoom' ); |
|
| 24 | - add_theme_support( 'wc-product-gallery-lightbox' ); |
|
| 25 | - add_theme_support( 'wc-product-gallery-slider' ); |
|
| 22 | + add_theme_support('woocommerce'); |
|
| 23 | + add_theme_support('wc-product-gallery-zoom'); |
|
| 24 | + add_theme_support('wc-product-gallery-lightbox'); |
|
| 25 | + add_theme_support('wc-product-gallery-slider'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - add_action( 'after_setup_theme', 'lsx_wc_support' ); |
|
| 28 | + add_action('after_setup_theme', 'lsx_wc_support'); |
|
| 29 | 29 | |
| 30 | 30 | endif; |
| 31 | 31 | |
| 32 | -if ( ! function_exists( 'lsx_wc_scripts_add_styles' ) ) : |
|
| 32 | +if ( ! function_exists('lsx_wc_scripts_add_styles')) : |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * WooCommerce enqueue styles. |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | * @subpackage woocommerce |
| 39 | 39 | */ |
| 40 | 40 | function lsx_wc_scripts_add_styles() { |
| 41 | - wp_enqueue_style( 'woocommerce-lsx', get_template_directory_uri() . '/assets/css/woocommerce/woocommerce.css', array( 'lsx_main' ), LSX_VERSION ); |
|
| 42 | - wp_style_add_data( 'woocommerce-lsx', 'rtl', 'replace' ); |
|
| 41 | + wp_enqueue_style('woocommerce-lsx', get_template_directory_uri() . '/assets/css/woocommerce/woocommerce.css', array('lsx_main'), LSX_VERSION); |
|
| 42 | + wp_style_add_data('woocommerce-lsx', 'rtl', 'replace'); |
|
| 43 | 43 | |
| 44 | 44 | // Remove WC Shipping Multiple Addresses specific script causing issues on checkout. |
| 45 | - wp_dequeue_script( 'wcms-country-select' ); |
|
| 45 | + wp_dequeue_script('wcms-country-select'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - add_action( 'wp_enqueue_scripts', 'lsx_wc_scripts_add_styles' ); |
|
| 48 | + add_action('wp_enqueue_scripts', 'lsx_wc_scripts_add_styles'); |
|
| 49 | 49 | |
| 50 | 50 | endif; |
| 51 | 51 | |
| 52 | -if ( ! function_exists( 'lsx_wc_checkout_cart_title' ) ) : |
|
| 52 | +if ( ! function_exists('lsx_wc_checkout_cart_title')) : |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * Add title to Woocommerce Cart page anc Checkout page. |
@@ -59,21 +59,21 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | function lsx_wc_checkout_cart_title() { |
| 61 | 61 | $default_size = 'sm'; |
| 62 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
| 63 | - if ( function_exists( 'is_woocommerce' ) && ( is_checkout() || is_cart() ) ) { |
|
| 62 | + $size = apply_filters('lsx_bootstrap_column_size', $default_size); |
|
| 63 | + if (function_exists('is_woocommerce') && (is_checkout() || is_cart())) { |
|
| 64 | 64 | ?> |
| 65 | - <div class="checkout-header-wrapper cart-checkout-page col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 65 | + <div class="checkout-header-wrapper cart-checkout-page col-<?php echo esc_attr($size); ?>-12"> |
|
| 66 | 66 | <h1 class="archive-title"><?php the_title(); ?></h1> |
| 67 | 67 | </div> |
| 68 | 68 | <?php |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - add_action( 'lsx_entry_inside_top', 'lsx_wc_checkout_cart_title' ); |
|
| 72 | + add_action('lsx_entry_inside_top', 'lsx_wc_checkout_cart_title'); |
|
| 73 | 73 | |
| 74 | 74 | endif; |
| 75 | 75 | |
| 76 | -if ( ! function_exists( 'lsx_simple_checkout' ) ) : |
|
| 76 | +if ( ! function_exists('lsx_simple_checkout')) : |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Remove footer widgets to make Checkout and Cart simpler. |
@@ -83,18 +83,18 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | function lsx_simple_checkout() { |
| 85 | 85 | |
| 86 | - if ( class_exists( 'WooCommerce' ) ) { |
|
| 87 | - if ( is_checkout() || is_cart() ) { |
|
| 88 | - remove_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
| 86 | + if (class_exists('WooCommerce')) { |
|
| 87 | + if (is_checkout() || is_cart()) { |
|
| 88 | + remove_action('lsx_footer_before', 'lsx_add_footer_sidebar_area'); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - add_action( 'wp_head', 'lsx_simple_checkout' ); |
|
| 93 | + add_action('wp_head', 'lsx_simple_checkout'); |
|
| 94 | 94 | |
| 95 | 95 | endif; |
| 96 | 96 | |
| 97 | -if ( ! function_exists( 'lsx_wc_form_field_args' ) ) : |
|
| 97 | +if ( ! function_exists('lsx_wc_form_field_args')) : |
|
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | 100 | * WooCommerce form fields. |
@@ -102,17 +102,17 @@ discard block |
||
| 102 | 102 | * @package lsx |
| 103 | 103 | * @subpackage woocommerce |
| 104 | 104 | */ |
| 105 | - function lsx_wc_form_field_args( $args, $key, $value ) { |
|
| 105 | + function lsx_wc_form_field_args($args, $key, $value) { |
|
| 106 | 106 | $args['input_class'][] = 'form-control'; |
| 107 | 107 | |
| 108 | 108 | return $args; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - add_action( 'woocommerce_form_field_args', 'lsx_wc_form_field_args', 10, 3 ); |
|
| 111 | + add_action('woocommerce_form_field_args', 'lsx_wc_form_field_args', 10, 3); |
|
| 112 | 112 | |
| 113 | 113 | endif; |
| 114 | 114 | |
| 115 | -if ( ! function_exists( 'lsx_wc_theme_wrapper_start' ) ) : |
|
| 115 | +if ( ! function_exists('lsx_wc_theme_wrapper_start')) : |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * WooCommerce wrapper start. |
@@ -122,18 +122,18 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | function lsx_wc_theme_wrapper_start() { |
| 124 | 124 | lsx_content_wrap_before(); |
| 125 | - echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">'; |
|
| 125 | + echo '<div id="primary" class="content-area ' . esc_attr(lsx_main_class()) . '">'; |
|
| 126 | 126 | lsx_content_before(); |
| 127 | 127 | echo '<main id="main" class="site-main" role="main">'; |
| 128 | 128 | lsx_content_top(); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); |
|
| 132 | - add_action( 'woocommerce_before_main_content', 'lsx_wc_theme_wrapper_start' ); |
|
| 131 | + remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
| 132 | + add_action('woocommerce_before_main_content', 'lsx_wc_theme_wrapper_start'); |
|
| 133 | 133 | |
| 134 | 134 | endif; |
| 135 | 135 | |
| 136 | -if ( ! function_exists( 'lsx_wc_theme_wrapper_end' ) ) : |
|
| 136 | +if ( ! function_exists('lsx_wc_theme_wrapper_end')) : |
|
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * WooCommerce wrapper end. |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | lsx_content_wrap_after(); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); |
|
| 153 | - add_action( 'woocommerce_after_main_content', 'lsx_wc_theme_wrapper_end' ); |
|
| 152 | + remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
| 153 | + add_action('woocommerce_after_main_content', 'lsx_wc_theme_wrapper_end'); |
|
| 154 | 154 | |
| 155 | 155 | endif; |
| 156 | 156 | |
| 157 | -if ( ! function_exists( 'lsx_wc_disable_lsx_banner_plugin' ) ) : |
|
| 157 | +if ( ! function_exists('lsx_wc_disable_lsx_banner_plugin')) : |
|
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | 160 | * Disable LSX Banners plugin in some WC pages. |
@@ -162,21 +162,21 @@ discard block |
||
| 162 | 162 | * @package lsx |
| 163 | 163 | * @subpackage woocommerce |
| 164 | 164 | */ |
| 165 | - function lsx_wc_disable_lsx_banner_plugin( $disabled ) { |
|
| 165 | + function lsx_wc_disable_lsx_banner_plugin($disabled) { |
|
| 166 | 166 | global $post; |
| 167 | 167 | |
| 168 | - if ( $post && class_exists( 'WC_Wishlists_Pages' ) && WC_Wishlists_Pages::is_wishlist_page( $post->post_name ) ) { |
|
| 168 | + if ($post && class_exists('WC_Wishlists_Pages') && WC_Wishlists_Pages::is_wishlist_page($post->post_name)) { |
|
| 169 | 169 | $disabled = true; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | return $disabled; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - add_filter( 'lsx_banner_plugin_disable', 'lsx_wc_disable_lsx_banner_plugin' ); |
|
| 175 | + add_filter('lsx_banner_plugin_disable', 'lsx_wc_disable_lsx_banner_plugin'); |
|
| 176 | 176 | |
| 177 | 177 | endif; |
| 178 | 178 | |
| 179 | -if ( ! function_exists( 'lsx_wc_disable_lsx_banner' ) ) : |
|
| 179 | +if ( ! function_exists('lsx_wc_disable_lsx_banner')) : |
|
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | 182 | * Disable LSX Banners banner in some WC pages. |
@@ -184,41 +184,41 @@ discard block |
||
| 184 | 184 | * @package lsx |
| 185 | 185 | * @subpackage woocommerce |
| 186 | 186 | */ |
| 187 | - function lsx_wc_disable_lsx_banner( $disabled ) { |
|
| 188 | - if ( is_shop() || is_product_category() || is_product_tag() || is_product() ) { |
|
| 187 | + function lsx_wc_disable_lsx_banner($disabled) { |
|
| 188 | + if (is_shop() || is_product_category() || is_product_tag() || is_product()) { |
|
| 189 | 189 | $disabled = true; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | return $disabled; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - add_filter( 'lsx_banner_disable', 'lsx_wc_disable_lsx_banner' ); |
|
| 195 | + add_filter('lsx_banner_disable', 'lsx_wc_disable_lsx_banner'); |
|
| 196 | 196 | |
| 197 | 197 | endif; |
| 198 | 198 | |
| 199 | -if ( ! function_exists( 'lsx_wc_categories_breadcrumb_filter' ) ) : |
|
| 199 | +if ( ! function_exists('lsx_wc_categories_breadcrumb_filter')) : |
|
| 200 | 200 | /** |
| 201 | 201 | * Improves the category and taxonomy breadcrumbs for woocommerce. |
| 202 | 202 | * |
| 203 | 203 | * @package lsx |
| 204 | 204 | * @subpackage woocommerce |
| 205 | 205 | */ |
| 206 | - function lsx_wc_categories_breadcrumb_filter( $crumbs ) { |
|
| 206 | + function lsx_wc_categories_breadcrumb_filter($crumbs) { |
|
| 207 | 207 | |
| 208 | - $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) ); |
|
| 208 | + $shop_page_url = get_permalink(wc_get_page_id('shop')); |
|
| 209 | 209 | |
| 210 | - if ( is_product_category() || is_product_tag() ) { |
|
| 210 | + if (is_product_category() || is_product_tag()) { |
|
| 211 | 211 | $new_crumbs = array(); |
| 212 | 212 | $new_crumbs[0] = $crumbs[0]; |
| 213 | 213 | |
| 214 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
| 214 | + if (function_exists('woocommerce_breadcrumb')) { |
|
| 215 | 215 | $new_crumbs[1] = array( |
| 216 | - 0 => __( 'Shop', 'lsx' ), |
|
| 216 | + 0 => __('Shop', 'lsx'), |
|
| 217 | 217 | 1 => $shop_page_url, |
| 218 | 218 | ); |
| 219 | 219 | } else { |
| 220 | 220 | $new_crumbs[1] = array( |
| 221 | - 'text' => __( 'Shop', 'lsx' ), |
|
| 221 | + 'text' => __('Shop', 'lsx'), |
|
| 222 | 222 | 'url' => $shop_page_url, |
| 223 | 223 | ); |
| 224 | 224 | } |
@@ -229,12 +229,12 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | return $crumbs; |
| 231 | 231 | } |
| 232 | - add_filter( 'wpseo_breadcrumb_links', 'lsx_wc_categories_breadcrumb_filter', 30, 1 ); |
|
| 233 | - add_filter( 'woocommerce_get_breadcrumb', 'lsx_wc_categories_breadcrumb_filter', 30, 1 ); |
|
| 232 | + add_filter('wpseo_breadcrumb_links', 'lsx_wc_categories_breadcrumb_filter', 30, 1); |
|
| 233 | + add_filter('woocommerce_get_breadcrumb', 'lsx_wc_categories_breadcrumb_filter', 30, 1); |
|
| 234 | 234 | |
| 235 | 235 | endif; |
| 236 | 236 | |
| 237 | -if ( ! function_exists( 'lsx_wc_add_cart' ) ) : |
|
| 237 | +if ( ! function_exists('lsx_wc_add_cart')) : |
|
| 238 | 238 | |
| 239 | 239 | /** |
| 240 | 240 | * Adds WC cart to the header. |
@@ -242,34 +242,34 @@ discard block |
||
| 242 | 242 | * @package lsx |
| 243 | 243 | * @subpackage template-tags |
| 244 | 244 | */ |
| 245 | - function lsx_wc_add_cart( $items, $args ) { |
|
| 246 | - $cart_menu_item_position = apply_filters( 'lsx_wc_cart_menu_item_position', 'primary' ); |
|
| 245 | + function lsx_wc_add_cart($items, $args) { |
|
| 246 | + $cart_menu_item_position = apply_filters('lsx_wc_cart_menu_item_position', 'primary'); |
|
| 247 | 247 | |
| 248 | 248 | $cart_logged_out_position = $cart_menu_item_position . '_logged_out'; |
| 249 | 249 | |
| 250 | - if ( $cart_menu_item_position === $args->theme_location || $cart_logged_out_position === $args->theme_location ) { |
|
| 251 | - $customizer_option = get_theme_mod( 'lsx_header_wc_cart', false ); |
|
| 250 | + if ($cart_menu_item_position === $args->theme_location || $cart_logged_out_position === $args->theme_location) { |
|
| 251 | + $customizer_option = get_theme_mod('lsx_header_wc_cart', false); |
|
| 252 | 252 | |
| 253 | - if ( ! empty( $customizer_option ) ) { |
|
| 253 | + if ( ! empty($customizer_option)) { |
|
| 254 | 254 | ob_start(); |
| 255 | - the_widget( 'WC_Widget_Cart', 'title=' ); |
|
| 255 | + the_widget('WC_Widget_Cart', 'title='); |
|
| 256 | 256 | $widget = ob_get_clean(); |
| 257 | 257 | |
| 258 | - if ( is_cart() ) { |
|
| 258 | + if (is_cart()) { |
|
| 259 | 259 | $class = 'current-menu-item'; |
| 260 | 260 | } else { |
| 261 | 261 | $class = ''; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | $item_class = 'menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children dropdown lsx-wc-cart-menu-item ' . $class; |
| 265 | - $item_class = apply_filters( 'lsx_wc_cart_menu_item_class', $item_class ); |
|
| 265 | + $item_class = apply_filters('lsx_wc_cart_menu_item_class', $item_class); |
|
| 266 | 266 | |
| 267 | 267 | $item = '<li class="' . $item_class . '">' . |
| 268 | - '<a title="' . esc_attr__( 'View your shopping cart', 'lsx' ) . '" href="' . esc_url( wc_get_cart_url() ) . '" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true">' . |
|
| 269 | - '<span class="lsx-wc-cart-amount">' . wp_kses_data( WC()->cart->get_cart_subtotal() ) . '</span>' . |
|
| 268 | + '<a title="' . esc_attr__('View your shopping cart', 'lsx') . '" href="' . esc_url(wc_get_cart_url()) . '" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true">' . |
|
| 269 | + '<span class="lsx-wc-cart-amount">' . wp_kses_data(WC()->cart->get_cart_subtotal()) . '</span>' . |
|
| 270 | 270 | /* Translators: %s: items quantity */ |
| 271 | - '<span class="lsx-wc-cart-count">' . wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx' ), WC()->cart->get_cart_contents_count() ) ) . '</span>' . |
|
| 272 | - ( ! empty( WC()->cart->get_cart_contents_count() ) ? '<span class="lsx-wc-cart-count-badge">' . wp_kses_data( WC()->cart->get_cart_contents_count() ) . '</span>' : '' ) . |
|
| 271 | + '<span class="lsx-wc-cart-count">' . wp_kses_data(sprintf(_n('%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx'), WC()->cart->get_cart_contents_count())) . '</span>' . |
|
| 272 | + ( ! empty(WC()->cart->get_cart_contents_count()) ? '<span class="lsx-wc-cart-count-badge">' . wp_kses_data(WC()->cart->get_cart_contents_count()) . '</span>' : '') . |
|
| 273 | 273 | '</a>' . |
| 274 | 274 | '<ul role="menu" class=" dropdown-menu lsx-wc-cart-sub-menu">' . |
| 275 | 275 | '<li>' . |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | '</ul>' . |
| 279 | 279 | '</li>'; |
| 280 | 280 | |
| 281 | - if ( 'top-menu' === $args->theme_location ) { |
|
| 281 | + if ('top-menu' === $args->theme_location) { |
|
| 282 | 282 | $items = $item . $items; |
| 283 | 283 | } else { |
| 284 | 284 | $items = $items . $item; |
@@ -289,11 +289,11 @@ discard block |
||
| 289 | 289 | return $items; |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - add_filter( 'wp_nav_menu_items', 'lsx_wc_add_cart', 10, 2 ); |
|
| 292 | + add_filter('wp_nav_menu_items', 'lsx_wc_add_cart', 10, 2); |
|
| 293 | 293 | |
| 294 | 294 | endif; |
| 295 | 295 | |
| 296 | -if ( ! function_exists( 'lsx_wc_products_widget_wrapper_before' ) ) : |
|
| 296 | +if ( ! function_exists('lsx_wc_products_widget_wrapper_before')) : |
|
| 297 | 297 | |
| 298 | 298 | /** |
| 299 | 299 | * Change WC products widget wrapper (before). |
@@ -301,16 +301,16 @@ discard block |
||
| 301 | 301 | * @package lsx |
| 302 | 302 | * @subpackage woocommerce |
| 303 | 303 | */ |
| 304 | - function lsx_wc_products_widget_wrapper_before( $html ) { |
|
| 304 | + function lsx_wc_products_widget_wrapper_before($html) { |
|
| 305 | 305 | $html = '<div class="lsx-woocommerce-slider lsx-woocommerce-shortcode">'; |
| 306 | 306 | return $html; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | - add_filter( 'woocommerce_before_widget_product_list', 'lsx_wc_products_widget_wrapper_before', 15 ); |
|
| 309 | + add_filter('woocommerce_before_widget_product_list', 'lsx_wc_products_widget_wrapper_before', 15); |
|
| 310 | 310 | |
| 311 | 311 | endif; |
| 312 | 312 | |
| 313 | -if ( ! function_exists( 'lsx_wc_products_widget_wrapper_after' ) ) : |
|
| 313 | +if ( ! function_exists('lsx_wc_products_widget_wrapper_after')) : |
|
| 314 | 314 | |
| 315 | 315 | /** |
| 316 | 316 | * Change WC products widget wrapper (after). |
@@ -318,16 +318,16 @@ discard block |
||
| 318 | 318 | * @package lsx |
| 319 | 319 | * @subpackage woocommerce |
| 320 | 320 | */ |
| 321 | - function lsx_wc_products_widget_wrapper_after( $html ) { |
|
| 321 | + function lsx_wc_products_widget_wrapper_after($html) { |
|
| 322 | 322 | $html = '</div>'; |
| 323 | 323 | return $html; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - add_filter( 'woocommerce_after_widget_product_list', 'lsx_wc_products_widget_wrapper_after', 15 ); |
|
| 326 | + add_filter('woocommerce_after_widget_product_list', 'lsx_wc_products_widget_wrapper_after', 15); |
|
| 327 | 327 | |
| 328 | 328 | endif; |
| 329 | 329 | |
| 330 | -if ( ! function_exists( 'lsx_wc_reviews_widget_override' ) ) : |
|
| 330 | +if ( ! function_exists('lsx_wc_reviews_widget_override')) : |
|
| 331 | 331 | |
| 332 | 332 | /** |
| 333 | 333 | * Override WC ewviews widget. |
@@ -336,18 +336,18 @@ discard block |
||
| 336 | 336 | * @subpackage woocommerce |
| 337 | 337 | */ |
| 338 | 338 | function lsx_wc_reviews_widget_override() { |
| 339 | - if ( class_exists( 'WC_Widget_Recent_Reviews' ) ) { |
|
| 340 | - unregister_widget( 'WC_Widget_Recent_Reviews' ); |
|
| 339 | + if (class_exists('WC_Widget_Recent_Reviews')) { |
|
| 340 | + unregister_widget('WC_Widget_Recent_Reviews'); |
|
| 341 | 341 | require get_template_directory() . '/includes/classes/class-lsx-wc-widget-recent-reviews.php'; |
| 342 | - register_widget( 'LSX_WC_Widget_Recent_Reviews' ); |
|
| 342 | + register_widget('LSX_WC_Widget_Recent_Reviews'); |
|
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - add_action( 'widgets_init', 'lsx_wc_reviews_widget_override', 15 ); |
|
| 346 | + add_action('widgets_init', 'lsx_wc_reviews_widget_override', 15); |
|
| 347 | 347 | |
| 348 | 348 | endif; |
| 349 | 349 | |
| 350 | -if ( ! function_exists( 'lsx_wc_change_price_html' ) ) : |
|
| 350 | +if ( ! function_exists('lsx_wc_change_price_html')) : |
|
| 351 | 351 | |
| 352 | 352 | /** |
| 353 | 353 | * Change WC ZERO price to "free". |
@@ -359,30 +359,30 @@ discard block |
||
| 359 | 359 | * @param $product WC_Product |
| 360 | 360 | * @return string |
| 361 | 361 | */ |
| 362 | - function lsx_wc_change_price_html( $price, $product ) { |
|
| 363 | - if ( empty( $product->get_price() ) ) { |
|
| 364 | - if ( $product->is_on_sale() && $product->get_regular_price() ) { |
|
| 365 | - $regular_price = wc_get_price_to_display( $product, |
|
| 362 | + function lsx_wc_change_price_html($price, $product) { |
|
| 363 | + if (empty($product->get_price())) { |
|
| 364 | + if ($product->is_on_sale() && $product->get_regular_price()) { |
|
| 365 | + $regular_price = wc_get_price_to_display($product, |
|
| 366 | 366 | array( |
| 367 | 367 | 'qty' => 1, |
| 368 | 368 | 'price' => $product->get_regular_price(), |
| 369 | 369 | ) |
| 370 | 370 | ); |
| 371 | 371 | |
| 372 | - $price = wc_format_price_range( $regular_price, esc_html__( 'Free!', 'lsx' ) ); |
|
| 372 | + $price = wc_format_price_range($regular_price, esc_html__('Free!', 'lsx')); |
|
| 373 | 373 | } else { |
| 374 | - $price = '<span class="amount">' . esc_html__( 'Free!', 'lsx' ) . '</span>'; |
|
| 374 | + $price = '<span class="amount">' . esc_html__('Free!', 'lsx') . '</span>'; |
|
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | return $price; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | - add_filter( 'woocommerce_get_price_html', 'lsx_wc_change_price_html', 15, 2 ); |
|
| 381 | + add_filter('woocommerce_get_price_html', 'lsx_wc_change_price_html', 15, 2); |
|
| 382 | 382 | |
| 383 | 383 | endif; |
| 384 | 384 | |
| 385 | -if ( ! function_exists( 'lsx_wc_cart_link_fragment' ) ) : |
|
| 385 | +if ( ! function_exists('lsx_wc_cart_link_fragment')) : |
|
| 386 | 386 | |
| 387 | 387 | /** |
| 388 | 388 | * Cart Fragments. |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | * @package lsx |
| 392 | 392 | * @subpackage woocommerce |
| 393 | 393 | */ |
| 394 | - function lsx_wc_cart_link_fragment( $fragments ) { |
|
| 394 | + function lsx_wc_cart_link_fragment($fragments) { |
|
| 395 | 395 | global $woocommerce; |
| 396 | 396 | |
| 397 | 397 | ob_start(); |
@@ -402,8 +402,8 @@ discard block |
||
| 402 | 402 | lsx_wc_items_counter(); |
| 403 | 403 | $items_counter = ob_get_clean(); |
| 404 | 404 | |
| 405 | - if ( ! empty( $items_counter ) ) { |
|
| 406 | - $fragments['div.widget_shopping_cart_content'] = preg_replace( '/(.+)(<\/ul>)[\s\n]*(<p class="woocommerce-mini-cart__total)(.+)/', '$1' . $items_counter . '$2$3$4', $fragments['div.widget_shopping_cart_content'] ); |
|
| 405 | + if ( ! empty($items_counter)) { |
|
| 406 | + $fragments['div.widget_shopping_cart_content'] = preg_replace('/(.+)(<\/ul>)[\s\n]*(<p class="woocommerce-mini-cart__total)(.+)/', '$1' . $items_counter . '$2$3$4', $fragments['div.widget_shopping_cart_content']); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | return $fragments; |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | |
| 412 | 412 | endif; |
| 413 | 413 | |
| 414 | -if ( ! function_exists( 'lsx_wc_cart_link' ) ) : |
|
| 414 | +if ( ! function_exists('lsx_wc_cart_link')) : |
|
| 415 | 415 | |
| 416 | 416 | /** |
| 417 | 417 | * Cart Link. |
@@ -422,14 +422,14 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | function lsx_wc_cart_link() { |
| 424 | 424 | ?> |
| 425 | - <a title="<?php esc_attr_e( 'View your shopping cart', 'lsx' ); ?>" href="<?php echo esc_url( wc_get_cart_url() ); ?>" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true"> |
|
| 426 | - <span class="lsx-wc-cart-amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> |
|
| 425 | + <a title="<?php esc_attr_e('View your shopping cart', 'lsx'); ?>" href="<?php echo esc_url(wc_get_cart_url()); ?>" data-toggle="dropdown" class="dropdown-toggle" aria-haspopup="true"> |
|
| 426 | + <span class="lsx-wc-cart-amount"><?php echo wp_kses_data(WC()->cart->get_cart_subtotal()); ?></span> |
|
| 427 | 427 | |
| 428 | 428 | <?php /* Translators: %s: items quantity */ ?> |
| 429 | - <span class="lsx-wc-cart-count"><?php echo wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx' ), WC()->cart->get_cart_contents_count() ) ); ?></span> |
|
| 429 | + <span class="lsx-wc-cart-count"><?php echo wp_kses_data(sprintf(_n('%d item', '%d items', WC()->cart->get_cart_contents_count(), 'lsx'), WC()->cart->get_cart_contents_count())); ?></span> |
|
| 430 | 430 | |
| 431 | - <?php if ( ! empty( WC()->cart->get_cart_contents_count() ) ) : ?> |
|
| 432 | - <span class="lsx-wc-cart-count-badge"><?php echo wp_kses_data( WC()->cart->get_cart_contents_count() ); ?></span> |
|
| 431 | + <?php if ( ! empty(WC()->cart->get_cart_contents_count())) : ?> |
|
| 432 | + <span class="lsx-wc-cart-count-badge"><?php echo wp_kses_data(WC()->cart->get_cart_contents_count()); ?></span> |
|
| 433 | 433 | <?php endif; ?> |
| 434 | 434 | </a> |
| 435 | 435 | <?php |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | endif; |
| 439 | 439 | |
| 440 | -if ( ! function_exists( 'lsx_wc_items_counter' ) ) : |
|
| 440 | +if ( ! function_exists('lsx_wc_items_counter')) : |
|
| 441 | 441 | |
| 442 | 442 | /** |
| 443 | 443 | * Add car item hidden items counter. |
@@ -449,21 +449,21 @@ discard block |
||
| 449 | 449 | $count = (int) WC()->cart->get_cart_contents_count(); |
| 450 | 450 | $items_counter = ''; |
| 451 | 451 | |
| 452 | - if ( ! empty( $count ) ) { |
|
| 452 | + if ( ! empty($count)) { |
|
| 453 | 453 | $count -= 3; |
| 454 | 454 | |
| 455 | - if ( 1 === $count ) { |
|
| 456 | - $items_counter = esc_html__( '1 other item in cart', 'lsx' ); |
|
| 457 | - } elseif ( $count > 1 ) { |
|
| 455 | + if (1 === $count) { |
|
| 456 | + $items_counter = esc_html__('1 other item in cart', 'lsx'); |
|
| 457 | + } elseif ($count > 1) { |
|
| 458 | 458 | /* Translators: %s: items counter */ |
| 459 | - $items_counter = sprintf( esc_html__( '%s other items in cart', 'lsx' ), $count ); |
|
| 459 | + $items_counter = sprintf(esc_html__('%s other items in cart', 'lsx'), $count); |
|
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | - $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
| 463 | - if ( ! empty( $items_counter ) ) : |
|
| 462 | + $cart_url = function_exists('wc_get_cart_url') ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
| 463 | + if ( ! empty($items_counter)) : |
|
| 464 | 464 | ?> |
| 465 | 465 | <li class="woocommerce-mini-cart-item mini_cart_item" style="display: block;"> |
| 466 | - <a href="<?php echo esc_url( $cart_url ); ?>"><?php echo esc_html( $items_counter ); ?></a> |
|
| 466 | + <a href="<?php echo esc_url($cart_url); ?>"><?php echo esc_html($items_counter); ?></a> |
|
| 467 | 467 | </li> |
| 468 | 468 | <?php |
| 469 | 469 | endif; |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | endif; |
| 473 | 473 | |
| 474 | -if ( ! function_exists( 'lsx_wc_loop_shop_per_page' ) ) : |
|
| 474 | +if ( ! function_exists('lsx_wc_loop_shop_per_page')) : |
|
| 475 | 475 | |
| 476 | 476 | /** |
| 477 | 477 | * Changes the number of products to display on shop. |
@@ -479,16 +479,16 @@ discard block |
||
| 479 | 479 | * @package lsx |
| 480 | 480 | * @subpackage woocommerce |
| 481 | 481 | */ |
| 482 | - function lsx_wc_loop_shop_per_page( $items ) { |
|
| 482 | + function lsx_wc_loop_shop_per_page($items) { |
|
| 483 | 483 | $items = 12; |
| 484 | 484 | return $items; |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | - add_filter( 'loop_shop_per_page', 'lsx_wc_loop_shop_per_page', 20 ); |
|
| 487 | + add_filter('loop_shop_per_page', 'lsx_wc_loop_shop_per_page', 20); |
|
| 488 | 488 | |
| 489 | 489 | endif; |
| 490 | 490 | |
| 491 | -if ( ! function_exists( 'lsx_wc_add_to_cart_message_html' ) ) : |
|
| 491 | +if ( ! function_exists('lsx_wc_add_to_cart_message_html')) : |
|
| 492 | 492 | |
| 493 | 493 | /** |
| 494 | 494 | * Changes the "added to cart" message HTML. |
@@ -496,39 +496,39 @@ discard block |
||
| 496 | 496 | * @package lsx |
| 497 | 497 | * @subpackage woocommerce |
| 498 | 498 | */ |
| 499 | - function lsx_wc_add_to_cart_message_html( $message, $products ) { |
|
| 499 | + function lsx_wc_add_to_cart_message_html($message, $products) { |
|
| 500 | 500 | $message = '<div class="woocommerce-message-added-to-cart">' . $message . '</div>'; |
| 501 | 501 | return $message; |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | - add_filter( 'wc_add_to_cart_message_html', 'lsx_wc_add_to_cart_message_html', 20, 2 ); |
|
| 504 | + add_filter('wc_add_to_cart_message_html', 'lsx_wc_add_to_cart_message_html', 20, 2); |
|
| 505 | 505 | |
| 506 | 506 | endif; |
| 507 | 507 | |
| 508 | -if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.3', '>=' ) ) { |
|
| 509 | - add_filter( 'woocommerce_add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
| 508 | +if (defined('WC_VERSION') && version_compare(WC_VERSION, '2.3', '>=')) { |
|
| 509 | + add_filter('woocommerce_add_to_cart_fragments', 'lsx_wc_cart_link_fragment'); |
|
| 510 | 510 | } else { |
| 511 | - add_filter( 'add_to_cart_fragments', 'lsx_wc_cart_link_fragment' ); |
|
| 511 | + add_filter('add_to_cart_fragments', 'lsx_wc_cart_link_fragment'); |
|
| 512 | 512 | } |
| 513 | 513 | |
| 514 | -remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); |
|
| 514 | +remove_action('woocommerce_after_shop_loop', 'woocommerce_pagination', 10); |
|
| 515 | 515 | |
| 516 | -add_action( 'woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper', 9 ); |
|
| 517 | -add_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 ); |
|
| 518 | -add_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 ); |
|
| 519 | -add_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 30 ); |
|
| 520 | -add_action( 'woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper_close', 31 ); |
|
| 516 | +add_action('woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper', 9); |
|
| 517 | +add_action('woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10); |
|
| 518 | +add_action('woocommerce_after_shop_loop', 'woocommerce_result_count', 20); |
|
| 519 | +add_action('woocommerce_after_shop_loop', 'woocommerce_pagination', 30); |
|
| 520 | +add_action('woocommerce_after_shop_loop', 'lsx_wc_sorting_wrapper_close', 31); |
|
| 521 | 521 | |
| 522 | -remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); |
|
| 523 | -remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); |
|
| 522 | +remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); |
|
| 523 | +remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30); |
|
| 524 | 524 | |
| 525 | -add_action( 'woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper', 9 ); |
|
| 526 | -add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 ); |
|
| 527 | -add_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); |
|
| 528 | -add_action( 'woocommerce_before_shop_loop', 'lsx_wc_woocommerce_pagination', 30 ); |
|
| 529 | -add_action( 'woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper_close', 31 ); |
|
| 525 | +add_action('woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper', 9); |
|
| 526 | +add_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10); |
|
| 527 | +add_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); |
|
| 528 | +add_action('woocommerce_before_shop_loop', 'lsx_wc_woocommerce_pagination', 30); |
|
| 529 | +add_action('woocommerce_before_shop_loop', 'lsx_wc_sorting_wrapper_close', 31); |
|
| 530 | 530 | |
| 531 | -if ( ! function_exists( 'lsx_wc_sorting_wrapper' ) ) : |
|
| 531 | +if ( ! function_exists('lsx_wc_sorting_wrapper')) : |
|
| 532 | 532 | |
| 533 | 533 | /** |
| 534 | 534 | * Sorting wrapper. |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | |
| 543 | 543 | endif; |
| 544 | 544 | |
| 545 | -if ( ! function_exists( 'lsx_wc_sorting_wrapper_close' ) ) : |
|
| 545 | +if ( ! function_exists('lsx_wc_sorting_wrapper_close')) : |
|
| 546 | 546 | |
| 547 | 547 | /** |
| 548 | 548 | * Sorting wrapper close. |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | |
| 557 | 557 | endif; |
| 558 | 558 | |
| 559 | -if ( ! function_exists( 'lsx_wc_product_columns_wrapper_close' ) ) : |
|
| 559 | +if ( ! function_exists('lsx_wc_product_columns_wrapper_close')) : |
|
| 560 | 560 | |
| 561 | 561 | /** |
| 562 | 562 | * Product columns wrapper close. |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | |
| 571 | 571 | endif; |
| 572 | 572 | |
| 573 | -if ( ! function_exists( 'lsx_wc_woocommerce_pagination' ) ) : |
|
| 573 | +if ( ! function_exists('lsx_wc_woocommerce_pagination')) : |
|
| 574 | 574 | |
| 575 | 575 | /** |
| 576 | 576 | * LSX WooCommerce Pagination |
@@ -582,14 +582,14 @@ discard block |
||
| 582 | 582 | * @subpackage woocommerce |
| 583 | 583 | */ |
| 584 | 584 | function lsx_wc_woocommerce_pagination() { |
| 585 | - if ( woocommerce_products_will_display() ) { |
|
| 585 | + if (woocommerce_products_will_display()) { |
|
| 586 | 586 | woocommerce_pagination(); |
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | endif; |
| 591 | 591 | |
| 592 | -if ( ! function_exists( 'lsx_customizer_wc_controls' ) ) : |
|
| 592 | +if ( ! function_exists('lsx_customizer_wc_controls')) : |
|
| 593 | 593 | |
| 594 | 594 | /** |
| 595 | 595 | * Returns an array of the core panel. |
@@ -599,10 +599,10 @@ discard block |
||
| 599 | 599 | * |
| 600 | 600 | * @return $lsx_controls array() |
| 601 | 601 | */ |
| 602 | - function lsx_customizer_wc_controls( $lsx_controls ) { |
|
| 602 | + function lsx_customizer_wc_controls($lsx_controls) { |
|
| 603 | 603 | $lsx_controls['panels']['lsx-wc'] = array( |
| 604 | - 'title' => esc_html__( 'WooCommerce', 'lsx' ), |
|
| 605 | - 'description' => esc_html__( 'Change the WooCommerce settings.', 'lsx' ), |
|
| 604 | + 'title' => esc_html__('WooCommerce', 'lsx'), |
|
| 605 | + 'description' => esc_html__('Change the WooCommerce settings.', 'lsx'), |
|
| 606 | 606 | 'priority' => 23, |
| 607 | 607 | ); |
| 608 | 608 | |
@@ -611,8 +611,8 @@ discard block |
||
| 611 | 611 | */ |
| 612 | 612 | |
| 613 | 613 | $lsx_controls['sections']['lsx-wc-global'] = array( |
| 614 | - 'title' => esc_html__( 'Global', 'lsx' ), |
|
| 615 | - 'description' => esc_html__( 'Change the WooCommerce global settings.', 'lsx' ), |
|
| 614 | + 'title' => esc_html__('Global', 'lsx'), |
|
| 615 | + 'description' => esc_html__('Change the WooCommerce global settings.', 'lsx'), |
|
| 616 | 616 | 'panel' => 'lsx-wc', |
| 617 | 617 | 'priority' => 1, |
| 618 | 618 | ); |
@@ -623,8 +623,8 @@ discard block |
||
| 623 | 623 | ); |
| 624 | 624 | |
| 625 | 625 | $lsx_controls['fields']['lsx_wc_trust_footer_bar_status'] = array( |
| 626 | - 'label' => esc_html__( 'Footer Trust Factors Section', 'lsx' ), |
|
| 627 | - 'description' => esc_html__( 'Enable the footer trust factors section.', 'lsx' ), |
|
| 626 | + 'label' => esc_html__('Footer Trust Factors Section', 'lsx'), |
|
| 627 | + 'description' => esc_html__('Enable the footer trust factors section.', 'lsx'), |
|
| 628 | 628 | 'section' => 'lsx-wc-global', |
| 629 | 629 | 'type' => 'checkbox', |
| 630 | 630 | 'priority' => 1, |
@@ -636,8 +636,8 @@ discard block |
||
| 636 | 636 | ); |
| 637 | 637 | |
| 638 | 638 | $lsx_controls['fields']['lsx_wc_mobile_footer_bar_status'] = array( |
| 639 | - 'label' => esc_html__( 'Footer Bar', 'lsx' ), |
|
| 640 | - 'description' => esc_html__( 'Enable the mobile footer bar.', 'lsx' ), |
|
| 639 | + 'label' => esc_html__('Footer Bar', 'lsx'), |
|
| 640 | + 'description' => esc_html__('Enable the mobile footer bar.', 'lsx'), |
|
| 641 | 641 | 'section' => 'lsx-wc-global', |
| 642 | 642 | 'type' => 'checkbox', |
| 643 | 643 | 'priority' => 1, |
@@ -648,8 +648,8 @@ discard block |
||
| 648 | 648 | */ |
| 649 | 649 | |
| 650 | 650 | $lsx_controls['sections']['lsx-wc-cart'] = array( |
| 651 | - 'title' => esc_html__( 'Cart', 'lsx' ), |
|
| 652 | - 'description' => esc_html__( 'Change the WooCommerce cart settings.', 'lsx' ), |
|
| 651 | + 'title' => esc_html__('Cart', 'lsx'), |
|
| 652 | + 'description' => esc_html__('Change the WooCommerce cart settings.', 'lsx'), |
|
| 653 | 653 | 'panel' => 'lsx-wc', |
| 654 | 654 | 'priority' => 2, |
| 655 | 655 | ); |
@@ -660,8 +660,8 @@ discard block |
||
| 660 | 660 | ); |
| 661 | 661 | |
| 662 | 662 | $lsx_controls['fields']['lsx_header_wc_cart'] = array( |
| 663 | - 'label' => esc_html__( 'Menu Item', 'lsx' ), |
|
| 664 | - 'description' => esc_html__( 'Enable the cart menu item.', 'lsx' ), |
|
| 663 | + 'label' => esc_html__('Menu Item', 'lsx'), |
|
| 664 | + 'description' => esc_html__('Enable the cart menu item.', 'lsx'), |
|
| 665 | 665 | 'section' => 'lsx-wc-cart', |
| 666 | 666 | 'type' => 'checkbox', |
| 667 | 667 | 'priority' => 1, |
@@ -670,11 +670,11 @@ discard block |
||
| 670 | 670 | return $lsx_controls; |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | - add_filter( 'lsx_customizer_controls', 'lsx_customizer_wc_controls' ); |
|
| 673 | + add_filter('lsx_customizer_controls', 'lsx_customizer_wc_controls'); |
|
| 674 | 674 | |
| 675 | 675 | endif; |
| 676 | 676 | |
| 677 | -if ( ! function_exists( 'lsx_wc_global_header_title' ) ) : |
|
| 677 | +if ( ! function_exists('lsx_wc_global_header_title')) : |
|
| 678 | 678 | |
| 679 | 679 | /** |
| 680 | 680 | * Move the shop title into the global header |
@@ -682,21 +682,21 @@ discard block |
||
| 682 | 682 | * @package lsx |
| 683 | 683 | * @subpackage the-events-calendar |
| 684 | 684 | */ |
| 685 | - function lsx_wc_global_header_title( $title ) { |
|
| 685 | + function lsx_wc_global_header_title($title) { |
|
| 686 | 686 | |
| 687 | - if ( is_woocommerce() && is_shop() ) { |
|
| 687 | + if (is_woocommerce() && is_shop()) { |
|
| 688 | 688 | |
| 689 | - $title = __( 'Shop', 'lsx' ); |
|
| 689 | + $title = __('Shop', 'lsx'); |
|
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | return $title; |
| 693 | 693 | } |
| 694 | - add_filter( 'lsx_global_header_title', 'lsx_wc_global_header_title', 200, 1 ); |
|
| 694 | + add_filter('lsx_global_header_title', 'lsx_wc_global_header_title', 200, 1); |
|
| 695 | 695 | |
| 696 | 696 | endif; |
| 697 | 697 | |
| 698 | 698 | |
| 699 | -if ( ! function_exists( 'lsx_wc_footer_bar' ) ) : |
|
| 699 | +if ( ! function_exists('lsx_wc_footer_bar')) : |
|
| 700 | 700 | |
| 701 | 701 | /** |
| 702 | 702 | * Display WC footer bar. |
@@ -705,47 +705,47 @@ discard block |
||
| 705 | 705 | * @subpackage woocommerce |
| 706 | 706 | */ |
| 707 | 707 | function lsx_wc_footer_bar() { |
| 708 | - $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
| 709 | - if ( ! empty( get_theme_mod( 'lsx_wc_mobile_footer_bar_status', '1' ) ) ) : |
|
| 708 | + $cart_url = function_exists('wc_get_cart_url') ? wc_get_cart_url() : WC()->cart->get_cart_url(); |
|
| 709 | + if ( ! empty(get_theme_mod('lsx_wc_mobile_footer_bar_status', '1'))) : |
|
| 710 | 710 | ?> |
| 711 | 711 | <div class="lsx-wc-footer-bar"> |
| 712 | - <form role="search" method="get" action="<?php echo esc_url( home_url() ); ?>" class="lsx-wc-footer-bar-form"> |
|
| 712 | + <form role="search" method="get" action="<?php echo esc_url(home_url()); ?>" class="lsx-wc-footer-bar-form"> |
|
| 713 | 713 | <fieldset> |
| 714 | - <legend class="screen-reader-text"><?php esc_html_e( 'Search products', 'lsx' ); ?></legend> |
|
| 715 | - <input type="search" name="s" placeholder="<?php esc_attr_e( 'Search products...', 'lsx' ); ?>" class="form-control"> |
|
| 714 | + <legend class="screen-reader-text"><?php esc_html_e('Search products', 'lsx'); ?></legend> |
|
| 715 | + <input type="search" name="s" placeholder="<?php esc_attr_e('Search products...', 'lsx'); ?>" class="form-control"> |
|
| 716 | 716 | </fieldset> |
| 717 | 717 | </form> |
| 718 | 718 | |
| 719 | 719 | <ul class="lsx-wc-footer-bar-items"> |
| 720 | 720 | <li class="lsx-wc-footer-bar-item"> |
| 721 | - <a href="<?php echo esc_url( home_url() ); ?>" class="lsx-wc-footer-bar-link"> |
|
| 721 | + <a href="<?php echo esc_url(home_url()); ?>" class="lsx-wc-footer-bar-link"> |
|
| 722 | 722 | <i class="fa fa-home" aria-hidden="true"></i> |
| 723 | - <span><?php esc_html_e( 'Home', 'lsx' ); ?></span> |
|
| 723 | + <span><?php esc_html_e('Home', 'lsx'); ?></span> |
|
| 724 | 724 | </a> |
| 725 | 725 | </li> |
| 726 | 726 | |
| 727 | 727 | <li class="lsx-wc-footer-bar-item"> |
| 728 | - <a href="<?php echo esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ); ?>" class="lsx-wc-footer-bar-link"> |
|
| 728 | + <a href="<?php echo esc_url(get_permalink(get_option('woocommerce_myaccount_page_id'))); ?>" class="lsx-wc-footer-bar-link"> |
|
| 729 | 729 | <i class="fa fa-user" aria-hidden="true"></i> |
| 730 | - <span><?php esc_html_e( 'Account', 'lsx' ); ?></span> |
|
| 730 | + <span><?php esc_html_e('Account', 'lsx'); ?></span> |
|
| 731 | 731 | </a> |
| 732 | 732 | </li> |
| 733 | 733 | |
| 734 | 734 | <li class="lsx-wc-footer-bar-item"> |
| 735 | 735 | <a href="#" class="lsx-wc-footer-bar-link lsx-wc-footer-bar-link-toogle"> |
| 736 | 736 | <i class="fa fa-search" aria-hidden="true"></i> |
| 737 | - <span><?php esc_html_e( 'Search', 'lsx' ); ?></span> |
|
| 737 | + <span><?php esc_html_e('Search', 'lsx'); ?></span> |
|
| 738 | 738 | </a> |
| 739 | 739 | </li> |
| 740 | 740 | |
| 741 | 741 | <li class="lsx-wc-footer-bar-item"> |
| 742 | - <a href="<?php echo esc_url( $cart_url ); ?>" class="lsx-wc-footer-bar-link"> |
|
| 742 | + <a href="<?php echo esc_url($cart_url); ?>" class="lsx-wc-footer-bar-link"> |
|
| 743 | 743 | <i class="fa fa-shopping-basket" aria-hidden="true"></i> |
| 744 | 744 | <?php $count = WC()->cart->get_cart_contents_count(); ?> |
| 745 | - <?php if ( ! empty( $count ) ) : ?> |
|
| 746 | - <span class="lsx-wc-footer-bar-count"><?php echo wp_kses_data( $count ); ?></span> |
|
| 745 | + <?php if ( ! empty($count)) : ?> |
|
| 746 | + <span class="lsx-wc-footer-bar-count"><?php echo wp_kses_data($count); ?></span> |
|
| 747 | 747 | <?php endif; ?> |
| 748 | - <span><?php esc_html_e( 'Cart', 'lsx' ); ?></span> |
|
| 748 | + <span><?php esc_html_e('Cart', 'lsx'); ?></span> |
|
| 749 | 749 | </a> |
| 750 | 750 | </li> |
| 751 | 751 | </ul> |
@@ -754,11 +754,11 @@ discard block |
||
| 754 | 754 | endif; |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | - add_action( 'lsx_body_bottom', 'lsx_wc_footer_bar', 15 ); |
|
| 757 | + add_action('lsx_body_bottom', 'lsx_wc_footer_bar', 15); |
|
| 758 | 758 | |
| 759 | 759 | endif; |
| 760 | 760 | |
| 761 | -if ( ! function_exists( 'lsx_wc_body_class' ) ) : |
|
| 761 | +if ( ! function_exists('lsx_wc_body_class')) : |
|
| 762 | 762 | |
| 763 | 763 | /** |
| 764 | 764 | * Changes body class. |
@@ -766,25 +766,25 @@ discard block |
||
| 766 | 766 | * @package lsx |
| 767 | 767 | * @subpackage woocommerce |
| 768 | 768 | */ |
| 769 | - function lsx_wc_body_class( $classes ) { |
|
| 769 | + function lsx_wc_body_class($classes) { |
|
| 770 | 770 | global $post; |
| 771 | 771 | |
| 772 | - if ( $post && class_exists( 'WC_Wishlists_Pages' ) && WC_Wishlists_Pages::is_wishlist_page( $post->post_name ) ) { |
|
| 772 | + if ($post && class_exists('WC_Wishlists_Pages') && WC_Wishlists_Pages::is_wishlist_page($post->post_name)) { |
|
| 773 | 773 | $classes[] = 'woocommerce-page woocommerce-wishlist'; |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | - if ( ! empty( get_theme_mod( 'lsx_wc_mobile_footer_bar_status', '1' ) ) ) { |
|
| 776 | + if ( ! empty(get_theme_mod('lsx_wc_mobile_footer_bar_status', '1'))) { |
|
| 777 | 777 | $classes[] = 'lsx-wc-has-footer-bar'; |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | return $classes; |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | - add_filter( 'body_class', 'lsx_wc_body_class', 2999 ); |
|
| 783 | + add_filter('body_class', 'lsx_wc_body_class', 2999); |
|
| 784 | 784 | |
| 785 | 785 | endif; |
| 786 | 786 | |
| 787 | -if ( ! function_exists( 'lsx_wc_downloadable_products' ) ) : |
|
| 787 | +if ( ! function_exists('lsx_wc_downloadable_products')) : |
|
| 788 | 788 | |
| 789 | 789 | /** |
| 790 | 790 | * Changes downloads "download" button text. |
@@ -792,19 +792,19 @@ discard block |
||
| 792 | 792 | * @package lsx |
| 793 | 793 | * @subpackage woocommerce |
| 794 | 794 | */ |
| 795 | - function lsx_wc_downloadable_products( $downloads ) { |
|
| 796 | - foreach ( $downloads as $i => $download ) { |
|
| 797 | - $downloads[ $i ]['download_name'] = esc_html__( 'Download', 'lsx' ); |
|
| 795 | + function lsx_wc_downloadable_products($downloads) { |
|
| 796 | + foreach ($downloads as $i => $download) { |
|
| 797 | + $downloads[$i]['download_name'] = esc_html__('Download', 'lsx'); |
|
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 800 | return $downloads; |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | - add_filter( 'woocommerce_customer_get_downloadable_products', 'lsx_wc_downloadable_products', 2999 ); |
|
| 803 | + add_filter('woocommerce_customer_get_downloadable_products', 'lsx_wc_downloadable_products', 2999); |
|
| 804 | 804 | |
| 805 | 805 | endif; |
| 806 | 806 | |
| 807 | -if ( ! function_exists( 'lsx_wc_move_bundle_products' ) ) : |
|
| 807 | +if ( ! function_exists('lsx_wc_move_bundle_products')) : |
|
| 808 | 808 | |
| 809 | 809 | /** |
| 810 | 810 | * WooCommerce - Move the bundle products to a tab. |
@@ -812,46 +812,46 @@ discard block |
||
| 812 | 812 | * @package lsx |
| 813 | 813 | * @subpackage woocommerce |
| 814 | 814 | */ |
| 815 | - function lsx_wc_move_bundle_products( $tabs ) { |
|
| 815 | + function lsx_wc_move_bundle_products($tabs) { |
|
| 816 | 816 | global $product, $post; |
| 817 | 817 | |
| 818 | - if ( method_exists( $product, 'get_bundled_items' ) ) { |
|
| 818 | + if (method_exists($product, 'get_bundled_items')) { |
|
| 819 | 819 | $bundled_items = $product->get_bundled_items(); |
| 820 | 820 | |
| 821 | - if ( ! empty( $bundled_items ) ) { |
|
| 821 | + if ( ! empty($bundled_items)) { |
|
| 822 | 822 | $tabs['bundled_products'] = array( |
| 823 | - 'title' => __( 'Included Products', 'lsx' ), |
|
| 823 | + 'title' => __('Included Products', 'lsx'), |
|
| 824 | 824 | 'priority' => 10, |
| 825 | 825 | 'callback' => 'lsx_wc_bundle_products', |
| 826 | 826 | ); |
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | 829 | |
| 830 | - if ( isset( $tabs['description'] ) ) { |
|
| 830 | + if (isset($tabs['description'])) { |
|
| 831 | 831 | $tabs['description']['priority'] = 5; |
| 832 | 832 | } |
| 833 | 833 | |
| 834 | - if ( isset( $tabs['reviews'] ) ) { |
|
| 834 | + if (isset($tabs['reviews'])) { |
|
| 835 | 835 | $tabs['reviews']['priority'] = 15; |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | - if ( isset( $tabs['product_enquiry'] ) ) { |
|
| 838 | + if (isset($tabs['product_enquiry'])) { |
|
| 839 | 839 | $tabs['product_enquiry']['priority'] = 20; |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | return $tabs; |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | - add_action( 'woocommerce_product_tabs', 'lsx_wc_move_bundle_products', 50 ); |
|
| 845 | + add_action('woocommerce_product_tabs', 'lsx_wc_move_bundle_products', 50); |
|
| 846 | 846 | |
| 847 | 847 | endif; |
| 848 | 848 | |
| 849 | -if ( ! function_exists( 'lsx_wc_bundle_products' ) ) : |
|
| 849 | +if ( ! function_exists('lsx_wc_bundle_products')) : |
|
| 850 | 850 | |
| 851 | 851 | function lsx_wc_bundle_products() { |
| 852 | 852 | global $product, $post; |
| 853 | 853 | |
| 854 | - if ( method_exists( $product, 'get_bundled_items' ) ) { |
|
| 854 | + if (method_exists($product, 'get_bundled_items')) { |
|
| 855 | 855 | $bundled_items = $product->get_bundled_items(); |
| 856 | 856 | |
| 857 | 857 | // do_action( 'woocommerce_before_bundled_items', $product ); |
@@ -867,16 +867,16 @@ discard block |
||
| 867 | 867 | // $this->widget_start( $args, $instance ); |
| 868 | 868 | |
| 869 | 869 | // @codingStandardsIgnoreLine |
| 870 | - echo apply_filters( 'woocommerce_before_widget_product_list', '<ul class="product_list_widget">' ); |
|
| 870 | + echo apply_filters('woocommerce_before_widget_product_list', '<ul class="product_list_widget">'); |
|
| 871 | 871 | |
| 872 | - foreach ( $bundled_items as $bundled_item ) { |
|
| 873 | - $product = wc_get_product( $bundled_item->item_data['product_id'] ); |
|
| 874 | - wc_get_template( 'content-widget-product.php' ); |
|
| 872 | + foreach ($bundled_items as $bundled_item) { |
|
| 873 | + $product = wc_get_product($bundled_item->item_data['product_id']); |
|
| 874 | + wc_get_template('content-widget-product.php'); |
|
| 875 | 875 | $product = $product_original; |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | // @codingStandardsIgnoreLine |
| 879 | - echo apply_filters( 'woocommerce_after_widget_product_list', '</ul>' ); |
|
| 879 | + echo apply_filters('woocommerce_after_widget_product_list', '</ul>'); |
|
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 | // $this->widget_end( $args ); |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | endif; |
| 886 | 886 | |
| 887 | 887 | |
| 888 | -if ( ! function_exists( 'lsx_wc_product_searchform' ) ) : |
|
| 888 | +if ( ! function_exists('lsx_wc_product_searchform')) : |
|
| 889 | 889 | /** |
| 890 | 890 | * woo_custom_product_searchform |
| 891 | 891 | * |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | * @since 1.0 |
| 894 | 894 | * @return void |
| 895 | 895 | */ |
| 896 | - function lsx_wc_product_searchform( $form ) { |
|
| 896 | + function lsx_wc_product_searchform($form) { |
|
| 897 | 897 | |
| 898 | 898 | $form = ' |
| 899 | 899 | <form role="search" method="get" class="search-form form-inline" id="searchform" action="<?php echo esc_url( home_url( \'/\' ) ); ?>"> |
@@ -914,42 +914,42 @@ discard block |
||
| 914 | 914 | |
| 915 | 915 | } |
| 916 | 916 | endif; |
| 917 | -add_filter( 'get_product_search_form', 'lsx_wc_product_searchform', 10, 1 ); |
|
| 917 | +add_filter('get_product_search_form', 'lsx_wc_product_searchform', 10, 1); |
|
| 918 | 918 | |
| 919 | 919 | /** |
| 920 | 920 | * Output the pagination. |
| 921 | 921 | */ |
| 922 | 922 | function woocommerce_pagination() { |
| 923 | - if ( ! wc_get_loop_prop( 'is_paginated' ) || ! woocommerce_products_will_display() ) { |
|
| 923 | + if ( ! wc_get_loop_prop('is_paginated') || ! woocommerce_products_will_display()) { |
|
| 924 | 924 | return; |
| 925 | 925 | } |
| 926 | 926 | $args = array( |
| 927 | - 'total' => wc_get_loop_prop( 'total_pages' ), |
|
| 928 | - 'current' => wc_get_loop_prop( 'current_page' ), |
|
| 927 | + 'total' => wc_get_loop_prop('total_pages'), |
|
| 928 | + 'current' => wc_get_loop_prop('current_page'), |
|
| 929 | 929 | ); |
| 930 | 930 | |
| 931 | - if ( wc_get_loop_prop( 'is_shortcode' ) ) { |
|
| 932 | - $args['base'] = esc_url_raw( add_query_arg( 'product-page', '%#%', false ) ); |
|
| 931 | + if (wc_get_loop_prop('is_shortcode')) { |
|
| 932 | + $args['base'] = esc_url_raw(add_query_arg('product-page', '%#%', false)); |
|
| 933 | 933 | $args['format'] = '?product-page = %#%'; |
| 934 | 934 | } else { |
| 935 | - $args['base'] = esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ); |
|
| 935 | + $args['base'] = esc_url_raw(str_replace(999999999, '%#%', remove_query_arg('add-to-cart', get_pagenum_link(999999999, false)))); |
|
| 936 | 936 | $args['format'] = ''; |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | - echo wp_kses_post( '<div class="lsx-pagination-wrapper">' ); |
|
| 940 | - $template = wc_get_template_html( 'loop/pagination.php', $args ); |
|
| 941 | - $template = str_replace( 'woocommerce-pagination', 'lsx-pagination', $template ); |
|
| 942 | - echo wp_kses_post( $template ); |
|
| 943 | - echo wp_kses_post( '</div>' ); |
|
| 939 | + echo wp_kses_post('<div class="lsx-pagination-wrapper">'); |
|
| 940 | + $template = wc_get_template_html('loop/pagination.php', $args); |
|
| 941 | + $template = str_replace('woocommerce-pagination', 'lsx-pagination', $template); |
|
| 942 | + echo wp_kses_post($template); |
|
| 943 | + echo wp_kses_post('</div>'); |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | -function lsx_wc_pagination_args( $args ) { |
|
| 947 | - $args['prev_text'] = '<span class="meta-nav">←</span> ' . esc_html__( 'Previous', 'lsx' ); |
|
| 948 | - $args['next_text'] = esc_html__( 'Next', 'lsx' ) . ' <span class="meta-nav">→</span>'; |
|
| 946 | +function lsx_wc_pagination_args($args) { |
|
| 947 | + $args['prev_text'] = '<span class="meta-nav">←</span> ' . esc_html__('Previous', 'lsx'); |
|
| 948 | + $args['next_text'] = esc_html__('Next', 'lsx') . ' <span class="meta-nav">→</span>'; |
|
| 949 | 949 | $args['type'] = 'plain'; |
| 950 | 950 | return $args; |
| 951 | 951 | } |
| 952 | -add_filter( 'woocommerce_pagination_args', 'lsx_wc_pagination_args', 10, 1 ); |
|
| 952 | +add_filter('woocommerce_pagination_args', 'lsx_wc_pagination_args', 10, 1); |
|
| 953 | 953 | |
| 954 | 954 | |
| 955 | 955 | /** |
@@ -960,24 +960,24 @@ discard block |
||
| 960 | 960 | * |
| 961 | 961 | * @return array |
| 962 | 962 | */ |
| 963 | -function lsx_wc_product_widget_template( $located, $template_name ) { |
|
| 964 | - if ( 'content-widget-product.php' === $template_name || 'content-widget-review.php' === $template_name ) { |
|
| 963 | +function lsx_wc_product_widget_template($located, $template_name) { |
|
| 964 | + if ('content-widget-product.php' === $template_name || 'content-widget-review.php' === $template_name) { |
|
| 965 | 965 | |
| 966 | 966 | $new_location = get_stylesheet_directory() . '/partials/' . $template_name; |
| 967 | - if ( file_exists( $new_location ) ) { |
|
| 967 | + if (file_exists($new_location)) { |
|
| 968 | 968 | $located = $new_location; |
| 969 | 969 | } else { |
| 970 | 970 | $new_location = get_parent_theme_file_path() . '/partials/' . $template_name; |
| 971 | - if ( file_exists( $new_location ) ) { |
|
| 971 | + if (file_exists($new_location)) { |
|
| 972 | 972 | $located = $new_location; |
| 973 | 973 | } |
| 974 | 974 | } |
| 975 | 975 | } |
| 976 | 976 | return $located; |
| 977 | 977 | } |
| 978 | -add_filter( 'wc_get_template', 'lsx_wc_product_widget_template', 90, 2 ); |
|
| 978 | +add_filter('wc_get_template', 'lsx_wc_product_widget_template', 90, 2); |
|
| 979 | 979 | |
| 980 | -if ( ! function_exists( 'lsx_payment_gateway_logos' ) ) { |
|
| 980 | +if ( ! function_exists('lsx_payment_gateway_logos')) { |
|
| 981 | 981 | /** |
| 982 | 982 | * Add Lets Encrypt and PayFast logos to cart. |
| 983 | 983 | **/ |
@@ -986,20 +986,20 @@ discard block |
||
| 986 | 986 | $payfast_image = get_template_directory_uri() . '/assets/images/payfast-footer-logo.svg'; |
| 987 | 987 | $payment_logos = get_template_directory_uri() . '/assets/images/payment-logos.svg'; |
| 988 | 988 | $payment_logos_mobile = get_template_directory_uri() . '/assets/images/payment-logos-mobile.svg'; |
| 989 | - if ( ( is_checkout() || is_cart() ) && ( ! empty( get_theme_mod( 'lsx_wc_trust_footer_bar_status', '1' ) ) ) ) { |
|
| 989 | + if ((is_checkout() || is_cart()) && ( ! empty(get_theme_mod('lsx_wc_trust_footer_bar_status', '1')))) { |
|
| 990 | 990 | ?> |
| 991 | 991 | <div class="row text-center vertical-align lsx-full-width-base-small checkout-cta-bottom"> |
| 992 | 992 | <div class="col-md-12 img-payfast"> |
| 993 | - <img src="<?php echo esc_url( $payfast_image ); ?>" alt="payfast"/> |
|
| 993 | + <img src="<?php echo esc_url($payfast_image); ?>" alt="payfast"/> |
|
| 994 | 994 | </div> |
| 995 | 995 | <div class="col-md-12 img-payments hidden-xs"> |
| 996 | - <img src="<?php echo esc_url( $payment_logos ); ?>" alt="payments"/> |
|
| 996 | + <img src="<?php echo esc_url($payment_logos); ?>" alt="payments"/> |
|
| 997 | 997 | </div> |
| 998 | 998 | <div class="col-md-12 img-payments hidden-sm hidden-md hidden-lg"> |
| 999 | - <img src="<?php echo esc_url( $payment_logos_mobile ); ?>" alt="payments"/> |
|
| 999 | + <img src="<?php echo esc_url($payment_logos_mobile); ?>" alt="payments"/> |
|
| 1000 | 1000 | </div> |
| 1001 | 1001 | <div class="col-md-12 img-encrypt"> |
| 1002 | - <img src="<?php echo esc_url( $encript_image ); ?>" alt="lets_encrypt"/> |
|
| 1002 | + <img src="<?php echo esc_url($encript_image); ?>" alt="lets_encrypt"/> |
|
| 1003 | 1003 | </div> |
| 1004 | 1004 | </div> |
| 1005 | 1005 | |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 1010 | 1010 | |
| 1011 | 1011 | // check for plugin using plugin name. |
| 1012 | - if ( ! is_plugin_active( 'lsx-health-plan/lsx-health-plan.php' ) ) { |
|
| 1013 | - add_action( 'lsx_footer_before', 'lsx_payment_gateway_logos' ); |
|
| 1012 | + if ( ! is_plugin_active('lsx-health-plan/lsx-health-plan.php')) { |
|
| 1013 | + add_action('lsx_footer_before', 'lsx_payment_gateway_logos'); |
|
| 1014 | 1014 | } |
| 1015 | 1015 | } |
@@ -6,25 +6,25 @@ discard block |
||
| 6 | 6 | * @subpackage layout |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -if ( ! function_exists( 'lsx_layout_selector' ) ) : |
|
| 13 | +if ( ! function_exists('lsx_layout_selector')) : |
|
| 14 | 14 | /** |
| 15 | 15 | * Layout selector. |
| 16 | 16 | * |
| 17 | 17 | * @package lsx |
| 18 | 18 | * @subpackage layout |
| 19 | 19 | */ |
| 20 | - function lsx_layout_selector( $class, $area = 'site' ) { |
|
| 20 | + function lsx_layout_selector($class, $area = 'site') { |
|
| 21 | 21 | $return_class = ''; |
| 22 | - $layout = get_theme_mod( 'lsx_layout', '1c' ); |
|
| 23 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 22 | + $layout = get_theme_mod('lsx_layout', '1c'); |
|
| 23 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 24 | 24 | $default_size = 'sm'; |
| 25 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
| 25 | + $size = apply_filters('lsx_bootstrap_column_size', $default_size); |
|
| 26 | 26 | |
| 27 | - switch ( $layout ) { |
|
| 27 | + switch ($layout) { |
|
| 28 | 28 | case '1c': |
| 29 | 29 | $main_class = 'col-' . $size . '-12'; |
| 30 | 30 | $sidebar_class = 'col-' . $size . '-12'; |
@@ -43,19 +43,19 @@ discard block |
||
| 43 | 43 | break; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if ( 'main' === $class ) { |
|
| 47 | - $return_class = apply_filters( 'lsx_layout_selector', $main_class, $class, $layout, $size ); |
|
| 46 | + if ('main' === $class) { |
|
| 47 | + $return_class = apply_filters('lsx_layout_selector', $main_class, $class, $layout, $size); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if ( 'sidebar' === $class ) { |
|
| 51 | - $return_class = apply_filters( 'lsx_layout_selector', $sidebar_class, $class, $layout, $size ); |
|
| 50 | + if ('sidebar' === $class) { |
|
| 51 | + $return_class = apply_filters('lsx_layout_selector', $sidebar_class, $class, $layout, $size); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $return_class; |
| 55 | 55 | } |
| 56 | 56 | endif; |
| 57 | 57 | |
| 58 | -if ( ! function_exists( 'lsx_main_class' ) ) : |
|
| 58 | +if ( ! function_exists('lsx_main_class')) : |
|
| 59 | 59 | /** |
| 60 | 60 | * .main classes. |
| 61 | 61 | * |
@@ -63,11 +63,11 @@ discard block |
||
| 63 | 63 | * @subpackage layout |
| 64 | 64 | */ |
| 65 | 65 | function lsx_main_class() { |
| 66 | - return lsx_layout_selector( 'main' ); |
|
| 66 | + return lsx_layout_selector('main'); |
|
| 67 | 67 | } |
| 68 | 68 | endif; |
| 69 | 69 | |
| 70 | -if ( ! function_exists( 'lsx_sidebar_class' ) ) : |
|
| 70 | +if ( ! function_exists('lsx_sidebar_class')) : |
|
| 71 | 71 | /** |
| 72 | 72 | * .sidebar classes. |
| 73 | 73 | * |
@@ -75,47 +75,47 @@ discard block |
||
| 75 | 75 | * @subpackage layout |
| 76 | 76 | */ |
| 77 | 77 | function lsx_sidebar_class() { |
| 78 | - return lsx_layout_selector( 'sidebar' ); |
|
| 78 | + return lsx_layout_selector('sidebar'); |
|
| 79 | 79 | } |
| 80 | 80 | endif; |
| 81 | 81 | |
| 82 | -if ( ! function_exists( 'lsx_header_classes' ) ) : |
|
| 82 | +if ( ! function_exists('lsx_header_classes')) : |
|
| 83 | 83 | /** |
| 84 | 84 | * Output the classes for the header. |
| 85 | 85 | * |
| 86 | 86 | * @package lsx |
| 87 | 87 | * @subpackage layout |
| 88 | 88 | */ |
| 89 | - function lsx_header_classes( $additional = false ) { |
|
| 89 | + function lsx_header_classes($additional = false) { |
|
| 90 | 90 | $classes = 'banner navbar navbar-default'; |
| 91 | 91 | |
| 92 | - if ( false !== $additional ) { |
|
| 92 | + if (false !== $additional) { |
|
| 93 | 93 | $classes .= ' ' . $additional; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - echo esc_attr( $classes ); |
|
| 96 | + echo esc_attr($classes); |
|
| 97 | 97 | } |
| 98 | 98 | endif; |
| 99 | 99 | |
| 100 | -if ( ! function_exists( 'lsx_top_menu_classes' ) ) : |
|
| 100 | +if ( ! function_exists('lsx_top_menu_classes')) : |
|
| 101 | 101 | /** |
| 102 | 102 | * Output the classes for the top-menu. |
| 103 | 103 | * |
| 104 | 104 | * @package lsx |
| 105 | 105 | * @subpackage layout |
| 106 | 106 | */ |
| 107 | - function lsx_top_menu_classes( $additional = false ) { |
|
| 107 | + function lsx_top_menu_classes($additional = false) { |
|
| 108 | 108 | $classes = 'top-menu-default'; |
| 109 | 109 | |
| 110 | - if ( false !== $additional ) { |
|
| 110 | + if (false !== $additional) { |
|
| 111 | 111 | $classes .= ' ' . $additional; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - echo esc_attr( $classes ); |
|
| 114 | + echo esc_attr($classes); |
|
| 115 | 115 | } |
| 116 | 116 | endif; |
| 117 | 117 | |
| 118 | -if ( ! function_exists( 'lsx_post_wrapper_class' ) ) : |
|
| 118 | +if ( ! function_exists('lsx_post_wrapper_class')) : |
|
| 119 | 119 | /** |
| 120 | 120 | * Output the classes for the top-menu. |
| 121 | 121 | * |
@@ -123,13 +123,13 @@ discard block |
||
| 123 | 123 | * @subpackage layout |
| 124 | 124 | */ |
| 125 | 125 | function lsx_post_wrapper_class() { |
| 126 | - return apply_filters( 'lsx_post_wrapper_class', '' ); |
|
| 126 | + return apply_filters('lsx_post_wrapper_class', ''); |
|
| 127 | 127 | } |
| 128 | 128 | endif; |
| 129 | 129 | |
| 130 | 130 | |
| 131 | 131 | |
| 132 | -if ( ! function_exists( 'lsx_add_footer_sidebar_area' ) ) : |
|
| 132 | +if ( ! function_exists('lsx_add_footer_sidebar_area')) : |
|
| 133 | 133 | /** |
| 134 | 134 | * Output the Footer CTA and/pr Footer Widgets. |
| 135 | 135 | * |
@@ -137,33 +137,33 @@ discard block |
||
| 137 | 137 | * @subpackage layout |
| 138 | 138 | */ |
| 139 | 139 | function lsx_add_footer_sidebar_area() { |
| 140 | - if ( is_active_sidebar( 'sidebar-footer-cta' ) ) : ?> |
|
| 140 | + if (is_active_sidebar('sidebar-footer-cta')) : ?> |
|
| 141 | 141 | <div id="footer-cta"> |
| 142 | 142 | <div class="container"> |
| 143 | 143 | <div class="lsx-full-width"> |
| 144 | 144 | <div class="lsx-hero-unit"> |
| 145 | - <?php dynamic_sidebar( 'sidebar-footer-cta' ); ?> |
|
| 145 | + <?php dynamic_sidebar('sidebar-footer-cta'); ?> |
|
| 146 | 146 | </div> |
| 147 | 147 | </div> |
| 148 | 148 | </div> |
| 149 | 149 | </div> |
| 150 | 150 | <?php endif; ?> |
| 151 | 151 | |
| 152 | - <?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?> |
|
| 152 | + <?php if (is_active_sidebar('sidebar-footer')) : ?> |
|
| 153 | 153 | <div id="footer-widgets"> |
| 154 | 154 | <div class="container"> |
| 155 | 155 | <div class="row"> |
| 156 | - <?php dynamic_sidebar( 'sidebar-footer' ); ?> |
|
| 156 | + <?php dynamic_sidebar('sidebar-footer'); ?> |
|
| 157 | 157 | </div> |
| 158 | 158 | </div> |
| 159 | 159 | </div> |
| 160 | 160 | <?php |
| 161 | 161 | endif; |
| 162 | 162 | } |
| 163 | - add_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
| 163 | + add_action('lsx_footer_before', 'lsx_add_footer_sidebar_area'); |
|
| 164 | 164 | endif; |
| 165 | 165 | |
| 166 | -if ( ! function_exists( 'lsx_global_header' ) ) : |
|
| 166 | +if ( ! function_exists('lsx_global_header')) : |
|
| 167 | 167 | /** |
| 168 | 168 | * Displays the global header. |
| 169 | 169 | * |
@@ -171,24 +171,24 @@ discard block |
||
| 171 | 171 | * @subpackage layout |
| 172 | 172 | */ |
| 173 | 173 | function lsx_global_header() { |
| 174 | - $show_on_front = get_option( 'show_on_front' ); |
|
| 174 | + $show_on_front = get_option('show_on_front'); |
|
| 175 | 175 | $queried_object = get_queried_object(); |
| 176 | 176 | $default_size = 'sm'; |
| 177 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
| 177 | + $size = apply_filters('lsx_bootstrap_column_size', $default_size); |
|
| 178 | 178 | |
| 179 | 179 | // Cart and Checkout won't have banners of any kind. |
| 180 | - if ( function_exists( 'is_woocommerce' ) && ( is_checkout() || is_cart() ) ) { |
|
| 180 | + if (function_exists('is_woocommerce') && (is_checkout() || is_cart())) { |
|
| 181 | 181 | return; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | // Product pages have their own banner function 'lsx_page_banner()'. |
| 185 | - if ( function_exists( 'is_woocommerce' ) && ( is_product() ) ) { |
|
| 185 | + if (function_exists('is_woocommerce') && (is_product())) { |
|
| 186 | 186 | return; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if ( is_page() && ( 'page' !== $show_on_front || ! is_front_page() ) ) : |
|
| 189 | + if (is_page() && ('page' !== $show_on_front || ! is_front_page())) : |
|
| 190 | 190 | ?> |
| 191 | - <div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 191 | + <div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12"> |
|
| 192 | 192 | <?php lsx_global_header_inner_bottom(); ?> |
| 193 | 193 | <header class="archive-header"> |
| 194 | 194 | <h1 class="archive-title"><?php the_title(); ?></h1> |
@@ -196,26 +196,26 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | </div> |
| 198 | 198 | <?php |
| 199 | - elseif ( is_single() && ! is_singular( 'post' ) ) : |
|
| 199 | + elseif (is_single() && ! is_singular('post')) : |
|
| 200 | 200 | ?> |
| 201 | - <div class="archive-header-wrapper banner-single col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 201 | + <div class="archive-header-wrapper banner-single col-<?php echo esc_attr($size); ?>-12"> |
|
| 202 | 202 | <?php lsx_global_header_inner_bottom(); ?> |
| 203 | 203 | <header class="archive-header"> |
| 204 | - <h1 class="archive-title"><?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_title() ) ); ?></h1> |
|
| 204 | + <h1 class="archive-title"><?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_title())); ?></h1> |
|
| 205 | 205 | </header> |
| 206 | 206 | |
| 207 | 207 | </div> |
| 208 | 208 | <?php |
| 209 | - elseif ( is_search() ) : |
|
| 209 | + elseif (is_search()) : |
|
| 210 | 210 | ?> |
| 211 | - <div class="archive-header-wrapper banner-search col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 211 | + <div class="archive-header-wrapper banner-search col-<?php echo esc_attr($size); ?>-12"> |
|
| 212 | 212 | <?php lsx_global_header_inner_bottom(); ?> |
| 213 | 213 | <header class="archive-header"> |
| 214 | 214 | <h1 class="archive-title"> |
| 215 | 215 | <?php |
| 216 | 216 | printf( |
| 217 | 217 | /* Translators: %s: search term/query */ |
| 218 | - esc_html__( 'Search Results for: %s', 'lsx' ), |
|
| 218 | + esc_html__('Search Results for: %s', 'lsx'), |
|
| 219 | 219 | '<span>' . get_search_query() . '</span>' |
| 220 | 220 | ); |
| 221 | 221 | ?> |
@@ -224,12 +224,12 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | </div> |
| 226 | 226 | <?php |
| 227 | - elseif ( is_author() ) : |
|
| 227 | + elseif (is_author()) : |
|
| 228 | 228 | $author = get_the_author(); |
| 229 | - $author_avatar = get_avatar( get_the_author_meta( 'ID' ), 256 ); |
|
| 229 | + $author_avatar = get_avatar(get_the_author_meta('ID'), 256); |
|
| 230 | 230 | $author_bio = get_the_archive_description(); |
| 231 | 231 | ?> |
| 232 | - <div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 232 | + <div class="archive-header-wrapper banner-archive-author col-<?php echo esc_attr($size); ?>-12"> |
|
| 233 | 233 | <?php lsx_global_header_inner_bottom(); ?> |
| 234 | 234 | <header class="archive-header"> |
| 235 | 235 | <h1 class="archive-title"><?php the_archive_title(); ?></h1> |
@@ -237,57 +237,57 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | </div> |
| 239 | 239 | <?php |
| 240 | - elseif ( is_archive() ) : |
|
| 240 | + elseif (is_archive()) : |
|
| 241 | 241 | ?> |
| 242 | - <div class="archive-header-wrapper banner-archive col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 242 | + <div class="archive-header-wrapper banner-archive col-<?php echo esc_attr($size); ?>-12"> |
|
| 243 | 243 | <?php lsx_global_header_inner_bottom(); ?> |
| 244 | 244 | <header class="archive-header"> |
| 245 | 245 | <h1 class="archive-title"> |
| 246 | - <?php if ( has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax( 'post_format' ) ) { ?> |
|
| 247 | - <?php the_archive_title( esc_html__( 'Type:', 'lsx' ) ); ?> |
|
| 246 | + <?php if (has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax('post_format')) { ?> |
|
| 247 | + <?php the_archive_title(esc_html__('Type:', 'lsx')); ?> |
|
| 248 | 248 | <?php } else { ?> |
| 249 | - <?php echo wp_kses_post( apply_filters( 'lsx_global_header_title', get_the_archive_title() ) ); ?> |
|
| 249 | + <?php echo wp_kses_post(apply_filters('lsx_global_header_title', get_the_archive_title())); ?> |
|
| 250 | 250 | <?php } ?> |
| 251 | 251 | </h1> |
| 252 | 252 | |
| 253 | 253 | <?php |
| 254 | - if ( false === apply_filters( 'lsx_display_global_header_description', false ) ) { |
|
| 254 | + if (false === apply_filters('lsx_display_global_header_description', false)) { |
|
| 255 | 255 | the_archive_description(); |
| 256 | 256 | } |
| 257 | 257 | ?> |
| 258 | 258 | </header> |
| 259 | 259 | </div> |
| 260 | 260 | <?php |
| 261 | - elseif ( 'page' === $show_on_front && (int) get_option( 'page_for_posts' ) === $queried_object->ID ) : |
|
| 261 | + elseif ('page' === $show_on_front && (int) get_option('page_for_posts') === $queried_object->ID) : |
|
| 262 | 262 | ?> |
| 263 | - <div class="archive-header-wrapper banner-page col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 263 | + <div class="archive-header-wrapper banner-page col-<?php echo esc_attr($size); ?>-12"> |
|
| 264 | 264 | <?php lsx_global_header_inner_bottom(); ?> |
| 265 | 265 | <header class="archive-header"> |
| 266 | - <h1 class="archive-title"><?php esc_html_e( 'Blog', 'lsx' ); ?></h1> |
|
| 266 | + <h1 class="archive-title"><?php esc_html_e('Blog', 'lsx'); ?></h1> |
|
| 267 | 267 | </header> |
| 268 | 268 | |
| 269 | 269 | </div> |
| 270 | 270 | <?php |
| 271 | - elseif ( ! is_singular( 'post' ) ) : |
|
| 271 | + elseif ( ! is_singular('post')) : |
|
| 272 | 272 | // Display only the breadcrumbs. |
| 273 | 273 | ?> |
| 274 | - <div class="archive-header-wrapper banner-singular col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 274 | + <div class="archive-header-wrapper banner-singular col-<?php echo esc_attr($size); ?>-12"> |
|
| 275 | 275 | <?php lsx_global_header_inner_bottom(); ?> |
| 276 | 276 | </div> |
| 277 | 277 | <?php |
| 278 | - elseif ( ( true === apply_filters( 'lsx_global_header_disable', false ) ) && ( ! is_search() ) ) : |
|
| 278 | + elseif ((true === apply_filters('lsx_global_header_disable', false)) && ( ! is_search())) : |
|
| 279 | 279 | // Display only the breadcrumbs. |
| 280 | 280 | ?> |
| 281 | - <div class="archive-header-wrapper banner-global col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 281 | + <div class="archive-header-wrapper banner-global col-<?php echo esc_attr($size); ?>-12"> |
|
| 282 | 282 | <?php lsx_global_header_inner_bottom(); ?> |
| 283 | 283 | </div> |
| 284 | 284 | <?php |
| 285 | 285 | endif; |
| 286 | 286 | } |
| 287 | - add_action( 'lsx_content_wrap_before', 'lsx_global_header' ); |
|
| 287 | + add_action('lsx_content_wrap_before', 'lsx_global_header'); |
|
| 288 | 288 | endif; |
| 289 | 289 | |
| 290 | -if ( ! function_exists( 'lsx_author_extra_info' ) ) : |
|
| 290 | +if ( ! function_exists('lsx_author_extra_info')) : |
|
| 291 | 291 | /** |
| 292 | 292 | * Displays the author extra info. |
| 293 | 293 | * |
@@ -296,83 +296,83 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | function lsx_author_extra_info() { |
| 298 | 298 | $default_size = 'sm'; |
| 299 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
| 299 | + $size = apply_filters('lsx_bootstrap_column_size', $default_size); |
|
| 300 | 300 | |
| 301 | - if ( is_author() ) : |
|
| 302 | - $author_id = get_the_author_meta( 'ID' ); |
|
| 301 | + if (is_author()) : |
|
| 302 | + $author_id = get_the_author_meta('ID'); |
|
| 303 | 303 | $author = get_the_author(); |
| 304 | - $author_avatar = get_avatar( $author_id, 400 ); |
|
| 304 | + $author_avatar = get_avatar($author_id, 400); |
|
| 305 | 305 | $author_bio = get_the_archive_description(); |
| 306 | - $author_url = get_the_author_meta( 'url', $author_id ); |
|
| 307 | - $author_email = get_the_author_meta( 'email', $author_id ); |
|
| 308 | - $author_facebook = get_the_author_meta( 'facebook', $author_id ); |
|
| 309 | - $author_linkedin = get_the_author_meta( 'linkedin', $author_id ); |
|
| 310 | - $author_twitter = get_the_author_meta( 'twitter', $author_id ); |
|
| 311 | - $author_googleplus = get_the_author_meta( 'googleplus', $author_id ); |
|
| 306 | + $author_url = get_the_author_meta('url', $author_id); |
|
| 307 | + $author_email = get_the_author_meta('email', $author_id); |
|
| 308 | + $author_facebook = get_the_author_meta('facebook', $author_id); |
|
| 309 | + $author_linkedin = get_the_author_meta('linkedin', $author_id); |
|
| 310 | + $author_twitter = get_the_author_meta('twitter', $author_id); |
|
| 311 | + $author_googleplus = get_the_author_meta('googleplus', $author_id); |
|
| 312 | 312 | ?> |
| 313 | - <div class="col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 313 | + <div class="col-<?php echo esc_attr($size); ?>-12"> |
|
| 314 | 314 | <div class="archive-author-data"> |
| 315 | 315 | <div class="row"> |
| 316 | - <?php if ( ! empty( $author_avatar ) ) : ?> |
|
| 316 | + <?php if ( ! empty($author_avatar)) : ?> |
|
| 317 | 317 | <div class="col-xs-12 col-sm-4 col-md-3"> |
| 318 | - <figure class="archive-author-avatar"><?php echo wp_kses_post( $author_avatar ); ?></figure> |
|
| 318 | + <figure class="archive-author-avatar"><?php echo wp_kses_post($author_avatar); ?></figure> |
|
| 319 | 319 | </div> |
| 320 | 320 | <?php endif; ?> |
| 321 | 321 | <div class="col-xs-12 col-sm-8 col-md-9"> |
| 322 | - <a class="back-to-blog" href="<?php echo ( esc_url( get_post_type_archive_link( 'post' ) ) ); ?>"><?php echo esc_html__( 'Back To Blog', 'lsx' ); ?></a> |
|
| 322 | + <a class="back-to-blog" href="<?php echo (esc_url(get_post_type_archive_link('post'))); ?>"><?php echo esc_html__('Back To Blog', 'lsx'); ?></a> |
|
| 323 | 323 | <!-- Name --> |
| 324 | 324 | <h2 class="archive-author-title"> |
| 325 | 325 | <?php |
| 326 | - if ( '' !== $author ) { |
|
| 327 | - echo esc_html( $author ); |
|
| 326 | + if ('' !== $author) { |
|
| 327 | + echo esc_html($author); |
|
| 328 | 328 | } |
| 329 | 329 | ?> |
| 330 | 330 | </h2> |
| 331 | 331 | <!-- Social --> |
| 332 | - <?php if ( ! empty( $author_url ) || ! empty( $author_email ) || ! empty( $author_facebook ) || ! empty( $author_twitter ) || ! empty( $author_googleplus ) ) : ?> |
|
| 332 | + <?php if ( ! empty($author_url) || ! empty($author_email) || ! empty($author_facebook) || ! empty($author_twitter) || ! empty($author_googleplus)) : ?> |
|
| 333 | 333 | <div class="archive-author-social-links"> |
| 334 | - <?php if ( ! empty( $author_url ) ) : ?> |
|
| 335 | - <a href="<?php echo esc_url( $author_url ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-url"><i class="fa fa-link" aria-hidden="true"></i></a> |
|
| 334 | + <?php if ( ! empty($author_url)) : ?> |
|
| 335 | + <a href="<?php echo esc_url($author_url); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-url"><i class="fa fa-link" aria-hidden="true"></i></a> |
|
| 336 | 336 | <?php endif; ?> |
| 337 | 337 | |
| 338 | - <?php if ( ! empty( $author_email ) ) : ?> |
|
| 339 | - <a href="mailto:<?php echo esc_attr( $author_email ); ?>" class="archive-author-social-link archive-author-social-link-email"><i class="fa fa-envelope" aria-hidden="true"></i></a> |
|
| 338 | + <?php if ( ! empty($author_email)) : ?> |
|
| 339 | + <a href="mailto:<?php echo esc_attr($author_email); ?>" class="archive-author-social-link archive-author-social-link-email"><i class="fa fa-envelope" aria-hidden="true"></i></a> |
|
| 340 | 340 | <?php endif; ?> |
| 341 | 341 | |
| 342 | - <?php if ( ! empty( $author_facebook ) ) : ?> |
|
| 343 | - <a href="<?php echo esc_url( $author_facebook ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a> |
|
| 342 | + <?php if ( ! empty($author_facebook)) : ?> |
|
| 343 | + <a href="<?php echo esc_url($author_facebook); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a> |
|
| 344 | 344 | <?php endif; ?> |
| 345 | 345 | |
| 346 | - <?php if ( ! empty( $author_twitter ) ) : ?> |
|
| 347 | - <a href="https://twitter.com/<?php echo esc_attr( $author_twitter ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> |
|
| 346 | + <?php if ( ! empty($author_twitter)) : ?> |
|
| 347 | + <a href="https://twitter.com/<?php echo esc_attr($author_twitter); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> |
|
| 348 | 348 | <?php endif; ?> |
| 349 | 349 | |
| 350 | - <?php if ( ! empty( $author_linkedin ) ) : ?> |
|
| 351 | - <a href="<?php echo esc_url( $author_linkedin ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a> |
|
| 350 | + <?php if ( ! empty($author_linkedin)) : ?> |
|
| 351 | + <a href="<?php echo esc_url($author_linkedin); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a> |
|
| 352 | 352 | <?php endif; ?> |
| 353 | 353 | |
| 354 | - <?php if ( ! empty( $author_googleplus ) ) : ?> |
|
| 355 | - <a href="<?php echo esc_url( $author_googleplus ); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-googleplus"><i class="fa fa-google-plus" aria-hidden="true"></i></a> |
|
| 354 | + <?php if ( ! empty($author_googleplus)) : ?> |
|
| 355 | + <a href="<?php echo esc_url($author_googleplus); ?>" target="_blank" rel="nofollow noreferrer noopener" class="archive-author-social-link archive-author-social-link-googleplus"><i class="fa fa-google-plus" aria-hidden="true"></i></a> |
|
| 356 | 356 | <?php endif; ?> |
| 357 | 357 | </div> |
| 358 | 358 | <?php endif; ?> |
| 359 | 359 | |
| 360 | 360 | <!-- Bio --> |
| 361 | - <?php if ( ! empty( $author_bio ) ) : ?> |
|
| 362 | - <p class="archive-author-bio"><?php echo wp_kses_post( $author_bio ); ?></p> |
|
| 361 | + <?php if ( ! empty($author_bio)) : ?> |
|
| 362 | + <p class="archive-author-bio"><?php echo wp_kses_post($author_bio); ?></p> |
|
| 363 | 363 | <?php endif; ?> |
| 364 | 364 | </div> |
| 365 | 365 | </div> |
| 366 | 366 | </div> |
| 367 | - <h2><?php echo esc_html__( 'Posts', 'lsx' ); ?></h2> |
|
| 367 | + <h2><?php echo esc_html__('Posts', 'lsx'); ?></h2> |
|
| 368 | 368 | </div> |
| 369 | 369 | <?php |
| 370 | 370 | endif; |
| 371 | 371 | } |
| 372 | - add_action( 'lsx_content_wrap_before', 'lsx_author_extra_info', 11 ); |
|
| 372 | + add_action('lsx_content_wrap_before', 'lsx_author_extra_info', 11); |
|
| 373 | 373 | endif; |
| 374 | 374 | |
| 375 | -if ( ! function_exists( 'lsx_post_header' ) ) : |
|
| 375 | +if ( ! function_exists('lsx_post_header')) : |
|
| 376 | 376 | /** |
| 377 | 377 | * Displays the post header. |
| 378 | 378 | * |
@@ -381,21 +381,21 @@ discard block |
||
| 381 | 381 | */ |
| 382 | 382 | function lsx_post_header() { |
| 383 | 383 | $default_size = 'sm'; |
| 384 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
| 384 | + $size = apply_filters('lsx_bootstrap_column_size', $default_size); |
|
| 385 | 385 | |
| 386 | - if ( is_singular( 'post' ) ) : |
|
| 386 | + if (is_singular('post')) : |
|
| 387 | 387 | $format = get_post_format(); |
| 388 | 388 | |
| 389 | - if ( false === $format ) { |
|
| 389 | + if (false === $format) { |
|
| 390 | 390 | $format = 'standard'; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - $format = lsx_translate_format_to_fontawesome( $format ); |
|
| 393 | + $format = lsx_translate_format_to_fontawesome($format); |
|
| 394 | 394 | ?> |
| 395 | - <div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr( $size ); ?>-12"> |
|
| 395 | + <div class="archive-header-wrapper banner-post-header col-<?php echo esc_attr($size); ?>-12"> |
|
| 396 | 396 | <header class="archive-header"> |
| 397 | 397 | <h1 class="archive-title"> |
| 398 | - <i class="format-link fa fa-<?php echo esc_attr( $format ); ?>"></i> |
|
| 398 | + <i class="format-link fa fa-<?php echo esc_attr($format); ?>"></i> |
|
| 399 | 399 | <span><?php the_title(); ?></span> |
| 400 | 400 | </h1> |
| 401 | 401 | </header> |
@@ -403,10 +403,10 @@ discard block |
||
| 403 | 403 | <?php |
| 404 | 404 | endif; |
| 405 | 405 | } |
| 406 | - add_action( 'lsx_entry_top', 'lsx_post_header' ); |
|
| 406 | + add_action('lsx_entry_top', 'lsx_post_header'); |
|
| 407 | 407 | endif; |
| 408 | 408 | |
| 409 | -if ( ! function_exists( 'lsx_add_viewport_meta_tag' ) ) : |
|
| 409 | +if ( ! function_exists('lsx_add_viewport_meta_tag')) : |
|
| 410 | 410 | /** |
| 411 | 411 | * Add Viewport Meta Tag to head. |
| 412 | 412 | * |
@@ -418,10 +418,10 @@ discard block |
||
| 418 | 418 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"> |
| 419 | 419 | <?php |
| 420 | 420 | } |
| 421 | - add_action( 'wp_head', 'lsx_add_viewport_meta_tag' ); |
|
| 421 | + add_action('wp_head', 'lsx_add_viewport_meta_tag'); |
|
| 422 | 422 | endif; |
| 423 | 423 | |
| 424 | -if ( ! function_exists( 'lsx_header_search_form' ) ) : |
|
| 424 | +if ( ! function_exists('lsx_header_search_form')) : |
|
| 425 | 425 | /** |
| 426 | 426 | * Add a search form to just above the nav menu. |
| 427 | 427 | * |
@@ -429,20 +429,20 @@ discard block |
||
| 429 | 429 | * @subpackage layout |
| 430 | 430 | */ |
| 431 | 431 | function lsx_header_search_form() { |
| 432 | - $search_form = get_theme_mod( 'lsx_header_search', false ); |
|
| 432 | + $search_form = get_theme_mod('lsx_header_search', false); |
|
| 433 | 433 | |
| 434 | - if ( false !== $search_form || is_customize_preview() ) { |
|
| 435 | - get_search_form( true ); |
|
| 434 | + if (false !== $search_form || is_customize_preview()) { |
|
| 435 | + get_search_form(true); |
|
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | - $mobile_header_layout = get_theme_mod( 'lsx_header_mobile_layout', 'navigation-bar' ); |
|
| 439 | - add_action( 'lsx_nav_before', 'lsx_header_search_form', 0 ); |
|
| 438 | + $mobile_header_layout = get_theme_mod('lsx_header_mobile_layout', 'navigation-bar'); |
|
| 439 | + add_action('lsx_nav_before', 'lsx_header_search_form', 0); |
|
| 440 | 440 | endif; |
| 441 | 441 | |
| 442 | 442 | // Add entry meta to single post if active. |
| 443 | -if ( ! function_exists( 'lsx_add_entry_meta' ) ) : |
|
| 443 | +if ( ! function_exists('lsx_add_entry_meta')) : |
|
| 444 | 444 | function lsx_add_entry_meta() { |
| 445 | - if ( is_single() && is_singular( 'post' ) ) { |
|
| 445 | + if (is_single() && is_singular('post')) { |
|
| 446 | 446 | ?> |
| 447 | 447 | <div class="entry-meta"> |
| 448 | 448 | <?php lsx_post_meta_single_top(); ?> |
@@ -450,5 +450,5 @@ discard block |
||
| 450 | 450 | <?php |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | - add_action( 'lsx_entry_top', 'lsx_add_entry_meta', 999 ); |
|
| 453 | + add_action('lsx_entry_top', 'lsx_add_entry_meta', 999); |
|
| 454 | 454 | endif; |
@@ -22,74 +22,74 @@ discard block |
||
| 22 | 22 | <ul class="lsx-wc-checkout-steps-items"> |
| 23 | 23 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done"> |
| 24 | 24 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
| 25 | - <span><span><?php esc_html_e( 'Shop', 'lsx' ); ?></span></span> |
|
| 25 | + <span><span><?php esc_html_e('Shop', 'lsx'); ?></span></span> |
|
| 26 | 26 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
| 27 | 27 | </li> |
| 28 | 28 | |
| 29 | 29 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done lsx-wc-checkout-steps-item-cart"> |
| 30 | 30 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
| 31 | - <span><span><?php esc_html_e( 'My Cart', 'lsx' ); ?></span></span> |
|
| 31 | + <span><span><?php esc_html_e('My Cart', 'lsx'); ?></span></span> |
|
| 32 | 32 | </li> |
| 33 | 33 | |
| 34 | 34 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done lsx-wc-checkout-steps-item-payment"> |
| 35 | 35 | <i class="fa fa-check-circle" aria-hidden="true"></i> |
| 36 | - <span><span><?php esc_html_e( 'Billing details', 'lsx' ); ?></span></span> |
|
| 36 | + <span><span><?php esc_html_e('Billing details', 'lsx'); ?></span></span> |
|
| 37 | 37 | <i class="fa fa-angle-right" aria-hidden="true"></i> |
| 38 | 38 | </li> |
| 39 | 39 | |
| 40 | 40 | <li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-current lsx-wc-checkout-steps-item-thankyou"> |
| 41 | - <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '4', 'lsx' ); ?></i> |
|
| 42 | - <span><span><?php esc_html_e( 'Payment', 'lsx' ); ?></span></span> |
|
| 41 | + <i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('4', 'lsx'); ?></i> |
|
| 42 | + <span><span><?php esc_html_e('Payment', 'lsx'); ?></span></span> |
|
| 43 | 43 | </li> |
| 44 | 44 | </ul> |
| 45 | 45 | </div> |
| 46 | 46 | |
| 47 | 47 | <?php lsx_content_top(); ?> |
| 48 | 48 | |
| 49 | - <?php if ( have_posts() ) : ?> |
|
| 49 | + <?php if (have_posts()) : ?> |
|
| 50 | 50 | |
| 51 | 51 | <?php |
| 52 | - while ( have_posts() ) : |
|
| 52 | + while (have_posts()) : |
|
| 53 | 53 | the_post(); |
| 54 | 54 | ?> |
| 55 | 55 | |
| 56 | 56 | <?php |
| 57 | 57 | WC()->payment_gateways()->payment_gateways; |
| 58 | - $order_key = isset( $_GET['key'] ) ? wc_clean( $_GET['key'] ) : ''; |
|
| 59 | - $order_id = absint( $wp->query_vars['order-received'] ); |
|
| 60 | - $order = wc_get_order( $order_id ); |
|
| 58 | + $order_key = isset($_GET['key']) ? wc_clean($_GET['key']) : ''; |
|
| 59 | + $order_id = absint($wp->query_vars['order-received']); |
|
| 60 | + $order = wc_get_order($order_id); |
|
| 61 | 61 | ?> |
| 62 | 62 | |
| 63 | - <?php if ( $order && $order->get_id() === $order_id && $order->get_order_key() === $order_key ) : ?> |
|
| 63 | + <?php if ($order && $order->get_id() === $order_id && $order->get_order_key() === $order_key) : ?> |
|
| 64 | 64 | |
| 65 | 65 | <?php // @codingStandardsIgnoreStart ?> |
| 66 | 66 | |
| 67 | - <div class="alert alert-success"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'lsx' ), $order ); ?></div> |
|
| 67 | + <div class="alert alert-success"><?php echo apply_filters('woocommerce_thankyou_order_received_text', esc_html__('Thank you. Your order has been received.', 'lsx'), $order); ?></div> |
|
| 68 | 68 | |
| 69 | 69 | <div class="row"> |
| 70 | 70 | <div class="col-xs-12 col-sm-6"> |
| 71 | - <h2><?php esc_html_e( 'Order Details', 'lsx' ); ?></h2> |
|
| 71 | + <h2><?php esc_html_e('Order Details', 'lsx'); ?></h2> |
|
| 72 | 72 | |
| 73 | 73 | <table class="table"> |
| 74 | 74 | <tbody> |
| 75 | 75 | <tr> |
| 76 | - <th><?php esc_html_e( 'Order:', 'lsx' ); ?></th> |
|
| 76 | + <th><?php esc_html_e('Order:', 'lsx'); ?></th> |
|
| 77 | 77 | <td><?php echo $order->get_order_number(); ?></td> |
| 78 | 78 | </tr> |
| 79 | 79 | |
| 80 | 80 | <tr> |
| 81 | - <th><?php esc_html_e( 'Date:', 'lsx' ); ?></th> |
|
| 82 | - <td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></td> |
|
| 81 | + <th><?php esc_html_e('Date:', 'lsx'); ?></th> |
|
| 82 | + <td><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></td> |
|
| 83 | 83 | </tr> |
| 84 | 84 | |
| 85 | 85 | <tr> |
| 86 | - <th><?php esc_html_e( 'Total:', 'lsx' ); ?></th> |
|
| 86 | + <th><?php esc_html_e('Total:', 'lsx'); ?></th> |
|
| 87 | 87 | <td><?php echo $order->get_formatted_order_total(); ?></td> |
| 88 | 88 | </tr> |
| 89 | 89 | |
| 90 | - <?php if ( $order->payment_method_title ) : ?> |
|
| 90 | + <?php if ($order->payment_method_title) : ?> |
|
| 91 | 91 | <tr> |
| 92 | - <th><?php esc_html_e( 'Payment method:', 'lsx' ); ?></th> |
|
| 92 | + <th><?php esc_html_e('Payment method:', 'lsx'); ?></th> |
|
| 93 | 93 | <td><?php echo $order->payment_method_title; ?></td> |
| 94 | 94 | </tr> |
| 95 | 95 | <?php endif; ?> |
@@ -98,48 +98,48 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | <?php // do_action( 'woocommerce_order_details_after_order_table', $order ); ?> |
| 100 | 100 | |
| 101 | - <h2><?php esc_html_e( 'Customer details', 'lsx' ); ?></h2> |
|
| 101 | + <h2><?php esc_html_e('Customer details', 'lsx'); ?></h2> |
|
| 102 | 102 | |
| 103 | 103 | <dl class="customer_details"> |
| 104 | 104 | <?php |
| 105 | - if ( $order->billing_email ) echo '<dt>' . esc_html__( 'Email:', 'lsx' ) . '</dt><dd>' . $order->billing_email . '</dd>'; |
|
| 106 | - if ( $order->billing_phone ) echo '<dt>' . esc_html__( 'Telephone:', 'lsx' ) . '</dt><dd>' . $order->billing_phone . '</dd>'; |
|
| 105 | + if ($order->billing_email) echo '<dt>' . esc_html__('Email:', 'lsx') . '</dt><dd>' . $order->billing_email . '</dd>'; |
|
| 106 | + if ($order->billing_phone) echo '<dt>' . esc_html__('Telephone:', 'lsx') . '</dt><dd>' . $order->billing_phone . '</dd>'; |
|
| 107 | 107 | |
| 108 | 108 | // Additional customer details hook |
| 109 | - do_action( 'woocommerce_order_details_after_customer_details', $order ); |
|
| 109 | + do_action('woocommerce_order_details_after_customer_details', $order); |
|
| 110 | 110 | ?> |
| 111 | 111 | </dl> |
| 112 | 112 | |
| 113 | - <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?> |
|
| 113 | + <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option('woocommerce_calc_shipping') !== 'no') : ?> |
|
| 114 | 114 | |
| 115 | 115 | <div class="row"> |
| 116 | 116 | <div class="col-xs-12 col-sm-6"> |
| 117 | 117 | |
| 118 | 118 | <?php endif; ?> |
| 119 | 119 | |
| 120 | - <h3><?php esc_html_e( 'Billing Address', 'lsx' ); ?></h3> |
|
| 120 | + <h3><?php esc_html_e('Billing Address', 'lsx'); ?></h3> |
|
| 121 | 121 | |
| 122 | 122 | <address> |
| 123 | 123 | <?php |
| 124 | - if ( ! $order->get_formatted_billing_address() ) { |
|
| 125 | - esc_html_e( 'N/A', 'lsx' ); |
|
| 124 | + if ( ! $order->get_formatted_billing_address()) { |
|
| 125 | + esc_html_e('N/A', 'lsx'); |
|
| 126 | 126 | } else { |
| 127 | 127 | echo $order->get_formatted_billing_address(); |
| 128 | 128 | } |
| 129 | 129 | ?> |
| 130 | 130 | </address> |
| 131 | 131 | |
| 132 | - <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?> |
|
| 132 | + <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option('woocommerce_calc_shipping') !== 'no') : ?> |
|
| 133 | 133 | |
| 134 | 134 | </div> |
| 135 | 135 | |
| 136 | 136 | <div class="col-xs-12 col-sm-6"> |
| 137 | - <h3><?php esc_html_e( 'Shipping Address', 'lsx' ); ?></h3> |
|
| 137 | + <h3><?php esc_html_e('Shipping Address', 'lsx'); ?></h3> |
|
| 138 | 138 | |
| 139 | 139 | <address> |
| 140 | 140 | <?php |
| 141 | - if ( ! $order->get_formatted_shipping_address() ) { |
|
| 142 | - esc_html_e( 'N/A', 'lsx' ); |
|
| 141 | + if ( ! $order->get_formatted_shipping_address()) { |
|
| 142 | + esc_html_e('N/A', 'lsx'); |
|
| 143 | 143 | } else { |
| 144 | 144 | echo $order->get_formatted_shipping_address(); |
| 145 | 145 | } |
@@ -152,68 +152,68 @@ discard block |
||
| 152 | 152 | </div> |
| 153 | 153 | |
| 154 | 154 | <div class="col-xs-12 col-sm-6"> |
| 155 | - <h2><?php esc_html_e( 'Products details', 'lsx' ); ?></h2> |
|
| 155 | + <h2><?php esc_html_e('Products details', 'lsx'); ?></h2> |
|
| 156 | 156 | |
| 157 | 157 | <table class="table"> |
| 158 | 158 | <thead> |
| 159 | 159 | <tr> |
| 160 | - <th><?php esc_html_e( 'Product', 'lsx' ); ?></th> |
|
| 161 | - <th><?php esc_html_e( 'Total', 'lsx' ); ?></th> |
|
| 160 | + <th><?php esc_html_e('Product', 'lsx'); ?></th> |
|
| 161 | + <th><?php esc_html_e('Total', 'lsx'); ?></th> |
|
| 162 | 162 | </tr> |
| 163 | 163 | </thead> |
| 164 | 164 | |
| 165 | 165 | <tbody> |
| 166 | 166 | <?php |
| 167 | - if ( sizeof( $order->get_items() ) > 0 ) : |
|
| 168 | - foreach( $order->get_items() as $item ) : |
|
| 169 | - $_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item ); |
|
| 170 | - $item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product ); |
|
| 167 | + if (sizeof($order->get_items()) > 0) : |
|
| 168 | + foreach ($order->get_items() as $item) : |
|
| 169 | + $_product = apply_filters('woocommerce_order_item_product', $order->get_product_from_item($item), $item); |
|
| 170 | + $item_meta = new WC_Order_Item_Meta($item['item_meta'], $_product); |
|
| 171 | 171 | ?> |
| 172 | 172 | |
| 173 | 173 | <tr> |
| 174 | 174 | <td> |
| 175 | 175 | <?php |
| 176 | - if ( $_product && ! $_product->is_visible() ) { |
|
| 177 | - echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item ); |
|
| 176 | + if ($_product && ! $_product->is_visible()) { |
|
| 177 | + echo apply_filters('woocommerce_order_item_name', $item['name'], $item); |
|
| 178 | 178 | } else { |
| 179 | - echo apply_filters( 'woocommerce_order_item_name', sprintf( '<a href="%s">%s</a>', get_permalink( $item['product_id'] ), $item['name'] ), $item ); |
|
| 179 | + echo apply_filters('woocommerce_order_item_name', sprintf('<a href="%s">%s</a>', get_permalink($item['product_id']), $item['name']), $item); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '× %s', $item['qty'] ) . '</strong>', $item ); |
|
| 182 | + echo apply_filters('woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf('× %s', $item['qty']) . '</strong>', $item); |
|
| 183 | 183 | |
| 184 | 184 | ob_start(); |
| 185 | 185 | $item_meta->display(); |
| 186 | 186 | $_item_meta = ob_get_clean(); |
| 187 | 187 | |
| 188 | - if ( ! empty( $_item_meta ) ) { |
|
| 188 | + if ( ! empty($_item_meta)) { |
|
| 189 | 189 | echo $_item_meta; |
| 190 | 190 | } else { |
| 191 | 191 | echo '<br>'; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - if ( $_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted() ) { |
|
| 195 | - $download_files = $order->get_item_downloads( $item ); |
|
| 194 | + if ($_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted()) { |
|
| 195 | + $download_files = $order->get_item_downloads($item); |
|
| 196 | 196 | $i = 0; |
| 197 | 197 | $links = array(); |
| 198 | 198 | |
| 199 | - if ( empty( $download_files ) ) { |
|
| 199 | + if (empty($download_files)) { |
|
| 200 | 200 | $download_files = $_product->get_files(); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - foreach ( $download_files as $download_id => $file ) { |
|
| 203 | + foreach ($download_files as $download_id => $file) { |
|
| 204 | 204 | ++$i; |
| 205 | 205 | |
| 206 | - if ( $i > 1 ) { |
|
| 206 | + if ($i > 1) { |
|
| 207 | 207 | echo '<br>'; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if ( ! empty( $_item_meta ) ) { |
|
| 210 | + if ( ! empty($_item_meta)) { |
|
| 211 | 211 | echo '<span style="margin-top: -2.4rem; display: block;">'; |
| 212 | 212 | } else { |
| 213 | 213 | echo '<span>'; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - echo '<a href="' . esc_url( $file['download_url'] ? $file['download_url'] : $file['file'] ) . '">' . sprintf( esc_html__( 'Download file%s', 'lsx' ), ( count( $download_files ) > 1 ? ' ' . $i . ': ' : ': ' ) ) . esc_html( $file['name'] ) . '</a>'; |
|
| 216 | + echo '<a href="' . esc_url($file['download_url'] ? $file['download_url'] : $file['file']) . '">' . sprintf(esc_html__('Download file%s', 'lsx'), (count($download_files) > 1 ? ' ' . $i . ': ' : ': ')) . esc_html($file['name']) . '</a>'; |
|
| 217 | 217 | echo '</span>'; |
| 218 | 218 | } |
| 219 | 219 | } |
@@ -221,15 +221,15 @@ discard block |
||
| 221 | 221 | </td> |
| 222 | 222 | |
| 223 | 223 | <td> |
| 224 | - <?php echo $order->get_formatted_line_subtotal( $item ); ?> |
|
| 224 | + <?php echo $order->get_formatted_line_subtotal($item); ?> |
|
| 225 | 225 | </td> |
| 226 | 226 | </tr> |
| 227 | 227 | |
| 228 | 228 | <?php |
| 229 | - if ( $order->has_status( array( 'completed', 'processing' ) ) && ( $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) ) { |
|
| 229 | + if ($order->has_status(array('completed', 'processing')) && ($purchase_note = get_post_meta($_product->id, '_purchase_note', true))) { |
|
| 230 | 230 | ?> |
| 231 | 231 | <tr class="product-purchase-note"> |
| 232 | - <td colspan="3"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td> |
|
| 232 | + <td colspan="3"><?php echo wpautop(do_shortcode(wp_kses_post($purchase_note))); ?></td> |
|
| 233 | 233 | </tr> |
| 234 | 234 | <?php |
| 235 | 235 | } |
@@ -242,8 +242,8 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | <tfoot> |
| 244 | 244 | <?php |
| 245 | - if ( $totals = $order->get_order_item_totals() ) : |
|
| 246 | - foreach ( $totals as $total ) : |
|
| 245 | + if ($totals = $order->get_order_item_totals()) : |
|
| 246 | + foreach ($totals as $total) : |
|
| 247 | 247 | ?> |
| 248 | 248 | <tr> |
| 249 | 249 | <th scope="row"><?php echo $total['label']; ?></th> |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | </tfoot> |
| 257 | 257 | </table> |
| 258 | 258 | |
| 259 | - <?php if ( 'bacs' === $order->get_payment_method() ) { ?> |
|
| 260 | - <h2><?php esc_html_e( 'Bank Details', 'lsx' ); ?></h2> |
|
| 261 | - <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?> |
|
| 259 | + <?php if ('bacs' === $order->get_payment_method()) { ?> |
|
| 260 | + <h2><?php esc_html_e('Bank Details', 'lsx'); ?></h2> |
|
| 261 | + <?php do_action('woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id()); ?> |
|
| 262 | 262 | <?php } ?> |
| 263 | 263 | </div> |
| 264 | 264 | </div> |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | <?php else : ?> |
| 269 | 269 | |
| 270 | - <div class="alert alert-danger"><?php esc_html_e( 'Invalid order.', 'lsx' ); ?></div> |
|
| 270 | + <div class="alert alert-danger"><?php esc_html_e('Invalid order.', 'lsx'); ?></div> |
|
| 271 | 271 | |
| 272 | 272 | <?php endif; ?> |
| 273 | 273 | |