jetpack
Last commit date
3rd-party
6 years ago
_inc
6 years ago
bin
6 years ago
css
6 years ago
extensions
6 years ago
images
6 years ago
json-endpoints
6 years ago
languages
6 years ago
modules
6 years ago
sal
6 years ago
src
6 years ago
sync
6 years ago
vendor
6 years ago
views
7 years ago
wp-cli-templates
7 years ago
.svnignore
12 years ago
CODE-OF-CONDUCT.md
9 years ago
changelog.txt
6 years ago
class.frame-nonce-preview.php
9 years ago
class.jetpack-admin.php
7 years ago
class.jetpack-affiliate.php
7 years ago
class.jetpack-autoupdate.php
7 years ago
class.jetpack-bbpress-json-api-compat.php
9 years ago
class.jetpack-cli.php
6 years ago
class.jetpack-client-server.php
6 years ago
class.jetpack-client.php
6 years ago
class.jetpack-connection-banner.php
6 years ago
class.jetpack-constants.php
6 years ago
class.jetpack-data.php
6 years ago
class.jetpack-debugger.php
7 years ago
class.jetpack-error.php
10 years ago
class.jetpack-gutenberg.php
6 years ago
class.jetpack-heartbeat.php
7 years ago
class.jetpack-idc.php
6 years ago
class.jetpack-ixr-client.php
6 years ago
class.jetpack-jitm.php
6 years ago
class.jetpack-modules-list-table.php
6 years ago
class.jetpack-network-sites-list-table.php
9 years ago
class.jetpack-network.php
6 years ago
class.jetpack-options.php
6 years ago
class.jetpack-plan.php
6 years ago
class.jetpack-post-images.php
7 years ago
class.jetpack-signature.php
6 years ago
class.jetpack-tracks.php
6 years ago
class.jetpack-twitter-cards.php
7 years ago
class.jetpack-user-agent.php
7 years ago
class.jetpack-xmlrpc-server.php
6 years ago
class.jetpack.php
6 years ago
class.json-api-endpoints.php
6 years ago
class.json-api.php
7 years ago
class.photon.php
6 years ago
composer.json
6 years ago
functions.compat.php
6 years ago
functions.gallery.php
6 years ago
functions.global.php
6 years ago
functions.opengraph.php
7 years ago
functions.photon.php
6 years ago
jest.config.js
7 years ago
jetpack.php
6 years ago
json-api-config.php
10 years ago
json-endpoints.php
7 years ago
load-jetpack.php
6 years ago
locales.php
7 years ago
readme.txt
6 years ago
require-lib.php
6 years ago
uninstall.php
6 years ago
wpml-config.xml
10 years ago
load-jetpack.php
105 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Load all Jetpack files that do not get loaded via the autoloader. |
| 4 | * |
| 5 | * @package Jetpack |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Returns the location of Jetpack's lib directory. This filter is applied |
| 10 | * in require_lib(). |
| 11 | * |
| 12 | * @since 4.0.2 |
| 13 | * |
| 14 | * @return string Location of Jetpack library directory. |
| 15 | * |
| 16 | * @filter require_lib_dir |
| 17 | */ |
| 18 | function jetpack_require_lib_dir() { |
| 19 | return JETPACK__PLUGIN_DIR . '_inc/lib'; |
| 20 | } |
| 21 | add_filter( 'jetpack_require_lib_dir', 'jetpack_require_lib_dir' ); |
| 22 | |
| 23 | /** |
| 24 | * Checks if the code debug mode turned on, and returns false if it is. When Jetpack is in |
| 25 | * code debug mode, it shouldn't use minified assets. Note that this filter is not being used |
| 26 | * in every place where assets are enqueued. The filter is added at priority 9 to be overridden |
| 27 | * by any default priority filter that runs after it. |
| 28 | * |
| 29 | * @since 6.2.0 |
| 30 | * |
| 31 | * @return boolean |
| 32 | * |
| 33 | * @filter jetpack_should_use_minified_assets |
| 34 | */ |
| 35 | function jetpack_should_use_minified_assets() { |
| 36 | if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { |
| 37 | return false; |
| 38 | } |
| 39 | return true; |
| 40 | } |
| 41 | add_filter( 'jetpack_should_use_minified_assets', 'jetpack_should_use_minified_assets', 9 ); |
| 42 | |
| 43 | // @todo: Abstract out the admin functions, and only include them if is_admin() |
| 44 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack.php'; |
| 45 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-network.php'; |
| 46 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-data.php'; |
| 47 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php'; |
| 48 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php'; |
| 49 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php'; |
| 50 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-error.php'; |
| 51 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php'; |
| 52 | require_once JETPACK__PLUGIN_DIR . 'class.photon.php'; |
| 53 | require_once JETPACK__PLUGIN_DIR . 'functions.photon.php'; |
| 54 | require_once JETPACK__PLUGIN_DIR . 'functions.global.php'; |
| 55 | require_once JETPACK__PLUGIN_DIR . 'functions.compat.php'; |
| 56 | require_once JETPACK__PLUGIN_DIR . 'functions.gallery.php'; |
| 57 | require_once JETPACK__PLUGIN_DIR . 'require-lib.php'; |
| 58 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php'; |
| 59 | require_once JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php'; |
| 60 | require_once JETPACK__PLUGIN_DIR . 'modules/module-headings.php'; |
| 61 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-idc.php'; |
| 62 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-connection-banner.php'; |
| 63 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-plan.php'; |
| 64 | |
| 65 | \Automattic\Jetpack\Sync\Main::init(); |
| 66 | |
| 67 | if ( is_admin() ) { |
| 68 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php'; |
| 69 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-affiliate.php'; |
| 70 | $jitm = new Automattic\Jetpack\JITM(); |
| 71 | $jitm->register(); |
| 72 | jetpack_require_lib( 'debugger' ); |
| 73 | } |
| 74 | |
| 75 | // Play nice with http://wp-cli.org/. |
| 76 | if ( defined( 'WP_CLI' ) && WP_CLI ) { |
| 77 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-cli.php'; |
| 78 | } |
| 79 | |
| 80 | require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.core-rest-api-endpoints.php'; |
| 81 | |
| 82 | add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 ); |
| 83 | add_action( 'init', array( 'Jetpack', 'init' ) ); |
| 84 | add_action( 'plugins_loaded', array( 'Jetpack', 'plugin_textdomain' ), 99 ); |
| 85 | add_action( 'plugins_loaded', array( 'Jetpack', 'load_modules' ), 100 ); |
| 86 | add_filter( 'jetpack_static_url', array( 'Jetpack', 'staticize_subdomain' ) ); |
| 87 | add_filter( 'is_jetpack_site', '__return_true' ); |
| 88 | |
| 89 | /** |
| 90 | * Add an easy way to photon-ize a URL that is safe to call even if Jetpack isn't active. |
| 91 | * |
| 92 | * See: http://jetpack.com/2013/07/11/photon-and-themes/ |
| 93 | */ |
| 94 | if ( Jetpack::is_module_active( 'photon' ) ) { |
| 95 | add_filter( 'jetpack_photon_url', 'jetpack_photon_url', 10, 3 ); |
| 96 | } |
| 97 | |
| 98 | if ( JETPACK__SANDBOX_DOMAIN ) { |
| 99 | require_once JETPACK__PLUGIN_DIR . '_inc/jetpack-server-sandbox.php'; |
| 100 | } |
| 101 | |
| 102 | require_once JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php'; |
| 103 | |
| 104 | Jetpack::init(); |
| 105 |