jetpack
Last commit date
3rd-party
5 years ago
_inc
4 years ago
css
4 years ago
extensions
4 years ago
images
5 years ago
json-endpoints
4 years ago
modules
4 years ago
sal
4 years ago
src
5 years ago
vendor
4 years ago
views
5 years ago
CHANGELOG.md
4 years ago
LICENSE.txt
5 years ago
SECURITY.md
5 years ago
class-jetpack-connection-status.php
5 years ago
class-jetpack-pre-connection-jitms.php
5 years ago
class-jetpack-recommendations-banner.php
5 years ago
class-jetpack-wizard-banner.php
5 years ago
class-jetpack-xmlrpc-methods.php
5 years ago
class.frame-nonce-preview.php
6 years ago
class.jetpack-admin.php
5 years ago
class.jetpack-affiliate.php
6 years ago
class.jetpack-autoupdate.php
5 years ago
class.jetpack-bbpress-json-api.compat.php
5 years ago
class.jetpack-cli.php
4 years ago
class.jetpack-client-server.php
5 years ago
class.jetpack-connection-banner.php
5 years ago
class.jetpack-data.php
5 years ago
class.jetpack-gutenberg.php
4 years ago
class.jetpack-heartbeat.php
5 years ago
class.jetpack-idc.php
4 years ago
class.jetpack-ixr-client.php
5 years ago
class.jetpack-modules-list-table.php
5 years ago
class.jetpack-network-sites-list-table.php
5 years ago
class.jetpack-network.php
5 years ago
class.jetpack-plan.php
5 years ago
class.jetpack-post-images.php
5 years ago
class.jetpack-twitter-cards.php
5 years ago
class.jetpack-user-agent.php
5 years ago
class.jetpack.php
4 years ago
class.json-api-endpoints.php
4 years ago
class.json-api.php
5 years ago
class.photon.php
5 years ago
composer.json
4 years ago
functions.compat.php
5 years ago
functions.cookies.php
5 years ago
functions.gallery.php
6 years ago
functions.global.php
5 years ago
functions.opengraph.php
5 years ago
functions.photon.php
5 years ago
jest.config.js
5 years ago
jetpack.php
4 years ago
json-api-config.php
5 years ago
json-endpoints.php
7 years ago
load-jetpack.php
4 years ago
locales.php
7 years ago
readme.txt
4 years ago
require-lib.php
5 years ago
uninstall.php
5 years ago
wpml-config.xml
10 years ago
require-lib.php
45 lines
| 1 | <?php |
| 2 | function jetpack_require_lib( $slug ) { |
| 3 | static $loaded = array(); |
| 4 | |
| 5 | if ( defined( 'ABSPATH' ) && ! defined( 'WP_CONTENT_DIR' ) ) { |
| 6 | define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down |
| 7 | } |
| 8 | |
| 9 | $lib_dir = WP_CONTENT_DIR . '/lib'; |
| 10 | |
| 11 | /** |
| 12 | * Filter the location of the library directory. |
| 13 | * |
| 14 | * @since 2.5.0 |
| 15 | * |
| 16 | * @param string $lib_dir Path to the library directory. |
| 17 | */ |
| 18 | $lib_dir = apply_filters( 'jetpack_require_lib_dir', $lib_dir ); |
| 19 | |
| 20 | $loaded_key = "{$lib_dir}{$slug}"; |
| 21 | if ( ! empty( $loaded[ $loaded_key ] ) ) { |
| 22 | return; |
| 23 | } |
| 24 | |
| 25 | $loaded[ $loaded_key ] = true; |
| 26 | |
| 27 | $file_name = "$lib_dir/$slug.php"; |
| 28 | if ( is_readable( $file_name ) ) { |
| 29 | require_once $file_name; |
| 30 | |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | $file_name = "$lib_dir/$slug/0-load.php"; |
| 35 | if ( is_readable( $file_name ) ) { |
| 36 | require_once $file_name; |
| 37 | |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | $basename = basename( $slug ); |
| 42 | $file_name = "$lib_dir/$slug/$basename.php"; |
| 43 | require_once $file_name; |
| 44 | } |
| 45 |