Completed
Push — update/masterbar-rm-left-nav ( 7930b3...ec0ec1 )
by Jeremy
13:33 queued 06:04
created

minileven.php ➔ minileven_configuration_load()   B

Complexity

Conditions 9
Paths 5

Size

Total Lines 17

Duplication

Lines 6
Ratio 35.29 %

Importance

Changes 0
Metric Value
cc 9
nc 5
nop 0
dl 6
loc 17
rs 8.0555
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A minileven.php ➔ minileven_theme_root_uri() 0 7 2
1
<?php
2
3
/**
4
 * Module Name: Mobile Theme
5
 * Module Description: Enable the Jetpack Mobile theme
6
 * Sort Order: 21
7
 * Recommendation Order: 11
8
 * First Introduced: 1.8
9
 * Requires Connection: No
10
 * Auto Activate: No
11
 * Module Tags: Appearance, Mobile, Recommended
12
 * Feature: Appearance
13
 * Additional Search Queries: mobile, theme, minileven
14
 */
15
16
function jetpack_load_minileven() {
17
	include dirname( __FILE__ ) . "/minileven/minileven.php";
18
19
	if ( Jetpack_Options::get_option_and_ensure_autoload( 'wp_mobile_app_promos', '0' ) != '1' )
20
		remove_action( 'wp_mobile_theme_footer', 'jetpack_mobile_app_promo' );
21
}
22
23
add_action( 'jetpack_modules_loaded', 'minileven_loaded' );
24
25
function minileven_loaded() {
26
	Jetpack::enable_module_configurable( __FILE__ );
27
}
28
29
function minileven_theme_root( $theme_root ) {
30
	if ( jetpack_check_mobile() ) {
31
		return dirname( __FILE__ ) . '/minileven/theme';
32
	}
33
34
	return $theme_root;
35
}
36
37
add_filter( 'theme_root', 'minileven_theme_root' );
38
39
function minileven_theme_root_uri( $theme_root_uri ) {
40
	if ( jetpack_check_mobile() ) {
41
		return plugins_url( 'modules/minileven/theme', dirname( __FILE__ ) );
42
	}
43
44
	return $theme_root_uri;
45
}
46
47
add_filter( 'theme_root_uri', 'minileven_theme_root_uri' );
48
49
function minileven_enabled( $wp_mobile_disable_option ) {
50
	return true;
51
}
52
53
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
54
	add_filter( 'option_wp_mobile_disable', 'minileven_enabled' );
55
}
56
57
jetpack_load_minileven();
58