File "class-module-control.php"
Full Path: /home/warrior1/public_html/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-videopress/src/class-module-control.php
File size: 1011 B
MIME-type: text/x-php
Charset: utf-8
<?php
/**
* Jetpack VideoPress: Module_Control class
*
* @package automattic/jetpack-videopress
*/
namespace Automattic\Jetpack\VideoPress;
/**
* To handle VideoPress module statuses
*/
class Module_Control {
/**
* Initializer
*
* This method should onlybe called once by the Initializer class. Do not call this method again.
*/
public static function init() {
add_filter( 'jetpack_get_available_standalone_modules', array( __CLASS__, 'add_videopress_to_array' ), 10, 1 );
if ( Status::is_standalone_plugin_active() ) {
// If the stand-alone plugin is active, videopress module will always be considered active.
add_filter( 'jetpack_active_modules', array( __CLASS__, 'add_videopress_to_array' ), 10, 2 );
}
}
/**
* Adds videopress to the list of available/active modules
*
* @param array $modules Array with modules slugs.
* @return array
*/
public static function add_videopress_to_array( $modules ) {
return array_merge( array( 'videopress' ), $modules );
}
}