|
1 | 1 | <?php |
2 | 2 | /* |
3 | 3 | * Load code specific to themes or theme tools |
| 4 | + * This file is special, and is not an actual `module` as such. |
| 5 | + * It is included by ./module-extras.php |
4 | 6 | */ |
5 | | - |
| 7 | + |
| 8 | +function jetpack_load_theme_tools() { |
| 9 | + if ( current_theme_supports( 'social-links' ) ) { |
| 10 | + require_once( JETPACK__PLUGIN_DIR . 'modules/theme-tools/social-links.php' ); |
| 11 | + } |
| 12 | + |
| 13 | + if ( current_theme_supports( 'tonesque' ) ) { |
| 14 | + jetpack_require_lib( 'tonesque' ); |
| 15 | + } |
| 16 | + |
| 17 | + require_once( JETPACK__PLUGIN_DIR . 'modules/theme-tools/random-redirect.php' ); |
| 18 | +} |
| 19 | +add_action( 'init', 'jetpack_load_theme_tools', 30 ); |
| 20 | + |
| 21 | +// Featured Content has an internal check for theme support in the constructor. |
| 22 | +require_once( JETPACK__PLUGIN_DIR . 'modules/theme-tools/featured-content.php' ); |
| 23 | + |
6 | 24 | /** |
7 | 25 | * INFINITE SCROLL |
8 | 26 | */ |
@@ -51,15 +69,8 @@ function jetpack_can_activate_infinite_scroll( $can_activate ) { |
51 | 69 | } |
52 | 70 | add_filter( 'jetpack_can_activate_infinite-scroll', 'jetpack_can_activate_infinite_scroll' ); |
53 | 71 |
|
54 | | -require_once( dirname( __FILE__ ) . '/featured-content/featured-content.php' ); |
55 | | - |
56 | | -require_once( dirname( __FILE__ ) . '/social-links.php' ); |
57 | | - |
58 | | -require_once( dirname( __FILE__ ) . '/tonesque.php' ); |
59 | | - |
60 | 72 | // Custom Post Types - we don't want a module card for these (yet) |
61 | | -require_once( dirname( __FILE__ ) . '/custom-post-types/comics.php' ); |
62 | | -require_once( dirname( __FILE__ ) . '/custom-post-types/testimonial.php' ); |
63 | | -require_once( dirname( __FILE__ ) . '/custom-post-types/nova.php' ); |
| 73 | +require_once( JETPACK__PLUGIN_DIR . 'modules/custom-post-types/comics.php' ); |
| 74 | +require_once( JETPACK__PLUGIN_DIR . 'modules/custom-post-types/testimonial.php' ); |
| 75 | +require_once( JETPACK__PLUGIN_DIR . 'modules/custom-post-types/nova.php' ); |
64 | 76 |
|
65 | | -require_once( dirname( __FILE__ ) . '/random-redirect.php' ); |
|
0 commit comments