Completed
Push — try/move-comment-likes-to-pack... ( a53827...993aa6 )
by
unknown
07:14
created

Bootstrap::require_lib_dir()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Automattic\Jetpack;
3
4
class Bootstrap {
5
	static function init() {
6
		/**
7
		 * Returns the location of Jetpack's lib directory. This filter is applied
8
		 * in require_lib().
9
		 *
10
		 * @since 4.0.2
11
		 *
12
		 * @return string Location of Jetpack library directory.
13
		 *
14
		 * @filter jetpack_require_lib_dir
15
		 */
16
		add_filter( 'jetpack_require_lib_dir', array( 'Bootstrap', 'require_lib_dir' ) );
17
18
		/**
19
		 * Checks if the code debug mode turned on, and returns false if it is. When Jetpack is in
20
		 * code debug mode, it shouldn't use minified assets. Note that this filter is not being used
21
		 * in every place where assets are enqueued. The filter is added at priority 9 to be overridden
22
		 * by any default priority filter that runs after it.
23
		 *
24
		 * @since 6.2.0
25
		 *
26
		 * @return boolean
27
		 *
28
		 * @filter jetpack_should_use_minified_assets
29
		 */
30
		add_filter( 'jetpack_should_use_minified_assets', array( 'Bootstrap', 'should_use_minified_assets' ), 9 );
31
	}
32
33
	static function require_lib_dir() {
34
		return JETPACK__PLUGIN_DIR . '_inc/lib';
35
	}
36
37
	static function should_use_minified_assets() {
38
		if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
39
			return false;
40
		}
41
		return true;
42
	}
43
}