|
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
|
|
|
|