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