|
@@ -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. |
|
@@ -25,9 +25,9 @@ discard block |
|
|
block discarded – undo |
|
25
|
25
|
|
|
26
|
26
|
endif; |
|
27
|
27
|
|
|
28
|
|
-add_action( 'wp_enqueue_scripts', 'lsx_scripts', 5 ); |
|
|
28
|
+add_action('wp_enqueue_scripts', 'lsx_scripts', 5); |
|
29
|
29
|
|
|
30
|
|
-if ( ! function_exists( 'lsx_admin_scripts' ) ) : |
|
|
30
|
+if ( ! function_exists('lsx_admin_scripts')) : |
|
31
|
31
|
|
|
32
|
32
|
/** |
|
33
|
33
|
* Enqueue scripts (admin). |
|
@@ -36,14 +36,14 @@ discard block |
|
|
block discarded – undo |
|
36
|
36
|
* @subpackage scripts |
|
37
|
37
|
*/ |
|
38
|
38
|
function lsx_admin_scripts() { |
|
39
|
|
- wp_enqueue_script( 'lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array( 'jquery' ), LSX_VERSION, true ); |
|
|
39
|
+ wp_enqueue_script('lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array('jquery'), LSX_VERSION, true); |
|
40
|
40
|
} |
|
41
|
41
|
|
|
42
|
42
|
endif; |
|
43
|
43
|
|
|
44
|
|
-add_action( 'admin_enqueue_scripts', 'lsx_admin_scripts' ); |
|
|
44
|
+add_action('admin_enqueue_scripts', 'lsx_admin_scripts'); |
|
45
|
45
|
|
|
46
|
|
-if ( ! function_exists( 'lsx_scripts_add_styles' ) ) : |
|
|
46
|
+if ( ! function_exists('lsx_scripts_add_styles')) : |
|
47
|
47
|
|
|
48
|
48
|
/** |
|
49
|
49
|
* Enqueue styles. |
|
@@ -52,23 +52,23 @@ discard block |
|
|
block discarded – undo |
|
52
|
52
|
* @subpackage scripts |
|
53
|
53
|
*/ |
|
54
|
54
|
function lsx_scripts_add_styles() { |
|
55
|
|
- wp_enqueue_style( 'lsx_fonts', get_template_directory_uri() . '/assets/css/lsx-fonts.css', array(), LSX_VERSION ); |
|
|
55
|
+ wp_enqueue_style('lsx_fonts', get_template_directory_uri() . '/assets/css/lsx-fonts.css', array(), LSX_VERSION); |
|
56
|
56
|
|
|
57
|
|
- wp_register_style( 'fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION ); |
|
58
|
|
- wp_style_add_data( 'fontawesome', 'rtl', 'replace' ); |
|
|
57
|
+ wp_register_style('fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION); |
|
|
58
|
+ wp_style_add_data('fontawesome', 'rtl', 'replace'); |
|
59
|
59
|
|
|
60
|
|
- wp_register_style( 'bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION ); |
|
61
|
|
- wp_style_add_data( 'bootstrap', 'rtl', 'replace' ); |
|
|
60
|
+ wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION); |
|
|
61
|
+ wp_style_add_data('bootstrap', 'rtl', 'replace'); |
|
62
|
62
|
|
|
63
|
|
- wp_enqueue_style( 'lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array( 'lsx_fonts', 'fontawesome', 'bootstrap'/*, 'slick'*/ ), LSX_VERSION ); |
|
64
|
|
- wp_enqueue_style( 'lsx_gutenberg', get_template_directory_uri() . '/assets/css/gutenberg.css', array( 'lsx_main' ), LSX_VERSION ); |
|
|
63
|
+ wp_enqueue_style('lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array('lsx_fonts', 'fontawesome', 'bootstrap'/*, 'slick'*/), LSX_VERSION); |
|
|
64
|
+ wp_enqueue_style('lsx_gutenberg', get_template_directory_uri() . '/assets/css/gutenberg.css', array('lsx_main'), LSX_VERSION); |
|
65
|
65
|
|
|
66
|
|
- wp_style_add_data( 'lsx_main', 'rtl', 'replace' ); |
|
|
66
|
+ wp_style_add_data('lsx_main', 'rtl', 'replace'); |
|
67
|
67
|
} |
|
68
|
68
|
|
|
69
|
69
|
endif; |
|
70
|
70
|
|
|
71
|
|
-if ( ! function_exists( 'lsx_scripts_add_scripts' ) ) : |
|
|
71
|
+if ( ! function_exists('lsx_scripts_add_scripts')) : |
|
72
|
72
|
|
|
73
|
73
|
/** |
|
74
|
74
|
* Enqueue scripts. |
|
@@ -77,39 +77,39 @@ discard block |
|
|
block discarded – undo |
|
77
|
77
|
* @subpackage scripts |
|
78
|
78
|
*/ |
|
79
|
79
|
function lsx_scripts_add_scripts() { |
|
80
|
|
- if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
81
|
|
- wp_enqueue_script( 'comment-reply' ); |
|
|
80
|
+ if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
|
81
|
+ wp_enqueue_script('comment-reply'); |
|
82
|
82
|
} |
|
83
|
83
|
|
|
84
|
|
- wp_enqueue_script( 'platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true ); |
|
85
|
|
- wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array( 'jquery' ), LSX_VERSION, true ); |
|
|
84
|
+ wp_enqueue_script('platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true); |
|
|
85
|
+ wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, true); |
|
86
|
86
|
|
|
87
|
|
- wp_enqueue_script( 'imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array( 'masonry' ), LSX_VERSION, true ); |
|
88
|
|
- wp_enqueue_script( 'scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array( 'jquery' ), LSX_VERSION, true ); |
|
89
|
|
- wp_enqueue_script( 'slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array( 'jquery' ), LSX_VERSION, true ); |
|
90
|
|
- wp_enqueue_script( 'slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array( 'jquery', 'slick' ), LSX_VERSION, true ); |
|
91
|
|
- wp_enqueue_script( 'picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true ); |
|
|
87
|
+ wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array('masonry'), LSX_VERSION, true); |
|
|
88
|
+ wp_enqueue_script('scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array('jquery'), LSX_VERSION, true); |
|
|
89
|
+ wp_enqueue_script('slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array('jquery'), LSX_VERSION, true); |
|
|
90
|
+ wp_enqueue_script('slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array('jquery', 'slick'), LSX_VERSION, true); |
|
|
91
|
+ wp_enqueue_script('picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true); |
|
92
|
92
|
|
|
93
|
|
- if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) { |
|
|
93
|
+ if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) { |
|
94
|
94
|
$prefix = 'src/'; |
|
95
|
95
|
$suffix = ''; |
|
96
|
96
|
} else { |
|
97
|
97
|
$prefix = ''; |
|
98
|
98
|
$suffix = '.min'; |
|
99
|
99
|
} |
|
100
|
|
- 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 ); |
|
|
100
|
+ 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); |
|
101
|
101
|
|
|
102
|
102
|
$param_array = array( |
|
103
|
|
- 'columns' => apply_filters( 'lsx_archive_column_number', 3 ), |
|
104
|
|
- 'stickyMenuSelector' => apply_filters( 'lsx_sticky_menu_selector', 'header.navbar' ), |
|
|
103
|
+ 'columns' => apply_filters('lsx_archive_column_number', 3), |
|
|
104
|
+ 'stickyMenuSelector' => apply_filters('lsx_sticky_menu_selector', 'header.navbar'), |
|
105
|
105
|
); |
|
106
|
106
|
|
|
107
|
|
- wp_localize_script( 'lsx_script', 'lsx_params', $param_array ); |
|
|
107
|
+ wp_localize_script('lsx_script', 'lsx_params', $param_array); |
|
108
|
108
|
} |
|
109
|
109
|
|
|
110
|
110
|
endif; |
|
111
|
111
|
|
|
112
|
|
-if ( ! function_exists( 'lsx_scripts_child_theme' ) ) : |
|
|
112
|
+if ( ! function_exists('lsx_scripts_child_theme')) : |
|
113
|
113
|
|
|
114
|
114
|
/** |
|
115
|
115
|
* Enqueue scripts and styles (for child theme). |
|
@@ -118,12 +118,12 @@ discard block |
|
|
block discarded – undo |
|
118
|
118
|
* @subpackage scripts |
|
119
|
119
|
*/ |
|
120
|
120
|
function lsx_scripts_child_theme() { |
|
121
|
|
- if ( is_child_theme() && file_exists( get_stylesheet_directory() . '/assets/css/custom.css' ) ) { |
|
122
|
|
- wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array( 'lsx_main' ), LSX_VERSION ); |
|
123
|
|
- wp_style_add_data( 'child-css', 'rtl', 'replace' ); |
|
|
121
|
+ if (is_child_theme() && file_exists(get_stylesheet_directory() . '/assets/css/custom.css')) { |
|
|
122
|
+ wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array('lsx_main'), LSX_VERSION); |
|
|
123
|
+ wp_style_add_data('child-css', 'rtl', 'replace'); |
|
124
|
124
|
} |
|
125
|
125
|
} |
|
126
|
126
|
|
|
127
|
127
|
endif; |
|
128
|
128
|
|
|
129
|
|
-add_action( 'wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999 ); |
|
|
129
|
+add_action('wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999); |