Google_Maps_Builder_Core

Class Google_Maps_Builder_Core.

Defined (1)

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

/vendor/wordimpress/maps-builder-core/core.php  
  1. abstract class Google_Maps_Builder_Core { 
  2.  
  3. /** 
  4. * Activation Object 
  5. * @var Google_Maps_Builder_Activate 
  6. * @since 2.0 
  7. */ 
  8. public $activate; 
  9.  
  10.  
  11. /** 
  12. * GMB Scripts Object 
  13. * @var Google_Maps_Builder_Scripts 
  14. * @since 2.0 
  15. */ 
  16. public $scripts; 
  17.  
  18. /** 
  19. * GMB Settings Object 
  20. * @var Google_Maps_Builder_Settings 
  21. * @since 2.0 
  22. */ 
  23. public $settings; 
  24.  
  25. /** 
  26. * GMB Engine Object 
  27. * @var Google_Maps_Builder_Engine 
  28. * @since 2.0 
  29. */ 
  30. public $engine; 
  31.  
  32. /** 
  33. * GMB Plugin Meta 
  34. * @var array 
  35. * @since 2.0 
  36. */ 
  37. public $meta; 
  38.  
  39. /** 
  40. * GMB HTML elements 
  41. * @var Google_Maps_Builder_HTML_Elements 
  42. * @since 2.0 
  43. */ 
  44. public $html; 
  45.  
  46. /** 
  47. * Include required files 
  48. * OVERRIDE IN PLUGIN 
  49. */ 
  50. protected function includes() { 
  51. _doing_it_wrong( __FUNCTION__, __( 'Must overide.', 'google-maps-builder' ), '2.1.0' ); 
  52.  
  53. /** 
  54. * Get instance 
  55. * OVERRIDE IN PLUGIN 
  56. */ 
  57. public static function instance() { 
  58. _doing_it_wrong( __FUNCTION__, __( 'Must overide.', 'google-maps-builder' ), '2.1.0' ); 
  59.  
  60. /** 
  61. * Throw error on object clone 
  62. * The whole idea of the singleton design pattern is that there is a single 
  63. * object, therefore we don't want the object to be cloned. 
  64. * @since 2.0 
  65. * @access protected 
  66. * @return void 
  67. */ 
  68. public function __clone() { 
  69. // Cloning instances of the class is forbidden 
  70. _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'google-maps-builder' ), '2.0' ); 
  71.  
  72. /** 
  73. * Disable unserializing of the class 
  74. * @since 2.0 
  75. * @access protected 
  76. * @return void 
  77. */ 
  78. public function __wakeup() { 
  79. // Unserializing instances of the class is forbidden 
  80. _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'google-maps-builder' ), '2.0' ); 
  81.  
  82. /** 
  83. * Loads the plugin language files 
  84. * @access public 
  85. * @since 2.0 
  86. * @return void 
  87. */ 
  88. public function load_textdomain() { 
  89. // Set filter for Give's languages directory 
  90. $gmb_lang_dir = dirname( plugin_basename( GMB_PLUGIN_FILE ) ) . '/languages/'; 
  91. $gmb_lang_dir = apply_filters( 'gmb_languages_directory', $gmb_lang_dir ); 
  92.  
  93. // Traditional WordPress plugin locale filter 
  94. $locale = apply_filters( 'plugin_locale', get_locale(), 'google-maps-builder' ); 
  95. $mofile = sprintf( '%1$s-%2$s.mo', 'google-maps-builder', $locale ); 
  96.  
  97. // Setup paths to current locale file 
  98. $mofile_local = $gmb_lang_dir . $mofile; 
  99. $mofile_global = WP_LANG_DIR . '/gmb/' . $mofile; 
  100.  
  101. if ( file_exists( $mofile_global ) ) { 
  102. // Look in global /wp-content/languages/gmb folder. 
  103. load_textdomain( 'google-maps-builder', $mofile_global ); 
  104. } elseif ( file_exists( $mofile_local ) ) { 
  105. // Look in local /wp-content/plugins/gmb/languages/ folder. 
  106. load_textdomain( 'google-maps-builder', $mofile_local ); 
  107. } else { 
  108. // Load the default language files. 
  109. load_plugin_textdomain( 'google-maps-builder', false, $gmb_lang_dir ); 
  110.  
  111. /** 
  112. * Registers the Google Maps Builder Widget. 
  113. * @since 2.1.0 
  114. * @return void 
  115. */ 
  116. public function init_widget() { 
  117. register_widget( 'Google_Maps_Builder_Widget' ); 
  118.  
  119. /** 
  120. * Get the CMB2 bootstrap! 
  121. * Checks to see if CMB2 plugin is installed first the uses included CMB2; 
  122. * we can still use it even it it's not active. This prevents fatal error conflicts with other themes and users of the CMB2 WP.org plugin. 
  123. */ 
  124. public function cmb2_load() { 
  125.  
  126. if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { 
  127. require_once WP_PLUGIN_DIR . '/cmb2/init.php'; 
  128. } elseif ( file_exists( GMB_CORE_PATH . '/includes/libraries/metabox/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { 
  129. require_once GMB_CORE_PATH . '/includes/libraries/metabox/init.php'; 
  130. } elseif ( file_exists( GMB_CORE_PATH . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { 
  131. require_once GMB_CORE_PATH . '/includes/libraries/CMB2/init.php'; 
  132.  
  133.  
  134.  
  135. /** 
  136. * Load activation classes. 
  137. * @since 2.1.0 
  138. */ 
  139. public function load_activate() { 
  140. require_once GMB_CORE_PATH . 'includes/class-gmc-activate.php'; 
  141. require_once GMB_PLUGIN_PATH . 'includes/class-gmb-activate.php'; 
  142.  
  143. /** 
  144. * Load maps admin. 
  145. * @since 2.1.0 
  146. */ 
  147. public function init_map_editor_admin() { 
  148. require_once GMB_CORE_PATH . 'includes/admin/class-gmc-admin.php'; 
  149. require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-admin.php'; 
  150.  
  151. new Google_Maps_Builder_Admin(); 
  152.  
  153. /** 
  154. * Load files needed in both front-end and admin. 
  155. * @since 2.1.0 
  156. */ 
  157. public function load_files() { 
  158.  
  159. require_once GMB_CORE_PATH . 'includes/misc-functions.php'; 
  160. require_once GMB_CORE_PATH . 'includes/admin/class-gmc-settings.php'; 
  161. require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-settings.php'; 
  162.  
  163. require_once GMB_CORE_PATH . 'includes/class-gmc-engine.php'; 
  164. require_once GMB_PLUGIN_PATH . 'includes/class-gmb-engine.php'; 
  165. require_once GMB_CORE_PATH . 'includes/class-gmc-widget.php'; 
  166.  
  167.  
  168. /** 
  169. * Load files that we need in the admin. 
  170. * @since 2.1.0 
  171. */ 
  172. public function load_admin() { 
  173.  
  174. require_once GMB_CORE_PATH . 'includes/admin/class-gmc-core-interface.php'; 
  175.  
  176. //Upgrades. 
  177. require_once GMB_CORE_PATH . 'includes/admin/upgrades/upgrade-functions.php'; 
  178. require_once GMB_CORE_PATH . 'includes/admin/upgrades/upgrades.php'; 
  179. require_once GMB_CORE_PATH . 'includes/admin/system-info.php'; 
  180. require_once GMB_CORE_PATH . 'includes/admin/admin-actions.php'; 
  181.  
  182. //shortcode generator. 
  183. //@todo load conditionally 
  184. require_once GMB_CORE_PATH . 'includes/admin/class-gmc-shortcode-generator.php'; 
  185. require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-shortcode-generator.php'; 
  186. new GMB_Shortcode_Generator(); 
  187.  
  188.  
  189. /** 
  190. * Base classes that need to load first. 
  191. * @since 2.1.0 
  192. */ 
  193. public function include_core_classes() { 
  194. require_once GMB_CORE_PATH . 'includes/class-gmc-asset-paths.php'; 
  195. require_once GMB_CORE_PATH . 'includes/admin/class-gmc-core-interface.php'; 
  196. require_once GMB_CORE_PATH . 'includes/class-gmc-scripts-init.php'; 
  197. require_once GMB_CORE_PATH . 'includes/class-gmc-scripts.php'; 
  198. require_once GMB_CORE_PATH . 'includes/class-gmc-admin-scripts.php'; 
  199. require_once GMB_CORE_PATH . 'includes/class-gmc-frontend-scripts.php'; 
  200.  
  201.