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
4 weeks 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
3 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
4 weeks ago
class-xmlrpc.php
1 month ago
utility-functions.php
4 weeks ago
class-module-control.php
38 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack VideoPress: Module_Control class |
| 4 | * |
| 5 | * @package automattic/jetpack-videopress |
| 6 | */ |
| 7 | |
| 8 | namespace Automattic\Jetpack\VideoPress; |
| 9 | |
| 10 | /** |
| 11 | * To handle VideoPress module statuses |
| 12 | */ |
| 13 | class Module_Control { |
| 14 | |
| 15 | /** |
| 16 | * Initializer |
| 17 | * |
| 18 | * This method should onlybe called once by the Initializer class. Do not call this method again. |
| 19 | */ |
| 20 | public static function init() { |
| 21 | add_filter( 'jetpack_get_available_standalone_modules', array( __CLASS__, 'add_videopress_to_array' ), 10, 1 ); |
| 22 | if ( Status::is_standalone_plugin_active() ) { |
| 23 | // If the stand-alone plugin is active, videopress module will always be considered active |
| 24 | add_filter( 'jetpack_active_modules', array( __CLASS__, 'add_videopress_to_array' ), 10, 2 ); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Adds videopress to the list of available/active modules |
| 30 | * |
| 31 | * @param array $modules Array with modules slugs. |
| 32 | * @return array |
| 33 | */ |
| 34 | public static function add_videopress_to_array( $modules ) { |
| 35 | return array_merge( array( 'videopress' ), $modules ); |
| 36 | } |
| 37 | } |
| 38 |