carousel
1 year ago
cloudflare-analytics
2 years ago
comment-likes
5 years ago
comments
1 year ago
custom-post-types
1 year ago
external-media
1 year ago
geo-location
1 year ago
google-fonts
1 year ago
gravatar
6 years ago
infinite-scroll
1 year ago
likes
1 year ago
markdown
1 year ago
memberships
1 year ago
photon-cdn
1 year ago
plugin-search
1 year ago
post-by-email
1 year ago
related-posts
1 year ago
scan
1 year ago
seo-tools
1 year ago
sharedaddy
1 year ago
shortcodes
1 year ago
simple-payments
1 year ago
site-icon
2 years ago
sitemaps
1 year ago
stats
2 years ago
subscriptions
1 year ago
theme-tools
1 year ago
tiled-gallery
1 year ago
verification-tools
4 years ago
videopress
1 year ago
widget-visibility
1 year ago
widgets
1 year ago
woocommerce-analytics
1 year ago
wordads
1 year ago
wpcom-tos
5 years ago
account-protection.php
1 year ago
blaze.php
2 years ago
blocks.php
1 year ago
carousel.php
2 years ago
comment-likes.php
2 years ago
comments.php
2 years ago
contact-form.php
1 year ago
copy-post.php
1 year ago
custom-content-types.php
1 year ago
geo-location.php
1 year ago
google-fonts.php
2 years ago
gravatar-hovercards.php
2 years ago
infinite-scroll.php
3 years ago
json-api.php
5 years ago
latex.php
4 years ago
likes.php
1 year ago
markdown.php
4 years ago
masterbar.php
1 year ago
module-extras.php
1 year ago
module-headings.php
1 year ago
module-info.php
1 year ago
monitor.php
2 years ago
notes.php
1 year ago
photon-cdn.php
1 year ago
photon.php
3 years ago
plugin-search.php
1 year ago
post-by-email.php
5 years ago
post-list.php
4 years ago
protect.php
2 years ago
publicize.php
1 year ago
related-posts.php
2 years ago
search.php
4 years ago
seo-tools.php
2 years ago
sharedaddy.php
2 years ago
shortcodes.php
1 year ago
shortlinks.php
1 year ago
sitemaps.php
1 year ago
sso.php
1 year ago
stats.php
1 year ago
subscriptions.php
1 year ago
theme-tools.php
1 year ago
tiled-gallery.php
4 years ago
vaultpress.php
2 years ago
verification-tools.php
5 years ago
videopress.php
4 years ago
waf.php
1 year ago
widget-visibility.php
4 years ago
widgets.php
1 year ago
woocommerce-analytics.php
2 years ago
wordads.php
2 years ago
wpgroho.js
1 year ago
module-extras.php
85 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 | 'geo-location.php', |
| 18 | // Those oEmbed providers are always available. |
| 19 | 'shortcodes/facebook.php', |
| 20 | 'shortcodes/others.php', |
| 21 | // Theme Tools. |
| 22 | 'theme-tools.php', |
| 23 | 'theme-tools/social-links.php', |
| 24 | 'theme-tools/featured-content.php', |
| 25 | 'theme-tools/responsive-videos.php', |
| 26 | 'theme-tools/site-logo.php', |
| 27 | 'theme-tools/site-breadcrumbs.php', |
| 28 | 'theme-tools/social-menu.php', |
| 29 | 'theme-tools/content-options.php', |
| 30 | // Needed for VideoPress, so videos keep working in existing posts/pages when the module is deactivated. |
| 31 | 'videopress/class.videopress-gutenberg.php', |
| 32 | ); |
| 33 | |
| 34 | // Some features are only available when connected to WordPress.com. |
| 35 | $connected_tools = array( |
| 36 | 'external-media/external-media.php', |
| 37 | 'plugin-search.php', |
| 38 | 'scan/scan.php', // Shows Jetpack Scan alerts in the admin bar if threats found. |
| 39 | 'simple-payments/simple-payments.php', |
| 40 | 'wpcom-tos/wpcom-tos.php', |
| 41 | // These oEmbed providers are available when connected to WordPress.com. |
| 42 | // Starting from 2020-10-24, they need an authentication token, and that token is stored on WordPress.com. |
| 43 | // More information: https://developers.facebook.com/docs/instagram/oembed/. |
| 44 | 'shortcodes/instagram.php', |
| 45 | // This Twitter oEmbed provider relies on a connection to WordPress.com to proxy the request. |
| 46 | 'shortcodes/twitter.php', |
| 47 | ); |
| 48 | |
| 49 | // Add connected features to our existing list if the site is currently connected. |
| 50 | if ( Jetpack::is_connection_ready() ) { |
| 51 | $tools = array_merge( $tools, $connected_tools ); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Filter extra tools (not modules) to include. |
| 56 | * |
| 57 | * @since 2.4.0 |
| 58 | * @since 5.4.0 can be used in multisite when Jetpack is not connected to WordPress.com and not in offline mode. |
| 59 | * |
| 60 | * @param array $tools Array of extra tools to include. |
| 61 | */ |
| 62 | $jetpack_tools_to_include = apply_filters( 'jetpack_tools_to_include', $tools ); |
| 63 | |
| 64 | if ( ! empty( $jetpack_tools_to_include ) ) { |
| 65 | foreach ( $jetpack_tools_to_include as $tool ) { |
| 66 | if ( file_exists( JETPACK__PLUGIN_DIR . '/modules/' . $tool ) ) { |
| 67 | require_once JETPACK__PLUGIN_DIR . '/modules/' . $tool; |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Add the "(Jetpack)" suffix to the widget names |
| 74 | * |
| 75 | * @param string $widget_name Widget name. |
| 76 | */ |
| 77 | function jetpack_widgets_add_suffix( $widget_name ) { |
| 78 | return sprintf( |
| 79 | /* Translators: Placeholder is the name of a widget. */ |
| 80 | __( '%s (Jetpack)', 'jetpack' ), |
| 81 | $widget_name |
| 82 | ); |
| 83 | } |
| 84 | add_filter( 'jetpack_widget_name', 'jetpack_widgets_add_suffix' ); |
| 85 |