VideoPress_Options

The WordPress Core VideoPress Options class.

Defined (1)

The class is defined in the following location(s).

/modules/videopress/class.videopress-options.php  
  1. class VideoPress_Options { 
  2.  
  3. /** @var string */ 
  4. public static $option_name = 'videopress'; 
  5.  
  6. /** @var array */ 
  7. public static $jetpack_plans_with_videopress = array( 'jetpack_premium', 'jetpack_business' ); 
  8.  
  9. /** @var array */ 
  10. protected static $options = array(); 
  11.  
  12. /** 
  13. * Get VideoPress options 
  14. */ 
  15. public static function get_options() { 
  16. // Make sure we only get options from the database and services once per connection. 
  17. if ( count( self::$options ) > 0 ) { 
  18. return self::$options; 
  19.  
  20. $defaults = array( 
  21. 'meta' => array( 
  22. 'max_upload_size' => 0,  
  23. ),  
  24. ); 
  25.  
  26. self::$options = Jetpack_Options::get_option( self::$option_name, array() ); 
  27. self::$options = array_merge( $defaults, self::$options ); 
  28.  
  29. // Make sure that the shadow blog id never comes from the options, but instead uses the 
  30. // associated shadow blog id, if videopress is enabled. 
  31. self::$options['shadow_blog_id'] = 0; 
  32.  
  33. // Use the Jetpack ID for the shadow blog ID if we have a plan that supports VideoPress 
  34. if ( Jetpack::active_plan_supports( 'videopress' ) ) { 
  35. self::$options['shadow_blog_id'] = Jetpack_Options::get_option( 'id' ); 
  36.  
  37. return self::$options; 
  38.  
  39. /** 
  40. * Update VideoPress options 
  41. */ 
  42. public static function update_options( $options ) { 
  43. Jetpack_Options::update_option( self::$option_name, $options ); 
  44.  
  45. self::$options = $options; 
  46.  
  47. /** 
  48. * Runs when the VideoPress module is deactivated. 
  49. */ 
  50. public static function delete_options() { 
  51. Jetpack_Options::delete_option( self::$option_name ); 
  52.  
  53. self::$options = array(); 
  54.