js
2 months ago
tus
1 month ago
videopress-divi
2 months ago
videopress-divi-5
2 months ago
class-access-control.php
3 months ago
class-admin-ui.php
3 weeks ago
class-ajax.php
1 month ago
class-attachment-handler.php
1 month ago
class-block-editor-content.php
1 month ago
class-block-editor-extensions.php
1 month ago
class-block-replacement.php
9 months ago
class-caption-tracks.php
1 month ago
class-data.php
1 month ago
class-divi.php
2 months ago
class-initial-state.php
1 month ago
class-initializer.php
1 month ago
class-jwt-token-bridge.php
2 years ago
class-module-control.php
3 years ago
class-options.php
2 years ago
class-package-version.php
3 weeks ago
class-plan.php
2 years ago
class-rest-controller.php
1 month ago
class-site.php
3 years ago
class-stats.php
1 year ago
class-status.php
9 months ago
class-upload-exception.php
3 years ago
class-uploader-rest-endpoints.php
9 months ago
class-uploader.php
1 month ago
class-utils.php
4 months ago
class-video-block-email-renderer.php
2 months ago
class-videopress-rest-api-v1-features.php
6 months ago
class-videopress-rest-api-v1-settings.php
1 month ago
class-videopress-rest-api-v1-site.php
2 years ago
class-videopress-rest-api-v1-stats.php
3 years ago
class-videopresstoken.php
1 month ago
class-wpcom-rest-api-v2-attachment-field-videopress.php
9 months ago
class-wpcom-rest-api-v2-attachment-videopress-data.php
1 month ago
class-wpcom-rest-api-v2-endpoint-videopress-caption-tracks.php
1 month ago
class-wpcom-rest-api-v2-endpoint-videopress.php
1 month ago
class-xmlrpc.php
1 month ago
utility-functions.php
1 month ago
class-divi.php
96 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Divi integration for Videopress. |
| 4 | * |
| 5 | * @package automattic/jetpack-videopress |
| 6 | **/ |
| 7 | |
| 8 | namespace Automattic\Jetpack\VideoPress; |
| 9 | |
| 10 | use Automattic\Jetpack\VideoPress\Divi5\Divi_5; |
| 11 | |
| 12 | /** |
| 13 | * Class Divi |
| 14 | **/ |
| 15 | class Divi { |
| 16 | /** |
| 17 | * The instance. |
| 18 | * |
| 19 | * @var Divi |
| 20 | **/ |
| 21 | private static $instance = null; |
| 22 | |
| 23 | /** |
| 24 | * Running or not. |
| 25 | * |
| 26 | * @var bool |
| 27 | **/ |
| 28 | private $running = false; |
| 29 | |
| 30 | /** |
| 31 | * VideoPress Divi Extension object. |
| 32 | * |
| 33 | * @var ?\VideoPress_Divi_Extension |
| 34 | **/ |
| 35 | private $vidi_extension; |
| 36 | |
| 37 | /** |
| 38 | * Initializes VideoPress/Divi integration. |
| 39 | * |
| 40 | * Called only once by the Initializer class |
| 41 | * |
| 42 | * @return self |
| 43 | */ |
| 44 | public static function init() { |
| 45 | return self::get_instance()->run(); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Get the instance. |
| 50 | * |
| 51 | * @return self |
| 52 | */ |
| 53 | public static function get_instance() { |
| 54 | if ( null === self::$instance ) { |
| 55 | self::$instance = new self(); |
| 56 | } |
| 57 | return self::$instance; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Run the extension. |
| 62 | * |
| 63 | * @return self |
| 64 | */ |
| 65 | public function run() { |
| 66 | if ( $this->running ) { |
| 67 | return $this; |
| 68 | } |
| 69 | |
| 70 | $this->running = true; |
| 71 | add_action( 'divi_extensions_init', array( $this, 'initialize_extension' ) ); |
| 72 | add_action( 'et_fb_framework_loaded', array( $this, 'on_fb_framework_loaded' ) ); |
| 73 | |
| 74 | // Divi 5 integration. These hooks only fire under Divi 5; the legacy |
| 75 | // extension above continues to serve Divi 4. |
| 76 | Divi_5::init(); |
| 77 | |
| 78 | return $this; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Fires when the Frontend Builder is loaded. |
| 83 | */ |
| 84 | public function on_fb_framework_loaded() { |
| 85 | Jwt_Token_Bridge::enqueue_jwt_token_bridge(); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Creates the extension's main class instance. |
| 90 | */ |
| 91 | public function initialize_extension() { |
| 92 | require_once plugin_dir_path( __FILE__ ) . 'videopress-divi/class-videopress-divi-extension.php'; |
| 93 | $this->vidi_extension = new \VideoPress_Divi_Extension(); |
| 94 | } |
| 95 | } |
| 96 |