Black_Studio_TinyMCE_Compatibility

The Black Studio TinyMCE Widget Black Studio TinyMCE Compatibility class.

Defined (1)

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

/includes/class-compatibility.php  
  1. final class Black_Studio_TinyMCE_Compatibility { 
  2.  
  3. /** 
  4. * The single instance of the plugin class 
  5. * @var object 
  6. * @since 2.0.0 
  7. */ 
  8. protected static $_instance = null; 
  9.  
  10. /** 
  11. * Instance of compatibility class for 3rd party plugins 
  12. * @var object 
  13. * @since 2.0.0 
  14. */ 
  15. protected static $plugins = null; 
  16.  
  17. /** 
  18. * Instance of compatibility class for WordPress old versions 
  19. * @var object 
  20. * @since 2.0.0 
  21. */ 
  22. protected static $wordpress = null; 
  23.  
  24. /** 
  25. * Return the single class instance 
  26. * @return object 
  27. * @since 2.0.0 
  28. */ 
  29. public static function instance() { 
  30. if ( is_null( self::$_instance ) ) { 
  31. self::$_instance = new self(); 
  32. return self::$_instance; 
  33.  
  34. /** 
  35. * Return the instance of the compatibility class for 3rd party plugins 
  36. * @return object 
  37. * @since 2.0.0 
  38. */ 
  39. public static function plugins() { 
  40. return self::$plugins; 
  41.  
  42. /** 
  43. * Return the instance of the compatibility class for WordPress old versions 
  44. * @return object 
  45. * @since 2.0.0 
  46. */ 
  47. public static function wordpress() { 
  48. return self::$wordpress; 
  49.  
  50. /** 
  51. * Class constructor 
  52. * @global object $wp_embed 
  53. * @since 2.0.0 
  54. */ 
  55. protected function __construct() { 
  56. $this->load_deprecated(); 
  57. $this->load_plugins(); 
  58. $this->load_wordpress(); 
  59.  
  60. /** 
  61. * Prevent the class from being cloned 
  62. * @return void 
  63. * @since 2.0.0 
  64. */ 
  65. protected function __clone() { 
  66. _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ uh?' ), '2.0' ); 
  67.  
  68. /** 
  69. * Load compatibility code for previous BSTW versions 
  70. * @uses apply_filters() 
  71. * @uses plugin_dir_path() 
  72. * @return void 
  73. * @since 2.0.0 
  74. */ 
  75. public function load_deprecated() { 
  76. $load_deprecated = apply_filters( 'black_studio_tinymce_load_deprecated', true ); 
  77. if ( $load_deprecated ) { 
  78. include_once( plugin_dir_path( dirname( __FILE__ ) ) . 'includes/deprecated.php' ); 
  79.  
  80. /** 
  81. * Load compatibility code for other plugins 
  82. * @uses apply_filters() 
  83. * @uses plugin_dir_path() 
  84. * @return void 
  85. * @since 2.0.0 
  86. */ 
  87. public function load_plugins() { 
  88. $load_compatibility_plugins = apply_filters( 'black_studio_tinymce_load_compatibility_plugins', array( 'siteorigin_panels', 'wpml', 'jetpack_after_the_deadline', 'wp_page_widget' ) ); 
  89. if ( ! empty( $load_compatibility_plugins ) ) { 
  90. include_once( plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-compatibility-plugins.php' ); 
  91. self::$plugins = Black_Studio_TinyMCE_Compatibility_Plugins::instance( $load_compatibility_plugins ); 
  92.  
  93. /** 
  94. * Load compatibility code for previous WordPress versions 
  95. * @uses get_bloginfo() 
  96. * @uses plugin_dir_path() 
  97. * @return void 
  98. * @since 2.0.0 
  99. */ 
  100. public function load_wordpress() { 
  101. if ( version_compare( get_bloginfo( 'version' ), '3.9', '<' ) ) { 
  102. include_once( plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-compatibility-wordpress.php' ); 
  103. self::$wordpress = Black_Studio_TinyMCE_Compatibility_Wordpress::instance(); 
  104.  
  105. } // END class Black_Studio_TinyMCE_Compatibility