Passed
Push — master ( 689fa7...f96565 )
by Fernando
02:57
created
inc/scripts.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly
2
+if ( ! defined('ABSPATH')) return; // Exit if accessed directly
3 3
 
4 4
 /**
5 5
  * Enqueue scripts and styles.
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
 	
13 13
 	wp_enqueue_style('lsx_main_style', get_template_directory_uri() . '/style.css', array(), LSX_VERSION);
14 14
 	
15
-	wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', array( 'lsx_main_style', 'fontawesome', 'medium-break' ), LSX_VERSION);
15
+	wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', array('lsx_main_style', 'fontawesome', 'medium-break'), LSX_VERSION);
16 16
 	
17
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
18
-		wp_enqueue_script( 'comment-reply' );
17
+	if (is_singular() && comments_open() && get_option('thread_comments')) {
18
+		wp_enqueue_script('comment-reply');
19 19
 	}
20 20
 
21 21
 	wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, false);
@@ -26,31 +26,31 @@  discard block
 block discarded – undo
26 26
 	wp_enqueue_script('picturefill', get_template_directory_uri() . '/js/vendor/picturefill.min.js', array(), LSX_VERSION, false);
27 27
 
28 28
 	wp_enqueue_script('masonry');
29
-	wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry'), LSX_VERSION);	
30
-	if(defined('WP_DEBUG') && true === WP_DEBUG){
29
+	wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/js/vendor/imagesloaded.pkgd.min.js', array('jquery', 'masonry'), LSX_VERSION);	
30
+	if (defined('WP_DEBUG') && true === WP_DEBUG) {
31 31
 		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), LSX_VERSION, false);
32
-	}else{
32
+	} else {
33 33
 		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), LSX_VERSION, false);
34 34
 	}
35 35
 	
36 36
 	//Set some parameters that we can use in the JS
37 37
 	$is_portfolio = false;
38
-	if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')){
38
+	if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')) {
39 39
 		$is_portfolio = true;
40 40
 	}
41 41
 	$param_array = array(
42 42
 			'is_portfolio' => $is_portfolio
43 43
 	);
44 44
 	//Set the columns for the archives
45
-	$param_array['columns'] = apply_filters('lsx_archive_column_number',3);
46
-	wp_localize_script( 'lsx_script', 'lsx_params', $param_array );
45
+	$param_array['columns'] = apply_filters('lsx_archive_column_number', 3);
46
+	wp_localize_script('lsx_script', 'lsx_params', $param_array);
47 47
 
48
-	wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION );
48
+	wp_enqueue_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION);
49 49
 	
50 50
 	wp_enqueue_style('medium-break', get_template_directory_uri() . '/css/medium-nav-break.css', array(), LSX_VERSION);
51 51
 	
52
-	$font = get_theme_mod('lsx_font','raleway_open_sans');
53
-	switch($font){
52
+	$font = get_theme_mod('lsx_font', 'raleway_open_sans');
53
+	switch ($font) {
54 54
 		case 'raleway_open_sans':
55 55
 			$header_font_location = 'Raleway';
56 56
 			$body_font_location = 'Open+Sans';
@@ -79,18 +79,18 @@  discard block
 block discarded – undo
79 79
 	}
80 80
 	
81 81
 	$http_var = 'http';
82
-	if(is_ssl()){ $http_var .= 's'; }
82
+	if (is_ssl()) { $http_var .= 's'; }
83 83
 	
84 84
 	//Call the Google Fonts and then Enque them.
85
-	wp_register_style('lsx-header-font', $http_var.'://fonts.googleapis.com/css?family='.$header_font_location);
86
-	wp_register_style('lsx-body-font', $http_var.'://fonts.googleapis.com/css?family='.$body_font_location);
87
-	wp_enqueue_style( 'lsx-header-font' );
88
-	wp_enqueue_style( 'lsx-body-font' );
85
+	wp_register_style('lsx-header-font', $http_var . '://fonts.googleapis.com/css?family=' . $header_font_location);
86
+	wp_register_style('lsx-body-font', $http_var . '://fonts.googleapis.com/css?family=' . $body_font_location);
87
+	wp_enqueue_style('lsx-header-font');
88
+	wp_enqueue_style('lsx-body-font');
89 89
 	
90
-	wp_enqueue_style('lsx_font_scheme', esc_url( get_template_directory_uri() . '/css/'.$font.'.css' ), array(), LSX_VERSION);
90
+	wp_enqueue_style('lsx_font_scheme', esc_url(get_template_directory_uri() . '/css/' . $font . '.css'), array(), LSX_VERSION);
91 91
 	
92 92
 }
93
-add_action( 'wp_enqueue_scripts', 'lsx_scripts' );
93
+add_action('wp_enqueue_scripts', 'lsx_scripts');
94 94
 
95 95
 /**
96 96
  * Enqueue scripts and styles (for child theme).
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
  */
101 101
 function lsx_scripts_child_theme() {
102 102
 	global $content_width;
103
-	if(is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) {
104
-		wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/custom.css', array( 'lsx_main' ), LSX_VERSION );
103
+	if (is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) {
104
+		wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/custom.css', array('lsx_main'), LSX_VERSION);
105 105
 	}
106 106
 }
107
-add_action( 'wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999 );
107
+add_action('wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999);
108 108
 
109 109
 /**
110 110
  * Defer JavaScript
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
  * @package 	lsx
113 113
  * @subpackage	scripts
114 114
  */
115
-function lsx_scripts_defer_parsing( $url ) {
116
-	if ( ! ( is_admin() ) ) {
117
-		if ( FALSE === strpos( $url, '.js' ) ) return $url;
118
-		if ( strpos( $url, 'jquery.js' ) ) return $url;
119
-		if ( strpos( $url, ' defer ' ) ) return $url;
115
+function lsx_scripts_defer_parsing($url) {
116
+	if ( ! (is_admin())) {
117
+		if (FALSE === strpos($url, '.js')) return $url;
118
+		if (strpos($url, 'jquery.js')) return $url;
119
+		if (strpos($url, ' defer ')) return $url;
120 120
 		return "$url' defer onload='";
121 121
 	}
122 122
 
123 123
 	return $url;
124 124
 }
125
-add_filter( 'clean_url', 'lsx_scripts_defer_parsing', 11, 1 );
125
+add_filter('clean_url', 'lsx_scripts_defer_parsing', 11, 1);
Please login to merge, or discard this patch.