Passed
Push — master ( 544ee1...3b57e0 )
by Warwick
02:30 queued 12s
created
includes/scripts.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
  * @subpackage scripts
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if ( ! defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13
-if ( ! function_exists( 'lsx_scripts' ) ) :
13
+if ( ! function_exists('lsx_scripts')) :
14 14
 
15 15
 	/**
16 16
 	 * Enqueue scripts, fonts and styles.
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
 endif;
28 28
 
29
-add_action( 'wp_enqueue_scripts', 'lsx_scripts', 5 );
29
+add_action('wp_enqueue_scripts', 'lsx_scripts', 5);
30 30
 
31
-if ( ! function_exists( 'lsx_admin_scripts' ) ) :
31
+if ( ! function_exists('lsx_admin_scripts')) :
32 32
 
33 33
 	/**
34 34
 	 * Enqueue scripts (admin).
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
 	 * @subpackage scripts
38 38
 	 */
39 39
 	function lsx_admin_scripts() {
40
-		wp_enqueue_script( 'lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array( 'jquery' ), LSX_VERSION, true );
40
+		wp_enqueue_script('lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array('jquery'), LSX_VERSION, true);
41 41
 	}
42 42
 
43 43
 endif;
44 44
 
45
-add_action( 'admin_enqueue_scripts', 'lsx_admin_scripts' );
45
+add_action('admin_enqueue_scripts', 'lsx_admin_scripts');
46 46
 
47
-if ( ! function_exists( 'lsx_scripts_add_styles' ) ) :
47
+if ( ! function_exists('lsx_scripts_add_styles')) :
48 48
 
49 49
 	/**
50 50
 	 * Enqueue styles.
@@ -53,23 +53,23 @@  discard block
 block discarded – undo
53 53
 	 * @subpackage scripts
54 54
 	 */
55 55
 	function lsx_scripts_add_styles() {
56
-		wp_enqueue_style( 'lsx_fonts', get_template_directory_uri() . '/assets/css/lsx-fonts.css', array(), LSX_VERSION );
56
+		wp_enqueue_style('lsx_fonts', get_template_directory_uri() . '/assets/css/lsx-fonts.css', array(), LSX_VERSION);
57 57
 
58
-		wp_register_style( 'fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION );
59
-		wp_style_add_data( 'fontawesome', 'rtl', 'replace' );
58
+		wp_register_style('fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION);
59
+		wp_style_add_data('fontawesome', 'rtl', 'replace');
60 60
 
61
-		wp_register_style( 'bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION );
62
-		wp_style_add_data( 'bootstrap', 'rtl', 'replace' );
61
+		wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION);
62
+		wp_style_add_data('bootstrap', 'rtl', 'replace');
63 63
 
64
-		wp_enqueue_style( 'lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array( 'lsx_fonts', 'fontawesome', 'bootstrap'/*, 'slick'*/ ), LSX_VERSION );
65
-		wp_enqueue_style( 'lsx_gutenberg', get_template_directory_uri() . '/assets/css/gutenberg.css', array( 'lsx_main' ), LSX_VERSION );
64
+		wp_enqueue_style('lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array('lsx_fonts', 'fontawesome', 'bootstrap'/*, 'slick'*/), LSX_VERSION);
65
+		wp_enqueue_style('lsx_gutenberg', get_template_directory_uri() . '/assets/css/gutenberg.css', array('lsx_main'), LSX_VERSION);
66 66
 
67
-		wp_style_add_data( 'lsx_main', 'rtl', 'replace' );
67
+		wp_style_add_data('lsx_main', 'rtl', 'replace');
68 68
 	}
69 69
 
70 70
 endif;
71 71
 
72
-if ( ! function_exists( 'lsx_scripts_add_fonts' ) ) :
72
+if ( ! function_exists('lsx_scripts_add_fonts')) :
73 73
 	/**
74 74
 	 * Enqueue fonts.
75 75
 	 *
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 	 * @subpackage scripts
78 78
 	 */
79 79
 	function lsx_scripts_add_fonts() {
80
-		$disable_fonts = get_theme_mod( 'lsx_disable_fonts', false );
81
-		if ( false !== $disable_fonts ) {
80
+		$disable_fonts = get_theme_mod('lsx_disable_fonts', false);
81
+		if (false !== $disable_fonts) {
82 82
 			return;
83 83
 		}
84 84
 	}
85 85
 endif;
86 86
 
87
-if ( ! function_exists( 'lsx_scripts_add_scripts' ) ) :
87
+if ( ! function_exists('lsx_scripts_add_scripts')) :
88 88
 
89 89
 	/**
90 90
 	 * Enqueue scripts.
@@ -93,39 +93,39 @@  discard block
 block discarded – undo
93 93
 	 * @subpackage scripts
94 94
 	 */
95 95
 	function lsx_scripts_add_scripts() {
96
-		if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
97
-			wp_enqueue_script( 'comment-reply' );
96
+		if (is_singular() && comments_open() && get_option('thread_comments')) {
97
+			wp_enqueue_script('comment-reply');
98 98
 		}
99 99
 
100
-		wp_enqueue_script( 'platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true );
101
-		wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array( 'jquery' ), LSX_VERSION, true );
100
+		wp_enqueue_script('platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true);
101
+		wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, true);
102 102
 
103
-		wp_enqueue_script( 'imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array( 'masonry' ), LSX_VERSION, true );
104
-		wp_enqueue_script( 'scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array( 'jquery' ), LSX_VERSION, true );
105
-		wp_enqueue_script( 'slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array( 'jquery' ), LSX_VERSION, true );
106
-		wp_enqueue_script( 'slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array( 'jquery', 'slick' ), LSX_VERSION, true );
107
-		wp_enqueue_script( 'picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true );
103
+		wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array('masonry'), LSX_VERSION, true);
104
+		wp_enqueue_script('scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array('jquery'), LSX_VERSION, true);
105
+		wp_enqueue_script('slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array('jquery'), LSX_VERSION, true);
106
+		wp_enqueue_script('slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array('jquery', 'slick'), LSX_VERSION, true);
107
+		wp_enqueue_script('picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true);
108 108
 
109
-		if ( defined( 'SCRIPT_DEBUG' ) ) {
109
+		if (defined('SCRIPT_DEBUG')) {
110 110
 			$prefix = 'src/';
111 111
 			$suffix = '';
112 112
 		} else {
113 113
 			$prefix = '';
114 114
 			$suffix = '.min';
115 115
 		}
116
-		wp_enqueue_script( 'lsx_script', get_template_directory_uri() . '/assets/js/' . $prefix . 'lsx' . $suffix . '.js', array( 'jquery', 'platform', 'bootstrap', 'masonry', 'imagesLoaded', 'scrolltofixed', 'slick', 'slick-lightbox', 'picturefill' ), LSX_VERSION, true );
116
+		wp_enqueue_script('lsx_script', get_template_directory_uri() . '/assets/js/' . $prefix . 'lsx' . $suffix . '.js', array('jquery', 'platform', 'bootstrap', 'masonry', 'imagesLoaded', 'scrolltofixed', 'slick', 'slick-lightbox', 'picturefill'), LSX_VERSION, true);
117 117
 
118 118
 		$param_array = array(
119
-			'columns'            => apply_filters( 'lsx_archive_column_number', 3 ),
120
-			'stickyMenuSelector' => apply_filters( 'lsx_sticky_menu_selector', 'header.navbar' ),
119
+			'columns'            => apply_filters('lsx_archive_column_number', 3),
120
+			'stickyMenuSelector' => apply_filters('lsx_sticky_menu_selector', 'header.navbar'),
121 121
 		);
122 122
 
123
-		wp_localize_script( 'lsx_script', 'lsx_params', $param_array );
123
+		wp_localize_script('lsx_script', 'lsx_params', $param_array);
124 124
 	}
125 125
 
126 126
 endif;
127 127
 
128
-if ( ! function_exists( 'lsx_scripts_child_theme' ) ) :
128
+if ( ! function_exists('lsx_scripts_child_theme')) :
129 129
 
130 130
 	/**
131 131
 	 * Enqueue scripts and styles (for child theme).
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
 	 * @subpackage scripts
135 135
 	 */
136 136
 	function lsx_scripts_child_theme() {
137
-		if ( is_child_theme() && file_exists( get_stylesheet_directory() . '/assets/css/custom.css' ) ) {
138
-			wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array( 'lsx_main' ), LSX_VERSION );
139
-			wp_style_add_data( 'child-css', 'rtl', 'replace' );
137
+		if (is_child_theme() && file_exists(get_stylesheet_directory() . '/assets/css/custom.css')) {
138
+			wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array('lsx_main'), LSX_VERSION);
139
+			wp_style_add_data('child-css', 'rtl', 'replace');
140 140
 		}
141 141
 	}
142 142
 
143 143
 endif;
144 144
 
145
-add_action( 'wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999 );
145
+add_action('wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999);
Please login to merge, or discard this patch.