Skip to content

Commit 7a3e6bf

Browse files
Jetpack: Rearrange some of the theme-tools files, and move them into the theme-tools sub-folder. This will resolve the glitch where random-redirect.php also showed as a plugin being
deleted if you were deleting Jetpack. And results in a tidier modules folder.
1 parent 14b8b55 commit 7a3e6bf

6 files changed

Lines changed: 22 additions & 31 deletions

File tree

modules/social-links.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

modules/theme-tools.php

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
<?php
22
/*
33
* 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
46
*/
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+
624
/**
725
* INFINITE SCROLL
826
*/
@@ -51,15 +69,8 @@ function jetpack_can_activate_infinite_scroll( $can_activate ) {
5169
}
5270
add_filter( 'jetpack_can_activate_infinite-scroll', 'jetpack_can_activate_infinite_scroll' );
5371

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-
6072
// 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' );
6476

65-
require_once( dirname( __FILE__ ) . '/random-redirect.php' );
File renamed without changes.

modules/tonesque.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)