calypsoify
4 years ago
carousel
4 years ago
cloudflare-analytics
4 years ago
comment-likes
5 years ago
comments
4 years ago
contact-form
3 years ago
custom-css
4 years ago
custom-post-types
4 years ago
geo-location
4 years ago
google-analytics
4 years ago
gravatar
5 years ago
infinite-scroll
4 years ago
likes
4 years ago
markdown
4 years ago
masterbar
3 years ago
memberships
3 years ago
photon
5 years ago
photon-cdn
3 years ago
plugin-search
4 years ago
post-by-email
4 years ago
protect
4 years ago
publicize
3 years ago
related-posts
3 years ago
scan
4 years ago
seo-tools
3 years ago
sharedaddy
3 years ago
shortcodes
4 years ago
simple-payments
3 years ago
site-icon
4 years ago
sitemaps
3 years ago
sso
4 years ago
stats
4 years ago
subscriptions
4 years ago
theme-tools
4 years ago
tiled-gallery
3 years ago
verification-tools
4 years ago
videopress
3 years ago
widget-visibility
3 years ago
widgets
3 years ago
woocommerce-analytics
4 years ago
wordads
4 years ago
wpcom-block-editor
4 years ago
wpcom-tos
5 years ago
carousel.php
4 years ago
comment-likes.php
4 years ago
comments.php
4 years ago
contact-form.php
3 years ago
copy-post.php
4 years ago
custom-content-types.php
4 years ago
custom-css.php
4 years ago
enhanced-distribution.php
4 years ago
geo-location.php
4 years ago
google-analytics.php
4 years ago
google-fonts.php
4 years ago
gravatar-hovercards.php
4 years ago
infinite-scroll.php
4 years ago
json-api.php
5 years ago
latex.php
4 years ago
lazy-images.php
4 years ago
likes.php
4 years ago
markdown.php
4 years ago
masterbar.php
4 years ago
module-extras.php
4 years ago
module-headings.php
4 years ago
module-info.php
3 years ago
monitor.php
4 years ago
notes.php
4 years ago
photon-cdn.php
4 years ago
photon.php
4 years ago
plugin-search.php
5 years ago
post-by-email.php
5 years ago
protect.php
4 years ago
publicize.php
3 years ago
related-posts.php
4 years ago
search.php
4 years ago
seo-tools.php
4 years ago
sharedaddy.php
4 years ago
shortcodes.php
4 years ago
shortlinks.php
4 years ago
sitemaps.php
4 years ago
sso.php
4 years ago
stats.php
4 years ago
subscriptions.php
4 years ago
theme-tools.php
4 years ago
tiled-gallery.php
4 years ago
vaultpress.php
4 years ago
verification-tools.php
5 years ago
videopress.php
4 years ago
waf.php
4 years ago
widget-visibility.php
4 years ago
widgets.php
4 years ago
woocommerce-analytics.php
5 years ago
wordads.php
5 years ago
wpgroho.js
5 years ago
module-extras.php
92 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Load module code that is needed even when a module isn't active. |
| 4 | * For example, if a module shouldn't be activatable unless certain conditions are met, |
| 5 | * the code belongs in this file. |
| 6 | * |
| 7 | * @package automattic/jetpack |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Features available all the time: |
| 12 | * - When in offline mode. |
| 13 | * - When connected to WordPress.com. |
| 14 | */ |
| 15 | $tools = array( |
| 16 | // Always loaded, but only registered if theme supports it. |
| 17 | 'custom-post-types/comics.php', |
| 18 | 'custom-post-types/testimonial.php', |
| 19 | 'custom-post-types/nova.php', |
| 20 | 'geo-location.php', |
| 21 | // Those oEmbed providers are always available. |
| 22 | 'shortcodes/facebook.php', |
| 23 | 'shortcodes/others.php', |
| 24 | // Theme Tools. |
| 25 | 'theme-tools.php', |
| 26 | 'theme-tools/social-links.php', |
| 27 | 'theme-tools/random-redirect.php', |
| 28 | 'theme-tools/featured-content.php', |
| 29 | 'theme-tools/infinite-scroll.php', |
| 30 | 'theme-tools/responsive-videos.php', |
| 31 | 'theme-tools/site-logo.php', |
| 32 | 'theme-tools/site-breadcrumbs.php', |
| 33 | 'theme-tools/social-menu.php', |
| 34 | 'theme-tools/content-options.php', |
| 35 | 'theme-tools/devicepx.php', |
| 36 | // Needed for VideoPress, so videos keep working in existing posts/pages when the module is deactivated. |
| 37 | 'videopress/utility-functions.php', |
| 38 | 'videopress/class.videopress-gutenberg.php', |
| 39 | ); |
| 40 | |
| 41 | // Some features are only available when connected to WordPress.com. |
| 42 | $connected_tools = array( |
| 43 | 'calypsoify/class-jetpack-calypsoify.php', |
| 44 | 'cloudflare-analytics/cloudflare-analytics.php', |
| 45 | 'plugin-search.php', |
| 46 | 'scan/scan.php', // Shows Jetpack Scan alerts in the admin bar if threats found. |
| 47 | 'simple-payments/simple-payments.php', |
| 48 | 'wpcom-block-editor/class-jetpack-wpcom-block-editor.php', |
| 49 | 'wpcom-tos/wpcom-tos.php', |
| 50 | // These oEmbed providers are available when connected to WordPress.com. |
| 51 | // Starting from 2020-10-24, they need an authentication token, and that token is stored on WordPress.com. |
| 52 | // More information: https://developers.facebook.com/docs/instagram/oembed/. |
| 53 | 'shortcodes/instagram.php', |
| 54 | ); |
| 55 | |
| 56 | // Add connected features to our existing list if the site is currently connected. |
| 57 | if ( Jetpack::is_connection_ready() ) { |
| 58 | $tools = array_merge( $tools, $connected_tools ); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Filter extra tools (not modules) to include. |
| 63 | * |
| 64 | * @since 2.4.0 |
| 65 | * @since 5.4.0 can be used in multisite when Jetpack is not connected to WordPress.com and not in offline mode. |
| 66 | * |
| 67 | * @param array $tools Array of extra tools to include. |
| 68 | */ |
| 69 | $jetpack_tools_to_include = apply_filters( 'jetpack_tools_to_include', $tools ); |
| 70 | |
| 71 | if ( ! empty( $jetpack_tools_to_include ) ) { |
| 72 | foreach ( $jetpack_tools_to_include as $tool ) { |
| 73 | if ( file_exists( JETPACK__PLUGIN_DIR . '/modules/' . $tool ) ) { |
| 74 | require_once JETPACK__PLUGIN_DIR . '/modules/' . $tool; |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Add the "(Jetpack)" suffix to the widget names |
| 81 | * |
| 82 | * @param string $widget_name Widget name. |
| 83 | */ |
| 84 | function jetpack_widgets_add_suffix( $widget_name ) { |
| 85 | return sprintf( |
| 86 | /* Translators: Placeholder is the name of a widget. */ |
| 87 | __( '%s (Jetpack)', 'jetpack' ), |
| 88 | $widget_name |
| 89 | ); |
| 90 | } |
| 91 | add_filter( 'jetpack_widget_name', 'jetpack_widgets_add_suffix' ); |
| 92 |