diff options
author | Theo Chatzimichos <tampakrap@gentoo.org> | 2013-10-03 21:53:38 +0200 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gentoo.org> | 2013-10-03 21:53:38 +0200 |
commit | 61f7269ffabd11b7de56507c69191be42d7cfa60 (patch) | |
tree | 2ad81bec8d0c124019b23c841d80882c303801bc /plugins/jetpack/modules/module-extras.php | |
parent | forgot to include new files of jetpack (diff) | |
download | blogs-gentoo-61f7269ffabd11b7de56507c69191be42d7cfa60.tar.gz blogs-gentoo-61f7269ffabd11b7de56507c69191be42d7cfa60.tar.bz2 blogs-gentoo-61f7269ffabd11b7de56507c69191be42d7cfa60.zip |
update jetpack
Diffstat (limited to 'plugins/jetpack/modules/module-extras.php')
-rw-r--r-- | plugins/jetpack/modules/module-extras.php | 59 |
1 files changed, 9 insertions, 50 deletions
diff --git a/plugins/jetpack/modules/module-extras.php b/plugins/jetpack/modules/module-extras.php index 22fdb924..86bcbc5d 100644 --- a/plugins/jetpack/modules/module-extras.php +++ b/plugins/jetpack/modules/module-extras.php @@ -4,57 +4,16 @@ * For example, if a module shouldn't be activatable unless certain conditions are met, the code belongs in this file. */ -/** - * INFINITE SCROLL - */ - -/** - * Load theme's infinite scroll annotation file, if present in the IS plugin. - * The `setup_theme` action is used because the annotation files should be using `after_setup_theme` to register support for IS. - * - * As released in Jetpack 2.0, a child theme's parent wasn't checked for in the plugin's bundled support, hence the convoluted way the parent is checked for now. - * - * @uses is_admin, wp_get_theme, get_theme, get_current_theme, apply_filters - * @action setup_theme - * @return null - */ -function jetpack_load_infinite_scroll_annotation() { - if ( is_admin() && isset( $_GET['page'] ) && 'jetpack' == $_GET['page'] ) { - $theme = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_theme( get_current_theme() ); - - if ( ! is_a( $theme, 'WP_Theme' ) && ! is_array( $theme ) ) - return; - - $customization_file = apply_filters( 'infinite_scroll_customization_file', dirname( __FILE__ ) . "/infinite-scroll/themes/{$theme['Stylesheet']}.php", $theme['Stylesheet'] ); - - if ( is_readable( $customization_file ) ) { - require_once( $customization_file ); - } - elseif ( ! empty( $theme['Template'] ) ) { - $customization_file = dirname( __FILE__ ) . "/infinite-scroll/themes/{$theme['Template']}.php"; - - if ( is_readable( $customization_file ) ) - require_once( $customization_file ); - } - } -} -add_action( 'setup_theme', 'jetpack_load_infinite_scroll_annotation' ); - -/** - * Prevent IS from being activated if theme doesn't support it - * - * @param bool $can_activate - * @filter jetpack_can_activate_infinite-scroll - * @return bool - */ -function jetpack_can_activate_infinite_scroll( $can_activate ) { - return (bool) current_theme_supports( 'infinite-scroll' ); -} -add_filter( 'jetpack_can_activate_infinite-scroll', 'jetpack_can_activate_infinite_scroll' ); - // Happy Holidays! require_once( dirname( __FILE__ ) . '/holiday-snow.php' ); -require_once( dirname( __FILE__ ) . '/featured-content/featured-content.php' ); +// Include extra tools that aren't modules, in a filterable way +$jetpack_tools_to_include = apply_filters( 'jetpack-tools-to-include', array( 'theme-tools.php' ) ); -require_once( dirname( __FILE__ ) . '/social-links.php' ); +if ( ! empty( $jetpack_tools_to_include ) ) { + foreach ( $jetpack_tools_to_include as $tool ) { + if ( file_exists( JETPACK__PLUGIN_DIR . '/modules/' . $tool ) ) { + require_once( JETPACK__PLUGIN_DIR . '/modules/' . $tool ); + } + } +}
\ No newline at end of file |