Skip to content

Commit 91e86a8

Browse files
committed
deploy: 9c89948
1 parent b92904a commit 91e86a8

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

able_player_css.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h2></h2>
3636

3737

3838

39-
<h4 class="name" id="able_player_css">apply_filters( 'able_player_css', <span class="signature">$url, $is_production )</span><span class="type-signature"> &rarr; {string}</span></h4>
39+
<h4 class="name" id="able_player_css">apply_filters( 'able_player_css', <span class="signature">$url, $debug )</span><span class="type-signature"> &rarr; {string}</span></h4>
4040

4141

4242

@@ -100,7 +100,7 @@ <h5>Parameters:</h5>
100100

101101
<tr>
102102

103-
<td class="name"><code>$is_production</code></td>
103+
<td class="name"><code>$debug</code></td>
104104

105105

106106
<td class="type">
@@ -116,7 +116,7 @@ <h5>Parameters:</h5>
116116

117117

118118

119-
<td class="description last"><p>True if environment is designated as production.</p></td>
119+
<td class="description last"><p>True if environment is debugging.</p></td>
120120
</tr>
121121

122122

@@ -157,7 +157,7 @@ <h5>Parameters:</h5>
157157

158158
<dt class="tag-source">Source:</dt>
159159
<dd class="tag-source"><ul class="dummy"><li>
160-
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line83">line 83</a>
160+
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line82">line 82</a>
161161
</li></ul></dd>
162162

163163

able_player_js.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h2></h2>
3636

3737

3838

39-
<h4 class="name" id="able_player_js">apply_filters( 'able_player_js', <span class="signature">$url, $is_production )</span><span class="type-signature"> &rarr; {string}</span></h4>
39+
<h4 class="name" id="able_player_js">apply_filters( 'able_player_js', <span class="signature">$url, $debug )</span><span class="type-signature"> &rarr; {string}</span></h4>
4040

4141

4242

@@ -100,7 +100,7 @@ <h5>Parameters:</h5>
100100

101101
<tr>
102102

103-
<td class="name"><code>$is_production</code></td>
103+
<td class="name"><code>$debug</code></td>
104104

105105

106106
<td class="type">
@@ -116,7 +116,7 @@ <h5>Parameters:</h5>
116116

117117

118118

119-
<td class="description last"><p>True if environment is designated as production.</p></td>
119+
<td class="description last"><p>True if environment is in debugging.</p></td>
120120
</tr>
121121

122122

@@ -157,7 +157,7 @@ <h5>Parameters:</h5>
157157

158158
<dt class="tag-source">Source:</dt>
159159
<dd class="tag-source"><ul class="dummy"><li>
160-
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line72">line 72</a>
160+
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line71">line 71</a>
161161
</li></ul></dd>
162162

163163

ableplayer.php.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@
7474
* Load styles and scripts to head.
7575
*/
7676
function ableplayer_enqueue_scripts() {
77+
$debug = ( SCRIPT_DEBUG || ABLEPLAYER_DEBUG ) ? true : false;
7778
$version = ABLEPLAYER_VERSION;
78-
$version = ( SCRIPT_DEBUG ) ? $version . '-' . wp_rand( 1000, 9999 ) : $version;
79+
$version = ( $debug ) ? $version . '-' . wp_rand( 1000, 9999 ) : $version;
7980
// Register/enqueue other dependencies.
80-
$cookie_js = ( SCRIPT_DEBUG ) ? '/js.cookie.js' : '/js.cookie.min.js';
81+
$cookie_js = ( $debug ) ? '/js.cookie.js' : '/js.cookie.min.js';
8182
wp_enqueue_script( 'js-cookie', plugins_url( 'thirdparty', __FILE__ ) . $cookie_js, array(), $version, true );
8283
wp_enqueue_script( 'vimeo', 'https://player.vimeo.com/api/player.js', array(), $version, true );
8384
wp_enqueue_style( 'ableplayer-video', plugins_url( 'assets', __FILE__ ) . '/css/media.css', array(), $version );
84-
$media_js = ( SCRIPT_DEBUG ) ? 'media.js' : 'media.min.js';
85+
$media_js = ( $debug ) ? 'media.js' : 'media.min.js';
8586
wp_register_script( 'ableplayer-video', plugins_url( 'assets', __FILE__ ) . '/js/' . $media_js, array(), $version, true );
8687
wp_localize_script(
8788
'ableplayer-video',
@@ -90,33 +91,31 @@
9091
'settings' => ableplayer_get_settings(),
9192
)
9293
);
93-
// if the environment is production, use minified files. Otherwise, inherit the value of SCRIPT_DEBUG.
94-
$is_production = ( function_exists( 'wp_get_environment_type' ) &amp;&amp; wp_get_environment_type() === 'production' ) ? true : SCRIPT_DEBUG;
9594

96-
$js_file = ( $is_production ) ? 'ableplayer.min.js' : 'ableplayer.js';
97-
$css_file = ( $is_production ) ? 'ableplayer.min.css' : 'ableplayer.css';
95+
$js_file = ( ! $debug ) ? 'ableplayer.min.js' : 'ableplayer.js';
96+
$css_file = ( ! $debug ) ? 'build/ableplayer.min.css' : 'styles/ableplayer.css';
9897
/**
9998
* Filter the Able Player JS URL.
10099
*
101100
* @hook able_player_js
102101
*
103102
* @param {string} $url URL to Able Player root directory.
104-
* @param {bool} $is_production True if environment is designated as production.
103+
* @param {bool} $debug True if environment is in debugging.
105104
*
106105
* @return {string}
107106
*/
108-
$js_dir = apply_filters( 'able_player_js', plugins_url( 'build', __FILE__ ) . '/' . $js_file, $is_production );
107+
$js_dir = apply_filters( 'able_player_js', plugins_url( 'build', __FILE__ ) . '/' . $js_file, $debug );
109108
/**
110109
* Filter the Able Player CSS URL.
111110
*
112111
* @hook able_player_css
113112
*
114113
* @param {string} $url URL to Able Player root directory.
115-
* @param {bool} $is_production True if environment is designated as production.
114+
* @param {bool} $debug True if environment is debugging.
116115
*
117116
* @return {string}
118117
*/
119-
$css_dir = apply_filters( 'able_player_css', plugins_url( 'build', __FILE__ ) . '/' . $css_file, $is_production );
118+
$css_dir = apply_filters( 'able_player_css', plugins_url( '', __FILE__ ) . '/' . $css_file, $debug );
120119

121120
$dependencies = array( 'js-cookie', 'jquery', 'ableplayer-video' );
122121
/**
@@ -125,11 +124,11 @@
125124
* @hook ableplayer_dependencies
126125
*
127126
* @param {array} $dependencies Array of scripts required by the main Able Player script.
128-
* @param {bool} $is_production True if environment is designated as production.
127+
* @param {bool} $debug True if environment is in debugging mode.
129128
*
130129
* @return {array}
131130
*/
132-
$dependencies = apply_filters( 'ableplayer_dependencies', $dependencies, $is_production );
131+
$dependencies = apply_filters( 'ableplayer_dependencies', $dependencies, $debug );
133132
wp_enqueue_script( 'ableplayer', $js_dir, $dependencies, $version, true );
134133
wp_enqueue_style( 'ableplayer', $css_dir, array(), $version );
135134
}

ableplayer_dependencies.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h2></h2>
3636

3737

3838

39-
<h4 class="name" id="ableplayer_dependencies">apply_filters( 'ableplayer_dependencies', <span class="signature">$dependencies, $is_production )</span><span class="type-signature"> &rarr; {array}</span></h4>
39+
<h4 class="name" id="ableplayer_dependencies">apply_filters( 'ableplayer_dependencies', <span class="signature">$dependencies, $debug )</span><span class="type-signature"> &rarr; {array}</span></h4>
4040

4141

4242

@@ -100,7 +100,7 @@ <h5>Parameters:</h5>
100100

101101
<tr>
102102

103-
<td class="name"><code>$is_production</code></td>
103+
<td class="name"><code>$debug</code></td>
104104

105105

106106
<td class="type">
@@ -116,7 +116,7 @@ <h5>Parameters:</h5>
116116

117117

118118

119-
<td class="description last"><p>True if environment is designated as production.</p></td>
119+
<td class="description last"><p>True if environment is in debugging mode.</p></td>
120120
</tr>
121121

122122

@@ -157,7 +157,7 @@ <h5>Parameters:</h5>
157157

158158
<dt class="tag-source">Source:</dt>
159159
<dd class="tag-source"><ul class="dummy"><li>
160-
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line96">line 96</a>
160+
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line95">line 95</a>
161161
</li></ul></dd>
162162

163163

ableplayer_parameters.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ <h5>Parameters:</h5>
136136

137137
<dt class="tag-source">Source:</dt>
138138
<dd class="tag-source"><ul class="dummy"><li>
139-
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line351">line 351</a>
139+
<a href="ableplayer.php.html">ableplayer.php</a>, <a href="ableplayer.php.html#line350">line 350</a>
140140
</li></ul></dd>
141141

142142

0 commit comments

Comments
 (0)