PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 13.7.1
Jetpack – WP Security, Backup, Speed, & Growth v13.7.1
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / module-extras.php

module-extras.php in Jetpack – WP Security, Backup, Speed, & Growth 13.7.1, at modules/module-extras.php

85 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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/testimonial.php',
18 'custom-post-types/nova.php',
19 'geo-location.php',
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/infinite-scroll.php',
28 'theme-tools/responsive-videos.php',
29 'theme-tools/site-logo.php',
30 'theme-tools/site-breadcrumbs.php',
31 'theme-tools/social-menu.php',
32 'theme-tools/content-options.php',
33 // Needed for VideoPress, so videos keep working in existing posts/pages when the module is deactivated.
34 'videopress/class.videopress-gutenberg.php',
35 );
36
37 // Some features are only available when connected to WordPress.com.
38 $connected_tools = array(
39 'plugin-search.php',
40 'scan/scan.php', // Shows Jetpack Scan alerts in the admin bar if threats found.
41 'simple-payments/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 );
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