@@ -314,7 +314,7 @@ |
||
| 314 | 314 | * Example: <?php $gmb = Give(); ?> |
| 315 | 315 | * |
| 316 | 316 | * @since 2.0 |
| 317 | - * @return object - The one true Give Instance |
|
| 317 | + * @return Google_Maps_Builder - The one true Give Instance |
|
| 318 | 318 | */ |
| 319 | 319 | function Google_Maps_Builder() { |
| 320 | 320 | return Google_Maps_Builder::instance(); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | // If this file is called directly, abort. |
| 18 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 18 | +if ( ! defined('ABSPATH')) { |
|
| 19 | 19 | exit; |
| 20 | 20 | } |
| 21 | 21 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | //add_action( 'plugins_loaded', array( 'Google_Maps_Builder_Engine', 'get_instance' ) ); |
| 32 | 32 | |
| 33 | 33 | |
| 34 | -if ( ! class_exists( 'Google_Maps_Builder' ) ) : /** |
|
| 34 | +if ( ! class_exists('Google_Maps_Builder')) : /** |
|
| 35 | 35 | * Main Give Class |
| 36 | 36 | * |
| 37 | 37 | * @since 2.0 |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | * @return Google_Maps_Builder |
| 120 | 120 | */ |
| 121 | 121 | public static function instance() { |
| 122 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Google_Maps_Builder ) ) { |
|
| 122 | + if ( ! isset(self::$instance) && ! (self::$instance instanceof Google_Maps_Builder)) { |
|
| 123 | 123 | |
| 124 | 124 | self::$instance = new Google_Maps_Builder(); |
| 125 | 125 | self::$instance->setup_constants(); |
| 126 | 126 | |
| 127 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); |
|
| 127 | + add_action('plugins_loaded', array(self::$instance, 'load_textdomain')); |
|
| 128 | 128 | |
| 129 | 129 | self::$instance->includes(); |
| 130 | 130 | self::$instance->activate = new Google_Maps_Builder_Activate(); |
@@ -132,14 +132,14 @@ discard block |
||
| 132 | 132 | self::$instance->settings = new Google_Maps_Builder_Settings(); |
| 133 | 133 | self::$instance->engine = new Google_Maps_Builder_Engine(); |
| 134 | 134 | |
| 135 | - register_activation_hook( __FILE__, array( self::$instance->activate, 'activation_flush_rewrites' ) ); |
|
| 135 | + register_activation_hook(__FILE__, array(self::$instance->activate, 'activation_flush_rewrites')); |
|
| 136 | 136 | |
| 137 | 137 | // Read plugin meta |
| 138 | 138 | // Check that function get_plugin_data exists |
| 139 | - if ( ! function_exists( 'get_plugin_data' ) ) { |
|
| 140 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
| 139 | + if ( ! function_exists('get_plugin_data')) { |
|
| 140 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
| 141 | 141 | } |
| 142 | - self::$instance->meta = get_plugin_data( GMB_PLUGIN_FILE, false ); |
|
| 142 | + self::$instance->meta = get_plugin_data(GMB_PLUGIN_FILE, false); |
|
| 143 | 143 | |
| 144 | 144 | } |
| 145 | 145 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function __clone() { |
| 160 | 160 | // Cloning instances of the class is forbidden |
| 161 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'gmb' ), '2.0' ); |
|
| 161 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'gmb'), '2.0'); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function __wakeup() { |
| 172 | 172 | // Unserializing instances of the class is forbidden |
| 173 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'gmb' ), '2.0' ); |
|
| 173 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'gmb'), '2.0'); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -184,24 +184,24 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | // Define Constants |
| 186 | 186 | // Plugin Folder Path |
| 187 | - if ( ! defined( 'GMB_PLUGIN_PATH' ) ) { |
|
| 188 | - define( 'GMB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
|
| 187 | + if ( ! defined('GMB_PLUGIN_PATH')) { |
|
| 188 | + define('GMB_PLUGIN_PATH', plugin_dir_path(__FILE__)); |
|
| 189 | 189 | } |
| 190 | 190 | // Plugin Folder URL |
| 191 | - if ( ! defined( 'GMB_PLUGIN_URL' ) ) { |
|
| 192 | - define( 'GMB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|
| 191 | + if ( ! defined('GMB_PLUGIN_URL')) { |
|
| 192 | + define('GMB_PLUGIN_URL', plugin_dir_url(__FILE__)); |
|
| 193 | 193 | } |
| 194 | 194 | // Plugin base |
| 195 | - if ( ! defined( 'GMB_PLUGIN_BASE' ) ) { |
|
| 196 | - define( 'GMB_PLUGIN_BASE', plugin_basename( __FILE__ ) ); |
|
| 195 | + if ( ! defined('GMB_PLUGIN_BASE')) { |
|
| 196 | + define('GMB_PLUGIN_BASE', plugin_basename(__FILE__)); |
|
| 197 | 197 | } |
| 198 | 198 | // Plugin version |
| 199 | - if ( ! defined( 'GMB_VERSION' ) ) { |
|
| 200 | - define( 'GMB_VERSION', '2.0.2' ); |
|
| 199 | + if ( ! defined('GMB_VERSION')) { |
|
| 200 | + define('GMB_VERSION', '2.0.2'); |
|
| 201 | 201 | } |
| 202 | 202 | // Plugin Root File |
| 203 | - if ( ! defined( 'GMB_PLUGIN_FILE' ) ) { |
|
| 204 | - define( 'GMB_PLUGIN_FILE', __FILE__ ); |
|
| 203 | + if ( ! defined('GMB_PLUGIN_FILE')) { |
|
| 204 | + define('GMB_PLUGIN_FILE', __FILE__); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | private function includes() { |
| 217 | 217 | |
| 218 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-activate.php'; |
|
| 218 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-activate.php'; |
|
| 219 | 219 | |
| 220 | 220 | /** |
| 221 | 221 | * Get the CMB2 bootstrap! |
@@ -223,31 +223,31 @@ discard block |
||
| 223 | 223 | * @description: Checks to see if CMB2 plugin is installed first the uses included CMB2; 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 |
| 224 | 224 | * |
| 225 | 225 | */ |
| 226 | - if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
| 227 | - require_once WP_PLUGIN_DIR . '/cmb2/init.php'; |
|
| 228 | - } elseif ( file_exists( GMB_PLUGIN_PATH . '/includes/libraries/metabox/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
| 229 | - require_once GMB_PLUGIN_PATH . '/includes/libraries/metabox/init.php'; |
|
| 230 | - } elseif ( file_exists( GMB_PLUGIN_PATH . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
| 231 | - require_once GMB_PLUGIN_PATH . '/includes/libraries/CMB2/init.php'; |
|
| 226 | + if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) { |
|
| 227 | + require_once WP_PLUGIN_DIR.'/cmb2/init.php'; |
|
| 228 | + } elseif (file_exists(GMB_PLUGIN_PATH.'/includes/libraries/metabox/init.php') && ! defined('CMB2_LOADED')) { |
|
| 229 | + require_once GMB_PLUGIN_PATH.'/includes/libraries/metabox/init.php'; |
|
| 230 | + } elseif (file_exists(GMB_PLUGIN_PATH.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) { |
|
| 231 | + require_once GMB_PLUGIN_PATH.'/includes/libraries/CMB2/init.php'; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-scripts.php'; |
|
| 235 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-widget.php'; |
|
| 236 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-engine.php'; |
|
| 237 | - require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-settings.php'; |
|
| 238 | - require_once GMB_PLUGIN_PATH . 'includes/misc-functions.php'; |
|
| 234 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-scripts.php'; |
|
| 235 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-widget.php'; |
|
| 236 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-engine.php'; |
|
| 237 | + require_once GMB_PLUGIN_PATH.'includes/admin/class-gmb-settings.php'; |
|
| 238 | + require_once GMB_PLUGIN_PATH.'includes/misc-functions.php'; |
|
| 239 | 239 | |
| 240 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
| 240 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
| 241 | 241 | |
| 242 | 242 | //Upgrades |
| 243 | - require_once GMB_PLUGIN_PATH . 'includes/admin/upgrades/upgrade-functions.php'; |
|
| 244 | - require_once GMB_PLUGIN_PATH . 'includes/admin/upgrades/upgrades.php'; |
|
| 243 | + require_once GMB_PLUGIN_PATH.'includes/admin/upgrades/upgrade-functions.php'; |
|
| 244 | + require_once GMB_PLUGIN_PATH.'includes/admin/upgrades/upgrades.php'; |
|
| 245 | 245 | |
| 246 | 246 | //Admin |
| 247 | - require_once GMB_PLUGIN_PATH . 'includes/admin/admin-actions.php'; |
|
| 248 | - require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-admin.php'; |
|
| 249 | - require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-shortcode-generator.php'; |
|
| 250 | - require_once GMB_PLUGIN_PATH . 'includes/admin/system-info.php'; |
|
| 247 | + require_once GMB_PLUGIN_PATH.'includes/admin/admin-actions.php'; |
|
| 248 | + require_once GMB_PLUGIN_PATH.'includes/admin/class-gmb-admin.php'; |
|
| 249 | + require_once GMB_PLUGIN_PATH.'includes/admin/class-gmb-shortcode-generator.php'; |
|
| 250 | + require_once GMB_PLUGIN_PATH.'includes/admin/system-info.php'; |
|
| 251 | 251 | |
| 252 | 252 | } |
| 253 | 253 | |
@@ -262,26 +262,26 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function load_textdomain() { |
| 264 | 264 | // Set filter for Give's languages directory |
| 265 | - $gmb_lang_dir = dirname( plugin_basename( GMB_PLUGIN_FILE ) ) . '/languages/'; |
|
| 266 | - $gmb_lang_dir = apply_filters( 'gmb_languages_directory', $gmb_lang_dir ); |
|
| 265 | + $gmb_lang_dir = dirname(plugin_basename(GMB_PLUGIN_FILE)).'/languages/'; |
|
| 266 | + $gmb_lang_dir = apply_filters('gmb_languages_directory', $gmb_lang_dir); |
|
| 267 | 267 | |
| 268 | 268 | // Traditional WordPress plugin locale filter |
| 269 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'gmb' ); |
|
| 270 | - $mofile = sprintf( '%1$s-%2$s.mo', 'gmb', $locale ); |
|
| 269 | + $locale = apply_filters('plugin_locale', get_locale(), 'gmb'); |
|
| 270 | + $mofile = sprintf('%1$s-%2$s.mo', 'gmb', $locale); |
|
| 271 | 271 | |
| 272 | 272 | // Setup paths to current locale file |
| 273 | - $mofile_local = $gmb_lang_dir . $mofile; |
|
| 274 | - $mofile_global = WP_LANG_DIR . '/gmb/' . $mofile; |
|
| 273 | + $mofile_local = $gmb_lang_dir.$mofile; |
|
| 274 | + $mofile_global = WP_LANG_DIR.'/gmb/'.$mofile; |
|
| 275 | 275 | |
| 276 | - if ( file_exists( $mofile_global ) ) { |
|
| 276 | + if (file_exists($mofile_global)) { |
|
| 277 | 277 | // Look in global /wp-content/languages/gmb folder |
| 278 | - load_textdomain( 'gmb', $mofile_global ); |
|
| 279 | - } elseif ( file_exists( $mofile_local ) ) { |
|
| 278 | + load_textdomain('gmb', $mofile_global); |
|
| 279 | + } elseif (file_exists($mofile_local)) { |
|
| 280 | 280 | // Look in local /wp-content/plugins/gmb/languages/ folder |
| 281 | - load_textdomain( 'gmb', $mofile_local ); |
|
| 281 | + load_textdomain('gmb', $mofile_local); |
|
| 282 | 282 | } else { |
| 283 | 283 | // Load the default language files |
| 284 | - load_plugin_textdomain( 'gmb', false, $gmb_lang_dir ); |
|
| 284 | + load_plugin_textdomain('gmb', false, $gmb_lang_dir); |
|
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
@@ -143,7 +143,6 @@ |
||
| 143 | 143 | * Display the contents of the iframe used when the GPR Shortcode Generator is clicked |
| 144 | 144 | * TinyMCE button is clicked. |
| 145 | 145 | * |
| 146 | - * @param int $ver |
|
| 147 | 146 | * |
| 148 | 147 | * @return int |
| 149 | 148 | */ |
@@ -16,13 +16,13 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | $this->plugin_slug = Google_Maps_Builder()->get_plugin_slug(); |
| 18 | 18 | |
| 19 | - add_action( 'admin_head', array( $this, 'add_shortcode_button' ), 20 ); |
|
| 20 | - add_filter( 'tiny_mce_version', array( $this, 'refresh_mce' ), 20 ); |
|
| 21 | - add_filter( 'mce_external_languages', array( $this, 'add_tinymce_lang' ), 20, 1 ); |
|
| 19 | + add_action('admin_head', array($this, 'add_shortcode_button'), 20); |
|
| 20 | + add_filter('tiny_mce_version', array($this, 'refresh_mce'), 20); |
|
| 21 | + add_filter('mce_external_languages', array($this, 'add_tinymce_lang'), 20, 1); |
|
| 22 | 22 | |
| 23 | 23 | // Tiny MCE button icon |
| 24 | - add_action( 'admin_head', array( $this, 'set_tinymce_button_icon' ) ); |
|
| 25 | - add_action( 'wp_ajax_gmb_shortcode_iframe', array( $this, 'gmb_shortcode_iframe' ), 9 ); |
|
| 24 | + add_action('admin_head', array($this, 'set_tinymce_button_icon')); |
|
| 25 | + add_action('wp_ajax_gmb_shortcode_iframe', array($this, 'gmb_shortcode_iframe'), 9); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -31,22 +31,22 @@ discard block |
||
| 31 | 31 | public function add_shortcode_button() { |
| 32 | 32 | global $post, $pagenow; |
| 33 | 33 | |
| 34 | - if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) { |
|
| 34 | + if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages')) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | //Be sure to not allow on out post type |
| 38 | - if ( ! isset( $post->post_type ) || $post->post_type === 'google_maps' ) { |
|
| 38 | + if ( ! isset($post->post_type) || $post->post_type === 'google_maps') { |
|
| 39 | 39 | return; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) { |
|
| 42 | + if ( ! in_array($pagenow, array('post.php', 'post-new.php'))) { |
|
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // check if WYSIWYG is enabled |
| 47 | - if ( get_user_option( 'rich_editing' ) == 'true' ) { |
|
| 48 | - add_filter( 'mce_external_plugins', array( $this, 'add_shortcode_tinymce_plugin' ), 10 ); |
|
| 49 | - add_filter( 'mce_buttons', array( $this, 'register_shortcode_button' ), 10 ); |
|
| 47 | + if (get_user_option('rich_editing') == 'true') { |
|
| 48 | + add_filter('mce_external_plugins', array($this, 'add_shortcode_tinymce_plugin'), 10); |
|
| 49 | + add_filter('mce_buttons', array($this, 'register_shortcode_button'), 10); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @return array |
| 59 | 59 | */ |
| 60 | - public function add_tinymce_lang( $arr ) { |
|
| 61 | - $arr['gmb_shortcode_button'] = GMB_PLUGIN_PATH . '/includes/admin/shortcode-generator-i18n.php'; |
|
| 60 | + public function add_tinymce_lang($arr) { |
|
| 61 | + $arr['gmb_shortcode_button'] = GMB_PLUGIN_PATH.'/includes/admin/shortcode-generator-i18n.php'; |
|
| 62 | 62 | |
| 63 | 63 | return $arr; |
| 64 | 64 | } |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return array |
| 72 | 72 | */ |
| 73 | - public function register_shortcode_button( $buttons ) { |
|
| 73 | + public function register_shortcode_button($buttons) { |
|
| 74 | 74 | |
| 75 | - array_push( $buttons, '|', 'gmb_shortcode_button' ); |
|
| 75 | + array_push($buttons, '|', 'gmb_shortcode_button'); |
|
| 76 | 76 | |
| 77 | 77 | return $buttons; |
| 78 | 78 | } |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @return array |
| 86 | 86 | */ |
| 87 | - public function add_shortcode_tinymce_plugin( $plugin_array ) { |
|
| 87 | + public function add_shortcode_tinymce_plugin($plugin_array) { |
|
| 88 | 88 | |
| 89 | - $plugin_array['gmb_shortcode_button'] = GMB_PLUGIN_URL . 'assets/js/admin/admin-shortcode.js'; |
|
| 89 | + $plugin_array['gmb_shortcode_button'] = GMB_PLUGIN_URL.'assets/js/admin/admin-shortcode.js'; |
|
| 90 | 90 | |
| 91 | 91 | return $plugin_array; |
| 92 | 92 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * |
| 99 | 99 | * @return int |
| 100 | 100 | */ |
| 101 | - public function refresh_mce( $ver ) { |
|
| 101 | + public function refresh_mce($ver) { |
|
| 102 | 102 | $ver += 3; |
| 103 | 103 | |
| 104 | 104 | return $ver; |
@@ -148,12 +148,12 @@ discard block |
||
| 148 | 148 | * @return int |
| 149 | 149 | */ |
| 150 | 150 | public static function gmb_shortcode_iframe() { |
| 151 | - set_current_screen( 'google-maps-builder' ); |
|
| 152 | - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
|
| 151 | + set_current_screen('google-maps-builder'); |
|
| 152 | + $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; |
|
| 153 | 153 | |
| 154 | 154 | //Shortcode Generator Specific JS |
| 155 | - wp_register_script( 'gmb-shortcode-generator', GMB_PLUGIN_URL . 'assets/js/admin/shortcode-iframe' . $suffix . '.js', array( 'jquery' ) ); |
|
| 156 | - wp_enqueue_script( 'gmb-shortcode-generator' ); |
|
| 155 | + wp_register_script('gmb-shortcode-generator', GMB_PLUGIN_URL.'assets/js/admin/shortcode-iframe'.$suffix.'.js', array('jquery')); |
|
| 156 | + wp_enqueue_script('gmb-shortcode-generator'); |
|
| 157 | 157 | |
| 158 | 158 | iframe_header(); ?> |
| 159 | 159 | |
@@ -209,31 +209,31 @@ discard block |
||
| 209 | 209 | </style> |
| 210 | 210 | <div class="wrap" id="gmb-wrap"> |
| 211 | 211 | <form id="gmb_settings" style="float: left; width: 100%;"> |
| 212 | - <?php do_action( 'gmb_shortcode_iframe_before' ); ?> |
|
| 212 | + <?php do_action('gmb_shortcode_iframe_before'); ?> |
|
| 213 | 213 | <fieldset id="gmb_location_lookup_fields" class="gmb-place-search-wrap clear" style="margin:1em 0;"> |
| 214 | 214 | <div class="gmb-map-select"> |
| 215 | - <label for="gmb_location_lookup"><strong><?php _e( 'Choose a Map', 'google-maps-builder' ); ?></strong></label> |
|
| 215 | + <label for="gmb_location_lookup"><strong><?php _e('Choose a Map', 'google-maps-builder'); ?></strong></label> |
|
| 216 | 216 | <?php echo self::maps_dropdown(); ?> |
| 217 | 217 | </div> |
| 218 | 218 | </fieldset> |
| 219 | 219 | |
| 220 | 220 | <div class="updated new-shortcode"> |
| 221 | - <p><?php _e( '<strong>Insert Shortcode</strong>: Select your desired map from the dropdown above then click create shortcode below.', 'google-maps-builder' ); ?></p> |
|
| 221 | + <p><?php _e('<strong>Insert Shortcode</strong>: Select your desired map from the dropdown above then click create shortcode below.', 'google-maps-builder'); ?></p> |
|
| 222 | 222 | </div> |
| 223 | 223 | |
| 224 | 224 | <div class="updated gmb-edit-shortcode" style="display: none;"> |
| 225 | - <p><?php _e( '<strong>Edit Active Shortcode:</strong> Customize the map for this shortcode by modifying the map selection above.', 'google-maps-builder' ); ?></p> |
|
| 225 | + <p><?php _e('<strong>Edit Active Shortcode:</strong> Customize the map for this shortcode by modifying the map selection above.', 'google-maps-builder'); ?></p> |
|
| 226 | 226 | </div> |
| 227 | 227 | |
| 228 | - <?php do_action( 'gmb_shortcode_iframe_after' ); ?> |
|
| 228 | + <?php do_action('gmb_shortcode_iframe_after'); ?> |
|
| 229 | 229 | |
| 230 | 230 | <fieldset class="gmb-shortcode-submit"> |
| 231 | - <input id="gmb_submit" type="submit" class="button-small button-primary" value="<?php _e( 'Create Shortcode', 'google-maps-builder' ); ?>" /> |
|
| 232 | - <input id="gmb_cancel" type="button" class="button-small button-secondary" value="<?php _e( 'Cancel', 'google-maps-builder' ); ?>" /> |
|
| 231 | + <input id="gmb_submit" type="submit" class="button-small button-primary" value="<?php _e('Create Shortcode', 'google-maps-builder'); ?>" /> |
|
| 232 | + <input id="gmb_cancel" type="button" class="button-small button-secondary" value="<?php _e('Cancel', 'google-maps-builder'); ?>" /> |
|
| 233 | 233 | </fieldset> |
| 234 | 234 | |
| 235 | 235 | </form> |
| 236 | - <a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SHORTCODE&utm_campaign=MBF%20Shortcode" class="button button-small shortcode-upsell" target="_blank"><?php _e( 'Go Pro', 'google-maps-builder' ); ?> |
|
| 236 | + <a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SHORTCODE&utm_campaign=MBF%20Shortcode" class="button button-small shortcode-upsell" target="_blank"><?php _e('Go Pro', 'google-maps-builder'); ?> |
|
| 237 | 237 | <span class="dashicons dashicons-external"></span></a> |
| 238 | 238 | </div> |
| 239 | 239 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | * |
| 254 | 254 | * @return string $output Give forms dropdown |
| 255 | 255 | */ |
| 256 | - public static function maps_dropdown( $args = array() ) { |
|
| 256 | + public static function maps_dropdown($args = array()) { |
|
| 257 | 257 | |
| 258 | 258 | $defaults = array( |
| 259 | 259 | 'name' => 'gmb-maps', |
@@ -263,43 +263,43 @@ discard block |
||
| 263 | 263 | 'selected' => 0, |
| 264 | 264 | 'chosen' => false, |
| 265 | 265 | 'number' => 30, |
| 266 | - 'placeholder' => __( 'Select a Map', 'google-maps-builder' ) |
|
| 266 | + 'placeholder' => __('Select a Map', 'google-maps-builder') |
|
| 267 | 267 | ); |
| 268 | 268 | |
| 269 | - $args = wp_parse_args( $args, $defaults ); |
|
| 269 | + $args = wp_parse_args($args, $defaults); |
|
| 270 | 270 | |
| 271 | - $maps = get_posts( array( |
|
| 271 | + $maps = get_posts(array( |
|
| 272 | 272 | 'post_type' => 'google_maps', |
| 273 | 273 | 'orderby' => 'title', |
| 274 | 274 | 'order' => 'ASC', |
| 275 | 275 | 'posts_per_page' => $args['number'] |
| 276 | - ) ); |
|
| 276 | + )); |
|
| 277 | 277 | |
| 278 | 278 | $options = array(); |
| 279 | 279 | |
| 280 | - if ( $maps ) { |
|
| 281 | - $options[0] = __( 'Select a Map', 'google-maps-builder' ); |
|
| 282 | - foreach ( $maps as $map ) { |
|
| 283 | - $options[ absint( $map->ID ) ] = esc_html( $map->post_title ); |
|
| 280 | + if ($maps) { |
|
| 281 | + $options[0] = __('Select a Map', 'google-maps-builder'); |
|
| 282 | + foreach ($maps as $map) { |
|
| 283 | + $options[absint($map->ID)] = esc_html($map->post_title); |
|
| 284 | 284 | } |
| 285 | 285 | } else { |
| 286 | - $options[0] = __( 'No Maps Found', 'google-maps-builder' ); |
|
| 286 | + $options[0] = __('No Maps Found', 'google-maps-builder'); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | // This ensures that any selected maps are included in the drop down |
| 290 | - if ( is_array( $args['selected'] ) ) { |
|
| 291 | - foreach ( $args['selected'] as $item ) { |
|
| 292 | - if ( ! in_array( $item, $options ) ) { |
|
| 293 | - $options[ $item ] = get_the_title( $item ); |
|
| 290 | + if (is_array($args['selected'])) { |
|
| 291 | + foreach ($args['selected'] as $item) { |
|
| 292 | + if ( ! in_array($item, $options)) { |
|
| 293 | + $options[$item] = get_the_title($item); |
|
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | - } elseif ( is_numeric( $args['selected'] ) && $args['selected'] !== 0 ) { |
|
| 297 | - if ( ! in_array( $args['selected'], $options ) ) { |
|
| 298 | - $options[ $args['selected'] ] = get_the_title( $args['selected'] ); |
|
| 296 | + } elseif (is_numeric($args['selected']) && $args['selected'] !== 0) { |
|
| 297 | + if ( ! in_array($args['selected'], $options)) { |
|
| 298 | + $options[$args['selected']] = get_the_title($args['selected']); |
|
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | - $output = self::select( array( |
|
| 302 | + $output = self::select(array( |
|
| 303 | 303 | 'name' => $args['name'], |
| 304 | 304 | 'selected' => $args['selected'], |
| 305 | 305 | 'id' => $args['id'], |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | 'placeholder' => $args['placeholder'], |
| 311 | 311 | 'show_option_all' => false, |
| 312 | 312 | 'show_option_none' => false |
| 313 | - ) ); |
|
| 313 | + )); |
|
| 314 | 314 | |
| 315 | 315 | return $output; |
| 316 | 316 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | * |
| 326 | 326 | * @return string |
| 327 | 327 | */ |
| 328 | - public static function select( $args = array() ) { |
|
| 328 | + public static function select($args = array()) { |
|
| 329 | 329 | |
| 330 | 330 | $defaults = array( |
| 331 | 331 | 'options' => array(), |
@@ -336,59 +336,59 @@ discard block |
||
| 336 | 336 | 'chosen' => false, |
| 337 | 337 | 'placeholder' => null, |
| 338 | 338 | 'multiple' => false, |
| 339 | - 'show_option_all' => _x( 'All', 'all dropdown items', 'google-maps-builder' ), |
|
| 340 | - 'show_option_none' => _x( 'None', 'no dropdown items', 'google-maps-builder' ) |
|
| 339 | + 'show_option_all' => _x('All', 'all dropdown items', 'google-maps-builder'), |
|
| 340 | + 'show_option_none' => _x('None', 'no dropdown items', 'google-maps-builder') |
|
| 341 | 341 | ); |
| 342 | 342 | |
| 343 | - $args = wp_parse_args( $args, $defaults ); |
|
| 343 | + $args = wp_parse_args($args, $defaults); |
|
| 344 | 344 | |
| 345 | - if ( $args['multiple'] ) { |
|
| 345 | + if ($args['multiple']) { |
|
| 346 | 346 | $multiple = ' MULTIPLE'; |
| 347 | 347 | } else { |
| 348 | 348 | $multiple = ''; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - if ( $args['chosen'] ) { |
|
| 351 | + if ($args['chosen']) { |
|
| 352 | 352 | $args['class'] .= 'gmb-select-chosen'; |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | - if ( $args['placeholder'] ) { |
|
| 355 | + if ($args['placeholder']) { |
|
| 356 | 356 | $placeholder = $args['placeholder']; |
| 357 | 357 | } else { |
| 358 | 358 | $placeholder = ''; |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - $output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( sanitize_key( str_replace( '-', '_', $args['id'] ) ) ) . '" class="gmb-select ' . esc_attr( $args['class'] ) . '"' . $multiple . ' data-placeholder="' . $placeholder . '">'; |
|
| 361 | + $output = '<select name="'.esc_attr($args['name']).'" id="'.esc_attr(sanitize_key(str_replace('-', '_', $args['id']))).'" class="gmb-select '.esc_attr($args['class']).'"'.$multiple.' data-placeholder="'.$placeholder.'">'; |
|
| 362 | 362 | |
| 363 | - if ( $args['show_option_all'] ) { |
|
| 364 | - if ( $args['multiple'] ) { |
|
| 365 | - $selected = selected( true, in_array( 0, $args['selected'] ), false ); |
|
| 363 | + if ($args['show_option_all']) { |
|
| 364 | + if ($args['multiple']) { |
|
| 365 | + $selected = selected(true, in_array(0, $args['selected']), false); |
|
| 366 | 366 | } else { |
| 367 | - $selected = selected( $args['selected'], 0, false ); |
|
| 367 | + $selected = selected($args['selected'], 0, false); |
|
| 368 | 368 | } |
| 369 | - $output .= '<option value="all"' . $selected . '>' . esc_html( $args['show_option_all'] ) . '</option>'; |
|
| 369 | + $output .= '<option value="all"'.$selected.'>'.esc_html($args['show_option_all']).'</option>'; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - if ( ! empty( $args['options'] ) ) { |
|
| 372 | + if ( ! empty($args['options'])) { |
|
| 373 | 373 | |
| 374 | - if ( $args['show_option_none'] ) { |
|
| 375 | - if ( $args['multiple'] ) { |
|
| 376 | - $selected = selected( true, in_array( - 1, $args['selected'] ), false ); |
|
| 374 | + if ($args['show_option_none']) { |
|
| 375 | + if ($args['multiple']) { |
|
| 376 | + $selected = selected(true, in_array( - 1, $args['selected'] ), false); |
|
| 377 | 377 | } else { |
| 378 | - $selected = selected( $args['selected'], - 1, false ); |
|
| 378 | + $selected = selected($args['selected'], - 1, false); |
|
| 379 | 379 | } |
| 380 | - $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>'; |
|
| 380 | + $output .= '<option value="-1"'.$selected.'>'.esc_html($args['show_option_none']).'</option>'; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - foreach ( $args['options'] as $key => $option ) { |
|
| 383 | + foreach ($args['options'] as $key => $option) { |
|
| 384 | 384 | |
| 385 | - if ( $args['multiple'] && is_array( $args['selected'] ) ) { |
|
| 386 | - $selected = selected( true, in_array( $key, $args['selected'] ), false ); |
|
| 385 | + if ($args['multiple'] && is_array($args['selected'])) { |
|
| 386 | + $selected = selected(true, in_array($key, $args['selected']), false); |
|
| 387 | 387 | } else { |
| 388 | - $selected = selected( $args['selected'], $key, false ); |
|
| 388 | + $selected = selected($args['selected'], $key, false); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | - $output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>'; |
|
| 391 | + $output .= '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option).'</option>'; |
|
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | * |
| 129 | 129 | * @description: Determine if Google Maps API script has already been loaded |
| 130 | 130 | * @since : 1.0.3 |
| 131 | - * @return bool $multiple_google_maps_api |
|
| 131 | + * @return false|null $multiple_google_maps_api |
|
| 132 | 132 | */ |
| 133 | 133 | function check_for_multiple_google_maps_api_calls() { |
| 134 | 134 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -32,23 +32,23 @@ discard block |
||
| 32 | 32 | $this->plugin_slug = Google_Maps_Builder()->get_plugin_slug(); |
| 33 | 33 | |
| 34 | 34 | //Frontend |
| 35 | - add_action( 'wp_enqueue_scripts', array( $this, 'load_frontend_scripts' ), 11 ); |
|
| 35 | + add_action('wp_enqueue_scripts', array($this, 'load_frontend_scripts'), 11); |
|
| 36 | 36 | |
| 37 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_styles' ) ); |
|
| 37 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_frontend_styles')); |
|
| 38 | 38 | |
| 39 | - add_action( 'wp_print_scripts', array( $this, 'check_for_multiple_google_maps_api_calls' ) ); |
|
| 39 | + add_action('wp_print_scripts', array($this, 'check_for_multiple_google_maps_api_calls')); |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | //Admin |
| 43 | - add_action( 'admin_init', array( $this, 'multiple_maps_enqueued_warning_ignore' ) ); |
|
| 43 | + add_action('admin_init', array($this, 'multiple_maps_enqueued_warning_ignore')); |
|
| 44 | 44 | |
| 45 | - add_action( 'admin_notices', array( $this, 'multiple_maps_enqueued_warning' ) ); |
|
| 45 | + add_action('admin_notices', array($this, 'multiple_maps_enqueued_warning')); |
|
| 46 | 46 | |
| 47 | - add_action( 'admin_head', array( $this, 'icon_style' ) ); |
|
| 47 | + add_action('admin_head', array($this, 'icon_style')); |
|
| 48 | 48 | |
| 49 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) ); |
|
| 49 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles')); |
|
| 50 | 50 | |
| 51 | - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) ); |
|
| 51 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts')); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -69,35 +69,35 @@ discard block |
||
| 69 | 69 | function load_frontend_scripts() { |
| 70 | 70 | |
| 71 | 71 | //Google Maps API |
| 72 | - $google_maps_settings = get_option( 'gmb_settings' ); |
|
| 72 | + $google_maps_settings = get_option('gmb_settings'); |
|
| 73 | 73 | $google_maps_api_url_args = array( |
| 74 | 74 | 'sensor' => 'false', |
| 75 | 75 | 'libraries' => 'places' |
| 76 | 76 | ); |
| 77 | 77 | //Google Maps API key present? |
| 78 | - if ( ! empty( $google_maps_settings['gmb_maps_api_key'] ) ) { |
|
| 78 | + if ( ! empty($google_maps_settings['gmb_maps_api_key'])) { |
|
| 79 | 79 | $google_maps_api_url_args['key'] = $google_maps_settings['gmb_maps_api_key']; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $google_maps_api_url = add_query_arg( $google_maps_api_url_args, 'https://maps.googleapis.com/maps/api/js?v=3.exp' ); |
|
| 82 | + $google_maps_api_url = add_query_arg($google_maps_api_url_args, 'https://maps.googleapis.com/maps/api/js?v=3.exp'); |
|
| 83 | 83 | |
| 84 | - wp_register_script( 'google-maps-builder-gmaps', $google_maps_api_url, array( 'jquery' ), false, true ); |
|
| 85 | - wp_enqueue_script( 'google-maps-builder-gmaps' ); |
|
| 84 | + wp_register_script('google-maps-builder-gmaps', $google_maps_api_url, array('jquery'), false, true); |
|
| 85 | + wp_enqueue_script('google-maps-builder-gmaps'); |
|
| 86 | 86 | |
| 87 | 87 | |
| 88 | - $js_dir = GMB_PLUGIN_URL . 'assets/js/frontend/'; |
|
| 89 | - $js_plugins = GMB_PLUGIN_URL . 'assets/js/plugins/'; |
|
| 90 | - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
|
| 88 | + $js_dir = GMB_PLUGIN_URL.'assets/js/frontend/'; |
|
| 89 | + $js_plugins = GMB_PLUGIN_URL.'assets/js/plugins/'; |
|
| 90 | + $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; |
|
| 91 | 91 | |
| 92 | 92 | // Use minified libraries if SCRIPT_DEBUG is turned off |
| 93 | - wp_register_script( $this->plugin_slug . '-plugin-script', $js_dir . 'google-maps-builder' . $suffix . '.js', array( 'jquery' ), GMB_VERSION, true ); |
|
| 94 | - wp_register_script( 'google-maps-builder-maps-icons', GMB_PLUGIN_URL . 'includes/libraries/map-icons/js/map-icons.js', array( 'jquery' ), GMB_VERSION, true ); |
|
| 93 | + wp_register_script($this->plugin_slug.'-plugin-script', $js_dir.'google-maps-builder'.$suffix.'.js', array('jquery'), GMB_VERSION, true); |
|
| 94 | + wp_register_script('google-maps-builder-maps-icons', GMB_PLUGIN_URL.'includes/libraries/map-icons/js/map-icons.js', array('jquery'), GMB_VERSION, true); |
|
| 95 | 95 | |
| 96 | - wp_enqueue_script( 'google-maps-builder-gmaps' ); |
|
| 97 | - wp_enqueue_script( 'google-maps-builder-plugin-script' ); |
|
| 98 | - wp_enqueue_script( 'google-maps-builder-maps-icons' ); |
|
| 96 | + wp_enqueue_script('google-maps-builder-gmaps'); |
|
| 97 | + wp_enqueue_script('google-maps-builder-plugin-script'); |
|
| 98 | + wp_enqueue_script('google-maps-builder-maps-icons'); |
|
| 99 | 99 | |
| 100 | - wp_localize_script( $this->plugin_slug . '-plugin-script', 'gmb_data', array() ); |
|
| 100 | + wp_localize_script($this->plugin_slug.'-plugin-script', 'gmb_data', array()); |
|
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | } |
@@ -111,13 +111,13 @@ discard block |
||
| 111 | 111 | function enqueue_frontend_styles() { |
| 112 | 112 | |
| 113 | 113 | //Plugin Frontend Styles |
| 114 | - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
|
| 114 | + $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; |
|
| 115 | 115 | |
| 116 | - wp_register_style( 'google-maps-builder-plugin-styles', GMB_PLUGIN_URL . 'assets/css/google-maps-builder' . $suffix . '.css', array(), GMB_VERSION ); |
|
| 117 | - wp_enqueue_style( 'google-maps-builder-plugin-styles' ); |
|
| 116 | + wp_register_style('google-maps-builder-plugin-styles', GMB_PLUGIN_URL.'assets/css/google-maps-builder'.$suffix.'.css', array(), GMB_VERSION); |
|
| 117 | + wp_enqueue_style('google-maps-builder-plugin-styles'); |
|
| 118 | 118 | |
| 119 | - wp_register_style( 'google-maps-builder-map-icons', GMB_PLUGIN_URL . 'includes/libraries/map-icons/css/map-icons.css', array(), GMB_VERSION ); |
|
| 120 | - wp_enqueue_style( 'google-maps-builder-map-icons' ); |
|
| 119 | + wp_register_style('google-maps-builder-map-icons', GMB_PLUGIN_URL.'includes/libraries/map-icons/css/map-icons.css', array(), GMB_VERSION); |
|
| 120 | + wp_enqueue_style('google-maps-builder-map-icons'); |
|
| 121 | 121 | |
| 122 | 122 | |
| 123 | 123 | } |
@@ -134,27 +134,27 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | global $wp_scripts; |
| 136 | 136 | |
| 137 | - if ( ! $wp_scripts ) { |
|
| 137 | + if ( ! $wp_scripts) { |
|
| 138 | 138 | return false; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | //loop through registered scripts |
| 142 | - foreach ( $wp_scripts->registered as $registered_script ) { |
|
| 142 | + foreach ($wp_scripts->registered as $registered_script) { |
|
| 143 | 143 | //find any that have the google script as the source, ensure it's not enqueud by this plugin |
| 144 | 144 | if ( |
| 145 | - strpos( $registered_script->src, 'maps.googleapis.com/maps/api/js' ) !== false && |
|
| 146 | - strpos( $registered_script->handle, 'google-maps-builder' ) === false |
|
| 145 | + strpos($registered_script->src, 'maps.googleapis.com/maps/api/js') !== false && |
|
| 146 | + strpos($registered_script->handle, 'google-maps-builder') === false |
|
| 147 | 147 | ) { |
| 148 | 148 | |
| 149 | 149 | //Remove this script from loading |
| 150 | - wp_deregister_script( $registered_script->handle ); |
|
| 151 | - wp_dequeue_script( $registered_script->handle ); |
|
| 150 | + wp_deregister_script($registered_script->handle); |
|
| 151 | + wp_dequeue_script($registered_script->handle); |
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | $this->google_maps_conflict = true; |
| 155 | 155 | //ensure we can detect scripts on the frontend from backend; we'll use an option to do this |
| 156 | - if ( ! is_admin() ) { |
|
| 157 | - update_option( 'gmb_google_maps_conflict', true ); |
|
| 156 | + if ( ! is_admin()) { |
|
| 157 | + update_option('gmb_google_maps_conflict', true); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | } |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | //Ensure that if user resolved conflict on frontend we remove the option flag |
| 165 | - if ( $this->google_maps_conflict === false && ! is_admin() ) { |
|
| 166 | - update_option( 'gmb_google_maps_conflict', false ); |
|
| 165 | + if ($this->google_maps_conflict === false && ! is_admin()) { |
|
| 166 | + update_option('gmb_google_maps_conflict', false); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | } |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | global $current_user; |
| 179 | 179 | $user_id = $current_user->ID; |
| 180 | 180 | /* If user clicks to ignore the notice, add that to their user meta */ |
| 181 | - if ( isset( $_GET['gmb_ignore_maps_notice'] ) && $_GET['gmb_ignore_maps_notice'] == '0' ) { |
|
| 182 | - add_user_meta( $user_id, 'gmb_ignore_maps_notice', 'true', true ); |
|
| 181 | + if (isset($_GET['gmb_ignore_maps_notice']) && $_GET['gmb_ignore_maps_notice'] == '0') { |
|
| 182 | + add_user_meta($user_id, 'gmb_ignore_maps_notice', 'true', true); |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
@@ -198,18 +198,18 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | global $current_user; |
| 200 | 200 | $user_id = $current_user->ID; |
| 201 | - $gmb_google_maps_conflict = get_option( 'gmb_google_maps_conflict' ); |
|
| 201 | + $gmb_google_maps_conflict = get_option('gmb_google_maps_conflict'); |
|
| 202 | 202 | |
| 203 | 203 | // Check that the user hasn't already clicked to ignore the message and that they have appropriate permissions |
| 204 | 204 | // And, most importantly, that Google Maps are actually being enqueued twice |
| 205 | - if ( ! get_user_meta( $user_id, 'gmb_ignore_maps_notice' ) && current_user_can( 'install_plugins' ) && $this->google_maps_conflict === true || ! get_user_meta( $user_id, 'gmb_ignore_maps_notice' ) && current_user_can( 'install_plugins' ) && $gmb_google_maps_conflict === '1' ) { |
|
| 205 | + if ( ! get_user_meta($user_id, 'gmb_ignore_maps_notice') && current_user_can('install_plugins') && $this->google_maps_conflict === true || ! get_user_meta($user_id, 'gmb_ignore_maps_notice') && current_user_can('install_plugins') && $gmb_google_maps_conflict === '1') { |
|
| 206 | 206 | |
| 207 | 207 | echo '<div class="updated error clearfix"><p>'; |
| 208 | - parse_str( $_SERVER['QUERY_STRING'], $params ); |
|
| 209 | - _e( '<strong>Google Maps API Conflict Detected:</strong> It appears that a plugin or theme that you are using is also including the Google Maps API JavaScript on your website. This means there may be a conflict with the Maps Builder plugin. Please verify your maps are functioning properly prior to dismissing this notice.' ); |
|
| 208 | + parse_str($_SERVER['QUERY_STRING'], $params); |
|
| 209 | + _e('<strong>Google Maps API Conflict Detected:</strong> It appears that a plugin or theme that you are using is also including the Google Maps API JavaScript on your website. This means there may be a conflict with the Maps Builder plugin. Please verify your maps are functioning properly prior to dismissing this notice.'); |
|
| 210 | 210 | echo '</p>'; |
| 211 | 211 | |
| 212 | - printf( __( '<a href="%1$s" rel="nofollow" class="button" style="display:inline-block; margin: 0 0 10px;">Hide Warning</a>' ), '?' . http_build_query( array_merge( $params, array( 'gmb_ignore_maps_notice' => '0' ) ) ) ); |
|
| 212 | + printf(__('<a href="%1$s" rel="nofollow" class="button" style="display:inline-block; margin: 0 0 10px;">Hide Warning</a>'), '?'.http_build_query(array_merge($params, array('gmb_ignore_maps_notice' => '0')))); |
|
| 213 | 213 | |
| 214 | 214 | echo '</div>'; |
| 215 | 215 | |
@@ -245,19 +245,19 @@ discard block |
||
| 245 | 245 | * @return null |
| 246 | 246 | * |
| 247 | 247 | */ |
| 248 | - function enqueue_admin_styles( $hook ) { |
|
| 248 | + function enqueue_admin_styles($hook) { |
|
| 249 | 249 | |
| 250 | 250 | global $post; |
| 251 | - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
|
| 251 | + $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; |
|
| 252 | 252 | |
| 253 | 253 | //Only enqueue scripts for CPT on post type screen |
| 254 | - if ( ( $hook == 'post-new.php' || $hook == 'post.php' ) && 'google_maps' === $post->post_type || $hook == 'google_maps_page_gmb_settings' ) { |
|
| 254 | + if (($hook == 'post-new.php' || $hook == 'post.php') && 'google_maps' === $post->post_type || $hook == 'google_maps_page_gmb_settings') { |
|
| 255 | 255 | |
| 256 | - wp_register_style( $this->plugin_slug . '-admin-styles', GMB_PLUGIN_URL . 'assets/css/gmb-admin' . $suffix . '.css', array(), GMB_VERSION ); |
|
| 257 | - wp_enqueue_style( $this->plugin_slug . '-admin-styles' ); |
|
| 256 | + wp_register_style($this->plugin_slug.'-admin-styles', GMB_PLUGIN_URL.'assets/css/gmb-admin'.$suffix.'.css', array(), GMB_VERSION); |
|
| 257 | + wp_enqueue_style($this->plugin_slug.'-admin-styles'); |
|
| 258 | 258 | |
| 259 | - wp_register_style( $this->plugin_slug . '-map-icons', GMB_PLUGIN_URL . 'includes/libraries/map-icons/css/map-icons.css', array(), GMB_VERSION ); |
|
| 260 | - wp_enqueue_style( $this->plugin_slug . '-map-icons' ); |
|
| 259 | + wp_register_style($this->plugin_slug.'-map-icons', GMB_PLUGIN_URL.'includes/libraries/map-icons/css/map-icons.css', array(), GMB_VERSION); |
|
| 260 | + wp_enqueue_style($this->plugin_slug.'-map-icons'); |
|
| 261 | 261 | |
| 262 | 262 | } |
| 263 | 263 | |
@@ -272,100 +272,100 @@ discard block |
||
| 272 | 272 | * |
| 273 | 273 | * @return null Return early if no settings page is registered. |
| 274 | 274 | */ |
| 275 | - function enqueue_admin_scripts( $hook ) { |
|
| 275 | + function enqueue_admin_scripts($hook) { |
|
| 276 | 276 | global $post; |
| 277 | - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
|
| 277 | + $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; |
|
| 278 | 278 | |
| 279 | - $js_dir = GMB_PLUGIN_URL . 'assets/js/admin/'; |
|
| 280 | - $js_plugins = GMB_PLUGIN_URL . 'assets/js/plugins/'; |
|
| 279 | + $js_dir = GMB_PLUGIN_URL.'assets/js/admin/'; |
|
| 280 | + $js_plugins = GMB_PLUGIN_URL.'assets/js/plugins/'; |
|
| 281 | 281 | |
| 282 | 282 | //Builder Google Maps API URL |
| 283 | - $google_maps_api_key = gmb_get_option( 'gmb_maps_api_key' ); |
|
| 283 | + $google_maps_api_key = gmb_get_option('gmb_maps_api_key'); |
|
| 284 | 284 | $google_maps_api_url_args = array( |
| 285 | 285 | 'sensor' => 'false', |
| 286 | 286 | 'libraries' => 'places' |
| 287 | 287 | ); |
| 288 | 288 | //Google Maps API key present? |
| 289 | - if ( ! empty( $google_maps_api_key ) ) { |
|
| 289 | + if ( ! empty($google_maps_api_key)) { |
|
| 290 | 290 | $google_maps_api_url_args['key'] = $google_maps_api_key; |
| 291 | 291 | } |
| 292 | - $google_maps_api_url = add_query_arg( $google_maps_api_url_args, 'https://maps.googleapis.com/maps/api/js?v=3.exp' ); |
|
| 292 | + $google_maps_api_url = add_query_arg($google_maps_api_url_args, 'https://maps.googleapis.com/maps/api/js?v=3.exp'); |
|
| 293 | 293 | |
| 294 | 294 | //Only enqueue scripts for CPT on post type screen |
| 295 | - if ( ( $hook == 'post-new.php' || $hook == 'post.php' ) && 'google_maps' === $post->post_type ) { |
|
| 295 | + if (($hook == 'post-new.php' || $hook == 'post.php') && 'google_maps' === $post->post_type) { |
|
| 296 | 296 | |
| 297 | - wp_enqueue_style( 'wp-color-picker' ); |
|
| 297 | + wp_enqueue_style('wp-color-picker'); |
|
| 298 | 298 | |
| 299 | - wp_register_script( $this->plugin_slug . '-admin-magnific-popup', $js_plugins . 'gmb-magnific' . $suffix . '.js', array( 'jquery' ), GMB_VERSION ); |
|
| 300 | - wp_enqueue_script( $this->plugin_slug . '-admin-magnific-popup' ); |
|
| 299 | + wp_register_script($this->plugin_slug.'-admin-magnific-popup', $js_plugins.'gmb-magnific'.$suffix.'.js', array('jquery'), GMB_VERSION); |
|
| 300 | + wp_enqueue_script($this->plugin_slug.'-admin-magnific-popup'); |
|
| 301 | 301 | |
| 302 | - wp_register_script( $this->plugin_slug . '-admin-gmaps', $google_maps_api_url, array( 'jquery' ) ); |
|
| 303 | - wp_enqueue_script( $this->plugin_slug . '-admin-gmaps' ); |
|
| 302 | + wp_register_script($this->plugin_slug.'-admin-gmaps', $google_maps_api_url, array('jquery')); |
|
| 303 | + wp_enqueue_script($this->plugin_slug.'-admin-gmaps'); |
|
| 304 | 304 | |
| 305 | - wp_register_script( $this->plugin_slug . '-map-icons', GMB_PLUGIN_URL . 'includes/libraries/map-icons/js/map-icons.js', array( 'jquery' ) ); |
|
| 306 | - wp_enqueue_script( $this->plugin_slug . '-map-icons' ); |
|
| 305 | + wp_register_script($this->plugin_slug.'-map-icons', GMB_PLUGIN_URL.'includes/libraries/map-icons/js/map-icons.js', array('jquery')); |
|
| 306 | + wp_enqueue_script($this->plugin_slug.'-map-icons'); |
|
| 307 | 307 | |
| 308 | - wp_register_script( $this->plugin_slug . '-admin-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GMB_VERSION, true ); |
|
| 309 | - wp_enqueue_script( $this->plugin_slug . '-admin-qtip' ); |
|
| 308 | + wp_register_script($this->plugin_slug.'-admin-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GMB_VERSION, true); |
|
| 309 | + wp_enqueue_script($this->plugin_slug.'-admin-qtip'); |
|
| 310 | 310 | |
| 311 | 311 | //Map base |
| 312 | - wp_register_script( $this->plugin_slug . '-admin-map-builder', $js_dir . 'admin-google-map' . $suffix . '.js', array( |
|
| 312 | + wp_register_script($this->plugin_slug.'-admin-map-builder', $js_dir.'admin-google-map'.$suffix.'.js', array( |
|
| 313 | 313 | 'jquery', |
| 314 | 314 | 'wp-color-picker' |
| 315 | - ), GMB_VERSION ); |
|
| 316 | - wp_enqueue_script( $this->plugin_slug . '-admin-map-builder' ); |
|
| 315 | + ), GMB_VERSION); |
|
| 316 | + wp_enqueue_script($this->plugin_slug.'-admin-map-builder'); |
|
| 317 | 317 | |
| 318 | 318 | //Modal builder |
| 319 | - wp_register_script( $this->plugin_slug . '-admin-magnific-builder', $js_dir . 'admin-maps-magnific' . $suffix . '.js', array( |
|
| 319 | + wp_register_script($this->plugin_slug.'-admin-magnific-builder', $js_dir.'admin-maps-magnific'.$suffix.'.js', array( |
|
| 320 | 320 | 'jquery', |
| 321 | 321 | 'wp-color-picker' |
| 322 | - ), GMB_VERSION ); |
|
| 323 | - wp_enqueue_script( $this->plugin_slug . '-admin-magnific-builder' ); |
|
| 322 | + ), GMB_VERSION); |
|
| 323 | + wp_enqueue_script($this->plugin_slug.'-admin-magnific-builder'); |
|
| 324 | 324 | |
| 325 | 325 | |
| 326 | 326 | //Map Controls |
| 327 | - wp_register_script( $this->plugin_slug . '-admin-map-controls', $js_dir . 'admin-maps-controls' . $suffix . '.js', array( 'jquery' ), GMB_VERSION ); |
|
| 328 | - wp_enqueue_script( $this->plugin_slug . '-admin-map-controls' ); |
|
| 327 | + wp_register_script($this->plugin_slug.'-admin-map-controls', $js_dir.'admin-maps-controls'.$suffix.'.js', array('jquery'), GMB_VERSION); |
|
| 328 | + wp_enqueue_script($this->plugin_slug.'-admin-map-controls'); |
|
| 329 | 329 | |
| 330 | - $api_key = gmb_get_option( 'gmb_maps_api_key' ); |
|
| 331 | - $geolocate = gmb_get_option( 'gmb_lat_lng' ); |
|
| 332 | - $post_status = get_post_status( $post->ID ); |
|
| 330 | + $api_key = gmb_get_option('gmb_maps_api_key'); |
|
| 331 | + $geolocate = gmb_get_option('gmb_lat_lng'); |
|
| 332 | + $post_status = get_post_status($post->ID); |
|
| 333 | 333 | |
| 334 | 334 | $maps_data = array( |
| 335 | 335 | 'api_key' => $api_key, |
| 336 | - 'geolocate_setting' => isset( $geolocate['geolocate_map'] ) ? $geolocate['geolocate_map'] : 'yes', |
|
| 337 | - 'default_lat' => isset( $geolocate['latitude'] ) ? $geolocate['latitude'] : '32.715738', |
|
| 338 | - 'default_lng' => isset( $geolocate['longitude'] ) ? $geolocate['longitude'] : '-117.16108380000003', |
|
| 336 | + 'geolocate_setting' => isset($geolocate['geolocate_map']) ? $geolocate['geolocate_map'] : 'yes', |
|
| 337 | + 'default_lat' => isset($geolocate['latitude']) ? $geolocate['latitude'] : '32.715738', |
|
| 338 | + 'default_lng' => isset($geolocate['longitude']) ? $geolocate['longitude'] : '-117.16108380000003', |
|
| 339 | 339 | 'plugin_url' => GMB_PLUGIN_URL, |
| 340 | - 'default_marker' => apply_filters( 'gmb_default_marker', GMB_PLUGIN_URL . 'assets/img/spotlight-poi.png' ), |
|
| 341 | - 'ajax_loader' => set_url_scheme( apply_filters( 'gmb_ajax_preloader_img', GMB_PLUGIN_URL . 'assets/images/spinner.gif' ), 'relative' ), |
|
| 342 | - 'snazzy' => GMB_PLUGIN_URL . 'assets/js/admin/snazzy.json', |
|
| 343 | - 'modal_default' => gmb_get_option( 'gmb_open_builder' ), |
|
| 340 | + 'default_marker' => apply_filters('gmb_default_marker', GMB_PLUGIN_URL.'assets/img/spotlight-poi.png'), |
|
| 341 | + 'ajax_loader' => set_url_scheme(apply_filters('gmb_ajax_preloader_img', GMB_PLUGIN_URL.'assets/images/spinner.gif'), 'relative'), |
|
| 342 | + 'snazzy' => GMB_PLUGIN_URL.'assets/js/admin/snazzy.json', |
|
| 343 | + 'modal_default' => gmb_get_option('gmb_open_builder'), |
|
| 344 | 344 | 'post_status' => $post_status, |
| 345 | 345 | 'i18n' => array( |
| 346 | - 'update_map' => $post_status == 'publish' ? __( 'Update Map', $this->plugin_slug ) : __( 'Publish Map', $this->plugin_slug ), |
|
| 347 | - 'set_place_types' => __( 'Update Map', $this->plugin_slug ), |
|
| 348 | - 'places_selection_changed' => __( 'Place selections have changed.', $this->plugin_slug ), |
|
| 349 | - 'multiple_places' => __( 'Hmm, it looks like there are multiple places in this area. Please confirm which place you would like this marker to display:', $this->plugin_slug ), |
|
| 350 | - 'btn_drop_marker' => '<span class="dashicons dashicons-location"></span>' . __( 'Drop a Marker', $this->plugin_slug ), |
|
| 351 | - 'btn_drop_marker_click' => __( 'Click on the Map', $this->plugin_slug ), |
|
| 352 | - 'btn_edit_marker' => __( 'Edit Marker', $this->plugin_slug ), |
|
| 353 | - 'btn_delete_marker' => __( 'Delete Marker', $this->plugin_slug ), |
|
| 346 | + 'update_map' => $post_status == 'publish' ? __('Update Map', $this->plugin_slug) : __('Publish Map', $this->plugin_slug), |
|
| 347 | + 'set_place_types' => __('Update Map', $this->plugin_slug), |
|
| 348 | + 'places_selection_changed' => __('Place selections have changed.', $this->plugin_slug), |
|
| 349 | + 'multiple_places' => __('Hmm, it looks like there are multiple places in this area. Please confirm which place you would like this marker to display:', $this->plugin_slug), |
|
| 350 | + 'btn_drop_marker' => '<span class="dashicons dashicons-location"></span>'.__('Drop a Marker', $this->plugin_slug), |
|
| 351 | + 'btn_drop_marker_click' => __('Click on the Map', $this->plugin_slug), |
|
| 352 | + 'btn_edit_marker' => __('Edit Marker', $this->plugin_slug), |
|
| 353 | + 'btn_delete_marker' => __('Delete Marker', $this->plugin_slug), |
|
| 354 | 354 | ), |
| 355 | 355 | ); |
| 356 | - wp_localize_script( $this->plugin_slug . '-admin-map-builder', 'gmb_data', $maps_data ); |
|
| 356 | + wp_localize_script($this->plugin_slug.'-admin-map-builder', 'gmb_data', $maps_data); |
|
| 357 | 357 | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | //Setting Scripts |
| 361 | - if ( $hook == 'google_maps_page_gmb_settings' ) { |
|
| 361 | + if ($hook == 'google_maps_page_gmb_settings') { |
|
| 362 | 362 | |
| 363 | - wp_register_script( $this->plugin_slug . '-admin-settings', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GMB_VERSION ); |
|
| 364 | - wp_enqueue_script( $this->plugin_slug . '-admin-settings' ); |
|
| 363 | + wp_register_script($this->plugin_slug.'-admin-settings', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GMB_VERSION); |
|
| 364 | + wp_enqueue_script($this->plugin_slug.'-admin-settings'); |
|
| 365 | 365 | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - wp_enqueue_style( 'dashicons' ); |
|
| 368 | + wp_enqueue_style('dashicons'); |
|
| 369 | 369 | |
| 370 | 370 | } |
| 371 | 371 | |
@@ -10,6 +10,6 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // If uninstall not called from WordPress, then exit |
| 13 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
| 13 | +if ( ! defined('WP_UNINSTALL_PLUGIN')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | \ No newline at end of file |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | $this->plugin_slug = Google_Maps_Builder()->get_plugin_slug(); |
| 23 | 23 | |
| 24 | 24 | // Activate plugin when new blog is added |
| 25 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
| 25 | + add_action('wpmu_new_blog', array($this, 'activate_new_site')); |
|
| 26 | 26 | |
| 27 | 27 | //Activation tooltips |
| 28 | - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_pointer_script_style' ) ); |
|
| 28 | + add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_pointer_script_style')); |
|
| 29 | 29 | |
| 30 | 30 | //Init CPT (after CMB2 -> hence the 10000 priority) |
| 31 | - add_action( 'init', array( $this, 'setup_post_type' ), 10000 ); |
|
| 31 | + add_action('init', array($this, 'setup_post_type'), 10000); |
|
| 32 | 32 | |
| 33 | 33 | } |
| 34 | 34 | |
@@ -43,34 +43,34 @@ discard block |
||
| 43 | 43 | * WPMU is disabled or plugin is |
| 44 | 44 | * activated on an individual blog. |
| 45 | 45 | */ |
| 46 | - public static function activate( $network_wide ) { |
|
| 46 | + public static function activate($network_wide) { |
|
| 47 | 47 | |
| 48 | 48 | //Remove Welcome Message Meta so User Sees it Again |
| 49 | 49 | global $current_user; |
| 50 | 50 | $user_id = $current_user->ID; |
| 51 | - delete_user_meta( $user_id, 'gmb_hide_welcome' ); |
|
| 51 | + delete_user_meta($user_id, 'gmb_hide_welcome'); |
|
| 52 | 52 | |
| 53 | 53 | //Display Tooltip |
| 54 | - $dismissed_pointers = explode( ',', get_user_meta( $user_id, 'dismissed_wp_pointers', true ) ); |
|
| 54 | + $dismissed_pointers = explode(',', get_user_meta($user_id, 'dismissed_wp_pointers', true)); |
|
| 55 | 55 | |
| 56 | 56 | // Check if our pointer is among dismissed ones and delete that mofo |
| 57 | - if ( in_array( 'gmb_welcome_pointer', $dismissed_pointers ) ) { |
|
| 58 | - $key = array_search( 'gmb_welcome_pointer', $dismissed_pointers ); |
|
| 59 | - delete_user_meta( $user_id, 'dismissed_wp_pointers', $key['gmb_welcome_pointer'] ); |
|
| 57 | + if (in_array('gmb_welcome_pointer', $dismissed_pointers)) { |
|
| 58 | + $key = array_search('gmb_welcome_pointer', $dismissed_pointers); |
|
| 59 | + delete_user_meta($user_id, 'dismissed_wp_pointers', $key['gmb_welcome_pointer']); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | //Multisite Checks |
| 64 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 64 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 65 | 65 | |
| 66 | - if ( $network_wide ) { |
|
| 66 | + if ($network_wide) { |
|
| 67 | 67 | |
| 68 | 68 | // Get all blog ids |
| 69 | 69 | $blog_ids = self::get_blog_ids(); |
| 70 | 70 | |
| 71 | - foreach ( $blog_ids as $blog_id ) { |
|
| 71 | + foreach ($blog_ids as $blog_id) { |
|
| 72 | 72 | |
| 73 | - switch_to_blog( $blog_id ); |
|
| 73 | + switch_to_blog($blog_id); |
|
| 74 | 74 | self::single_activate(); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -96,18 +96,18 @@ discard block |
||
| 96 | 96 | * WPMU is disabled or plugin is |
| 97 | 97 | * deactivated on an individual blog. |
| 98 | 98 | */ |
| 99 | - public static function deactivate( $network_wide ) { |
|
| 99 | + public static function deactivate($network_wide) { |
|
| 100 | 100 | |
| 101 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 101 | + if (function_exists('is_multisite') && is_multisite()) { |
|
| 102 | 102 | |
| 103 | - if ( $network_wide ) { |
|
| 103 | + if ($network_wide) { |
|
| 104 | 104 | |
| 105 | 105 | // Get all blog ids |
| 106 | 106 | $blog_ids = self::get_blog_ids(); |
| 107 | 107 | |
| 108 | - foreach ( $blog_ids as $blog_id ) { |
|
| 108 | + foreach ($blog_ids as $blog_id) { |
|
| 109 | 109 | |
| 110 | - switch_to_blog( $blog_id ); |
|
| 110 | + switch_to_blog($blog_id); |
|
| 111 | 111 | self::single_deactivate(); |
| 112 | 112 | |
| 113 | 113 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * |
| 130 | 130 | * @param $hook |
| 131 | 131 | */ |
| 132 | - function admin_enqueue_pointer_script_style( $hook ) { |
|
| 132 | + function admin_enqueue_pointer_script_style($hook) { |
|
| 133 | 133 | |
| 134 | 134 | global $post; |
| 135 | 135 | |
@@ -140,29 +140,29 @@ discard block |
||
| 140 | 140 | //delete_user_meta( get_current_user_id(), 'dismissed_wp_pointers' ); |
| 141 | 141 | |
| 142 | 142 | // Get array list of dismissed pointers for current user and convert it to array |
| 143 | - $dismissed_pointers = explode( ',', get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); |
|
| 144 | - $key = array_search( 'gmb_welcome_pointer', $dismissed_pointers ); // $key = 2; |
|
| 143 | + $dismissed_pointers = explode(',', get_user_meta(get_current_user_id(), 'dismissed_wp_pointers', true)); |
|
| 144 | + $key = array_search('gmb_welcome_pointer', $dismissed_pointers); // $key = 2; |
|
| 145 | 145 | |
| 146 | 146 | // Check if our pointer is not among dismissed ones |
| 147 | - if ( ! in_array( 'gmb_welcome_pointer', $dismissed_pointers ) ) { |
|
| 147 | + if ( ! in_array('gmb_welcome_pointer', $dismissed_pointers)) { |
|
| 148 | 148 | $enqueue_pointer_script_style = true; |
| 149 | 149 | |
| 150 | 150 | // Add footer scripts using callback function |
| 151 | - add_action( 'admin_print_footer_scripts', array( $this, 'welcome_pointer_print_scripts' ) ); |
|
| 151 | + add_action('admin_print_footer_scripts', array($this, 'welcome_pointer_print_scripts')); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // Map Customizer Tooltip - Check if our pointer is not among dismissed ones |
| 155 | - if ( ! in_array( 'gmb_customizer_pointer', $dismissed_pointers ) && isset( $post->post_type ) && $post->post_type === 'google_maps' ) { |
|
| 155 | + if ( ! in_array('gmb_customizer_pointer', $dismissed_pointers) && isset($post->post_type) && $post->post_type === 'google_maps') { |
|
| 156 | 156 | $enqueue_pointer_script_style = true; |
| 157 | 157 | |
| 158 | 158 | // Add footer scripts using callback function |
| 159 | - add_action( 'admin_print_footer_scripts', array( $this, 'maps_customizer_tooltip' ) ); |
|
| 159 | + add_action('admin_print_footer_scripts', array($this, 'maps_customizer_tooltip')); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | // Enqueue pointer CSS and JS files, if needed |
| 163 | - if ( $enqueue_pointer_script_style ) { |
|
| 164 | - wp_enqueue_style( 'wp-pointer' ); |
|
| 165 | - wp_enqueue_script( 'wp-pointer' ); |
|
| 163 | + if ($enqueue_pointer_script_style) { |
|
| 164 | + wp_enqueue_style('wp-pointer'); |
|
| 165 | + wp_enqueue_script('wp-pointer'); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | } |
@@ -174,9 +174,9 @@ discard block |
||
| 174 | 174 | global $current_user; |
| 175 | 175 | get_currentuserinfo(); |
| 176 | 176 | |
| 177 | - $pointer_content = '<h3>' . __( 'Welcome to Maps Builder', $this->plugin_slug ) . '</h3>'; |
|
| 178 | - $pointer_content .= '<p class="map-builder-welcome">' . __( 'Thank you for activating Maps Builder for WordPress. To stay up to date on the latest plugin updates, enhancements, and news please sign up for our newsletter.', $this->plugin_slug ) . '</p>'; |
|
| 179 | - $pointer_content .= '<div id="mc_embed_signup" style="padding: 0 15px;"><form action="http://wordimpress.us3.list-manage2.com/subscribe/post?u=3ccb75d68bda4381e2f45794c&id=83609e2883" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate><div class="mc-field-group" style="margin: 0 0 10px;"><input type="email" value="' . $current_user->user_email . '" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right:5px;width:230px;"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div><div id="mce-responses" class="clear"><div class="response" id="mce-error-response" style="display:none"></div><div class="response" id="mce-success-response" style="display:none"></div></div><div style="position: absolute; left: -5000px;"><input type="text" name="b_3ccb75d68bda4381e2f45794c_83609e2883" value=""></div></form></div>'; |
|
| 177 | + $pointer_content = '<h3>'.__('Welcome to Maps Builder', $this->plugin_slug).'</h3>'; |
|
| 178 | + $pointer_content .= '<p class="map-builder-welcome">'.__('Thank you for activating Maps Builder for WordPress. To stay up to date on the latest plugin updates, enhancements, and news please sign up for our newsletter.', $this->plugin_slug).'</p>'; |
|
| 179 | + $pointer_content .= '<div id="mc_embed_signup" style="padding: 0 15px;"><form action="http://wordimpress.us3.list-manage2.com/subscribe/post?u=3ccb75d68bda4381e2f45794c&id=83609e2883" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate><div class="mc-field-group" style="margin: 0 0 10px;"><input type="email" value="'.$current_user->user_email.'" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right:5px;width:230px;"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div><div id="mce-responses" class="clear"><div class="response" id="mce-error-response" style="display:none"></div><div class="response" id="mce-success-response" style="display:none"></div></div><div style="position: absolute; left: -5000px;"><input type="text" name="b_3ccb75d68bda4381e2f45794c_83609e2883" value=""></div></form></div>'; |
|
| 180 | 180 | ?> |
| 181 | 181 | |
| 182 | 182 | <script type="text/javascript"> |
@@ -210,8 +210,8 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | get_currentuserinfo(); |
| 212 | 212 | |
| 213 | - $pointer_content = '<h3>' . __( 'Introducing the Map Builder', $this->plugin_slug ) . '</h3>'; |
|
| 214 | - $pointer_content .= '<p>' . sprintf( __( '%1$sWe have upgraded your map building experience!%2$s Click here to experience the new interface. All controls are within your reach and the map always stays in view. If you like it, you can enable the view by default within the %3$splugin settings%4$s. We hope you enjoy it!', $this->plugin_slug ), '<strong>', '</strong>', '<a href="' . admin_url( 'edit.php?post_type=google_maps&page=gmb_settings&tab=general_settings' ) . '">', '</a>' ) . '</p>'; |
|
| 213 | + $pointer_content = '<h3>'.__('Introducing the Map Builder', $this->plugin_slug).'</h3>'; |
|
| 214 | + $pointer_content .= '<p>'.sprintf(__('%1$sWe have upgraded your map building experience!%2$s Click here to experience the new interface. All controls are within your reach and the map always stays in view. If you like it, you can enable the view by default within the %3$splugin settings%4$s. We hope you enjoy it!', $this->plugin_slug), '<strong>', '</strong>', '<a href="'.admin_url('edit.php?post_type=google_maps&page=gmb_settings&tab=general_settings').'">', '</a>').'</p>'; |
|
| 215 | 215 | ?> |
| 216 | 216 | |
| 217 | 217 | <script type="text/javascript"> |
@@ -245,13 +245,13 @@ discard block |
||
| 245 | 245 | * |
| 246 | 246 | * @param int $blog_id ID of the new blog. |
| 247 | 247 | */ |
| 248 | - public function activate_new_site( $blog_id ) { |
|
| 248 | + public function activate_new_site($blog_id) { |
|
| 249 | 249 | |
| 250 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
| 250 | + if (1 !== did_action('wpmu_new_blog')) { |
|
| 251 | 251 | return; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - switch_to_blog( $blog_id ); |
|
| 254 | + switch_to_blog($blog_id); |
|
| 255 | 255 | self::single_activate(); |
| 256 | 256 | restore_current_blog(); |
| 257 | 257 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | WHERE archived = '0' AND spam = '0' |
| 277 | 277 | AND deleted = '0'"; |
| 278 | 278 | |
| 279 | - return $wpdb->get_col( $sql ); |
|
| 279 | + return $wpdb->get_col($sql); |
|
| 280 | 280 | |
| 281 | 281 | } |
| 282 | 282 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | // call CPT registration function here (it should also be hooked into 'init') |
| 310 | 310 | $this->setup_post_type(); |
| 311 | - flush_rewrite_rules( false ); |
|
| 311 | + flush_rewrite_rules(false); |
|
| 312 | 312 | |
| 313 | 313 | } |
| 314 | 314 | |
@@ -322,26 +322,26 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public function setup_post_type() { |
| 324 | 324 | |
| 325 | - $settings = get_option( 'gmb_settings' ); |
|
| 326 | - $post_slug = isset( $settings['gmb_custom_slug'] ) ? $settings['gmb_custom_slug'] : ''; |
|
| 327 | - $menu_position = isset( $settings['gmb_menu_position'] ) ? $settings['gmb_menu_position'] : ''; |
|
| 328 | - $has_archive = isset( $settings['gmb_has_archive'] ) ? filter_var( $settings['gmb_has_archive'], FILTER_VALIDATE_BOOLEAN ) : ''; |
|
| 325 | + $settings = get_option('gmb_settings'); |
|
| 326 | + $post_slug = isset($settings['gmb_custom_slug']) ? $settings['gmb_custom_slug'] : ''; |
|
| 327 | + $menu_position = isset($settings['gmb_menu_position']) ? $settings['gmb_menu_position'] : ''; |
|
| 328 | + $has_archive = isset($settings['gmb_has_archive']) ? filter_var($settings['gmb_has_archive'], FILTER_VALIDATE_BOOLEAN) : ''; |
|
| 329 | 329 | |
| 330 | 330 | $labels = array( |
| 331 | - 'name' => _x( 'Google Maps', 'post type general name', $this->plugin_slug ), |
|
| 332 | - 'singular_name' => _x( 'Map', 'post type singular name', $this->plugin_slug ), |
|
| 333 | - 'menu_name' => _x( 'Google Maps', 'admin menu', $this->plugin_slug ), |
|
| 334 | - 'name_admin_bar' => _x( 'Google Maps', 'add new on admin bar', $this->plugin_slug ), |
|
| 335 | - 'add_new' => _x( 'Add New', 'map', $this->plugin_slug ), |
|
| 336 | - 'add_new_item' => __( 'Add New Map', $this->plugin_slug ), |
|
| 337 | - 'new_item' => __( 'New Map', $this->plugin_slug ), |
|
| 338 | - 'edit_item' => __( 'Edit Map', $this->plugin_slug ), |
|
| 339 | - 'view_item' => __( 'View Map', $this->plugin_slug ), |
|
| 340 | - 'all_items' => __( 'All Maps', $this->plugin_slug ), |
|
| 341 | - 'search_items' => __( 'Search Maps', $this->plugin_slug ), |
|
| 342 | - 'parent_item_colon' => __( 'Parent Maps:', $this->plugin_slug ), |
|
| 343 | - 'not_found' => __( 'No Maps found.', $this->plugin_slug ), |
|
| 344 | - 'not_found_in_trash' => __( 'No Maps found in Trash.', $this->plugin_slug ), |
|
| 331 | + 'name' => _x('Google Maps', 'post type general name', $this->plugin_slug), |
|
| 332 | + 'singular_name' => _x('Map', 'post type singular name', $this->plugin_slug), |
|
| 333 | + 'menu_name' => _x('Google Maps', 'admin menu', $this->plugin_slug), |
|
| 334 | + 'name_admin_bar' => _x('Google Maps', 'add new on admin bar', $this->plugin_slug), |
|
| 335 | + 'add_new' => _x('Add New', 'map', $this->plugin_slug), |
|
| 336 | + 'add_new_item' => __('Add New Map', $this->plugin_slug), |
|
| 337 | + 'new_item' => __('New Map', $this->plugin_slug), |
|
| 338 | + 'edit_item' => __('Edit Map', $this->plugin_slug), |
|
| 339 | + 'view_item' => __('View Map', $this->plugin_slug), |
|
| 340 | + 'all_items' => __('All Maps', $this->plugin_slug), |
|
| 341 | + 'search_items' => __('Search Maps', $this->plugin_slug), |
|
| 342 | + 'parent_item_colon' => __('Parent Maps:', $this->plugin_slug), |
|
| 343 | + 'not_found' => __('No Maps found.', $this->plugin_slug), |
|
| 344 | + 'not_found_in_trash' => __('No Maps found in Trash.', $this->plugin_slug), |
|
| 345 | 345 | ); |
| 346 | 346 | |
| 347 | 347 | $args = array( |
@@ -352,16 +352,16 @@ discard block |
||
| 352 | 352 | 'show_in_menu' => true, |
| 353 | 353 | 'query_var' => true, |
| 354 | 354 | 'rewrite' => array( |
| 355 | - 'slug' => isset( $post_slug ) ? sanitize_title( $post_slug ) : 'google-maps' |
|
| 355 | + 'slug' => isset($post_slug) ? sanitize_title($post_slug) : 'google-maps' |
|
| 356 | 356 | ), |
| 357 | 357 | 'capability_type' => 'post', |
| 358 | - 'has_archive' => isset( $has_archive ) ? $has_archive : true, |
|
| 358 | + 'has_archive' => isset($has_archive) ? $has_archive : true, |
|
| 359 | 359 | 'hierarchical' => false, |
| 360 | - 'menu_position' => ! empty( $menu_position ) ? intval( $menu_position ) : '23.1', |
|
| 361 | - 'supports' => array( 'title' ) |
|
| 360 | + 'menu_position' => ! empty($menu_position) ? intval($menu_position) : '23.1', |
|
| 361 | + 'supports' => array('title') |
|
| 362 | 362 | ); |
| 363 | 363 | |
| 364 | - register_post_type( 'google_maps', $args ); |
|
| 364 | + register_post_type('google_maps', $args); |
|
| 365 | 365 | |
| 366 | 366 | } |
| 367 | 367 | |
@@ -26,10 +26,10 @@ discard block |
||
| 26 | 26 | $this->plugin_slug = Google_Maps_Builder()->get_plugin_slug(); |
| 27 | 27 | |
| 28 | 28 | // Filter to automatically add maps to post type content |
| 29 | - add_filter( 'the_content', array( $this, 'the_content' ), 2 ); |
|
| 29 | + add_filter('the_content', array($this, 'the_content'), 2); |
|
| 30 | 30 | |
| 31 | 31 | //add shortcode support |
| 32 | - add_shortcode( 'google_maps', array( $this, 'google_maps_shortcode' ) ); |
|
| 32 | + add_shortcode('google_maps', array($this, 'google_maps_shortcode')); |
|
| 33 | 33 | |
| 34 | 34 | } |
| 35 | 35 | |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @return mixed |
| 45 | 45 | */ |
| 46 | - function the_content( $content ) { |
|
| 46 | + function the_content($content) { |
|
| 47 | 47 | |
| 48 | 48 | global $post; |
| 49 | 49 | |
| 50 | - if ( is_main_query() && is_singular('google_maps') || is_post_type_archive('google_maps') ) { |
|
| 50 | + if (is_main_query() && is_singular('google_maps') || is_post_type_archive('google_maps')) { |
|
| 51 | 51 | |
| 52 | 52 | $shortcode = '[google_maps '; |
| 53 | - $shortcode .= 'id="' . $post->ID . '"'; |
|
| 53 | + $shortcode .= 'id="'.$post->ID.'"'; |
|
| 54 | 54 | $shortcode .= ']'; |
| 55 | 55 | |
| 56 | 56 | //Output shortcode |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return string |
| 72 | 72 | */ |
| 73 | - public function get_google_maps_template( $single_template ) { |
|
| 73 | + public function get_google_maps_template($single_template) { |
|
| 74 | 74 | |
| 75 | - if ( file_exists( get_stylesheet_directory() . '/google-maps/' . $single_template ) ) { |
|
| 76 | - $output = get_stylesheet_directory() . '/google-maps/' . $single_template; |
|
| 75 | + if (file_exists(get_stylesheet_directory().'/google-maps/'.$single_template)) { |
|
| 76 | + $output = get_stylesheet_directory().'/google-maps/'.$single_template; |
|
| 77 | 77 | } else { |
| 78 | - $output = dirname( __FILE__ ) . '/views/' . $single_template; |
|
| 78 | + $output = dirname(__FILE__).'/views/'.$single_template; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return $output; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @return string |
| 93 | 93 | */ |
| 94 | - public function google_maps_shortcode( $atts ) { |
|
| 94 | + public function google_maps_shortcode($atts) { |
|
| 95 | 95 | |
| 96 | 96 | $atts = shortcode_atts( |
| 97 | 97 | array( |
@@ -102,26 +102,26 @@ discard block |
||
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | 104 | //gather data for this shortcode |
| 105 | - $post = get_post( $atts['id'] ); |
|
| 106 | - $all_meta = get_post_custom( $atts['id'] ); |
|
| 105 | + $post = get_post($atts['id']); |
|
| 106 | + $all_meta = get_post_custom($atts['id']); |
|
| 107 | 107 | |
| 108 | - $visual_info = maybe_unserialize( $all_meta['gmb_width_height'][0] ); |
|
| 109 | - $lat_lng = maybe_unserialize( $all_meta['gmb_lat_lng'][0] ); |
|
| 108 | + $visual_info = maybe_unserialize($all_meta['gmb_width_height'][0]); |
|
| 109 | + $lat_lng = maybe_unserialize($all_meta['gmb_lat_lng'][0]); |
|
| 110 | 110 | |
| 111 | 111 | //Put markers into an array for JS usage |
| 112 | 112 | $map_marker_array = array(); |
| 113 | - $markers_repeatable = isset( $all_meta['gmb_markers_group'][0] ) ? maybe_unserialize( $all_meta['gmb_markers_group'][0] ) : ''; |
|
| 113 | + $markers_repeatable = isset($all_meta['gmb_markers_group'][0]) ? maybe_unserialize($all_meta['gmb_markers_group'][0]) : ''; |
|
| 114 | 114 | |
| 115 | - if ( is_array( $markers_repeatable ) ) { |
|
| 116 | - foreach ( $markers_repeatable as $marker ) { |
|
| 117 | - array_push( $map_marker_array, $marker ); |
|
| 115 | + if (is_array($markers_repeatable)) { |
|
| 116 | + foreach ($markers_repeatable as $marker) { |
|
| 117 | + array_push($map_marker_array, $marker); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | //Send data for AJAX usage |
| 122 | 122 | //Add params to AJAX for Shortcode Usage |
| 123 | 123 | //@see: http://benjaminrojas.net/using-wp_localize_script-dynamically/ |
| 124 | - $localized_data = apply_filters( 'gmb_localized_data', array( |
|
| 124 | + $localized_data = apply_filters('gmb_localized_data', array( |
|
| 125 | 125 | $post->ID => array( |
| 126 | 126 | 'id' => $atts['id'], |
| 127 | 127 | 'map_params' => array( |
@@ -130,40 +130,40 @@ discard block |
||
| 130 | 130 | 'height' => $visual_info['height'], |
| 131 | 131 | 'latitude' => $lat_lng['latitude'], |
| 132 | 132 | 'longitude' => $lat_lng['longitude'], |
| 133 | - 'zoom' => ! empty( $all_meta['gmb_zoom'][0] ) ? $all_meta['gmb_zoom'][0] : '15', |
|
| 134 | - 'default_marker' => apply_filters( 'gmb_default_marker', GMB_PLUGIN_URL . 'assets/img/spotlight-poi.png' ), |
|
| 133 | + 'zoom' => ! empty($all_meta['gmb_zoom'][0]) ? $all_meta['gmb_zoom'][0] : '15', |
|
| 134 | + 'default_marker' => apply_filters('gmb_default_marker', GMB_PLUGIN_URL.'assets/img/spotlight-poi.png'), |
|
| 135 | 135 | ), |
| 136 | 136 | 'map_controls' => array( |
| 137 | - 'zoom_control' => ! empty( $all_meta['gmb_zoom_control'][0] ) ? strtoupper( $all_meta['gmb_zoom_control'][0] ) : 'STANDARD', |
|
| 138 | - 'pan_control' => ! empty( $all_meta['gmb_pan'][0] ) ? $all_meta['gmb_pan'][0] : 'none', |
|
| 139 | - 'map_type_control' => ! empty( $all_meta['gmb_map_type_control'][0] ) ? $all_meta['gmb_map_type_control'][0] : 'none', |
|
| 140 | - 'draggable' => ! empty( $all_meta['gmb_draggable'][0] ) ? $all_meta['gmb_draggable'][0] : 'none', |
|
| 141 | - 'double_click_zoom' => ! empty( $all_meta['gmb_double_click'][0] ) ? $all_meta['gmb_double_click'][0] : 'none', |
|
| 142 | - 'wheel_zoom' => ! empty( $all_meta['gmb_wheel_zoom'][0] ) ? $all_meta['gmb_wheel_zoom'][0] : 'none', |
|
| 143 | - 'street_view' => ! empty( $all_meta['gmb_street_view'][0] ) ? $all_meta['gmb_street_view'][0] : 'none', |
|
| 137 | + 'zoom_control' => ! empty($all_meta['gmb_zoom_control'][0]) ? strtoupper($all_meta['gmb_zoom_control'][0]) : 'STANDARD', |
|
| 138 | + 'pan_control' => ! empty($all_meta['gmb_pan'][0]) ? $all_meta['gmb_pan'][0] : 'none', |
|
| 139 | + 'map_type_control' => ! empty($all_meta['gmb_map_type_control'][0]) ? $all_meta['gmb_map_type_control'][0] : 'none', |
|
| 140 | + 'draggable' => ! empty($all_meta['gmb_draggable'][0]) ? $all_meta['gmb_draggable'][0] : 'none', |
|
| 141 | + 'double_click_zoom' => ! empty($all_meta['gmb_double_click'][0]) ? $all_meta['gmb_double_click'][0] : 'none', |
|
| 142 | + 'wheel_zoom' => ! empty($all_meta['gmb_wheel_zoom'][0]) ? $all_meta['gmb_wheel_zoom'][0] : 'none', |
|
| 143 | + 'street_view' => ! empty($all_meta['gmb_street_view'][0]) ? $all_meta['gmb_street_view'][0] : 'none', |
|
| 144 | 144 | ), |
| 145 | 145 | 'map_theme' => array( |
| 146 | - 'map_type' => ! empty( $all_meta['gmb_type'][0] ) ? $all_meta['gmb_type'][0] : 'RoadMap', |
|
| 147 | - 'map_theme_json' => ! empty( $all_meta['gmb_theme_json'][0] ) ? $all_meta['gmb_theme_json'][0] : 'none', |
|
| 146 | + 'map_type' => ! empty($all_meta['gmb_type'][0]) ? $all_meta['gmb_type'][0] : 'RoadMap', |
|
| 147 | + 'map_theme_json' => ! empty($all_meta['gmb_theme_json'][0]) ? $all_meta['gmb_theme_json'][0] : 'none', |
|
| 148 | 148 | |
| 149 | 149 | ), |
| 150 | 150 | 'map_markers' => $map_marker_array, |
| 151 | 151 | 'places_api' => array( |
| 152 | - 'show_places' => ! empty( $all_meta['gmb_show_places'][0] ) ? $all_meta['gmb_show_places'][0] : 'no', |
|
| 153 | - 'search_radius' => ! empty( $all_meta['gmb_search_radius'][0] ) ? $all_meta['gmb_search_radius'][0] : '3000', |
|
| 154 | - 'search_places' => ! empty( $all_meta['gmb_places_search_multicheckbox'][0] ) ? maybe_unserialize( $all_meta['gmb_places_search_multicheckbox'][0] ) : '', |
|
| 152 | + 'show_places' => ! empty($all_meta['gmb_show_places'][0]) ? $all_meta['gmb_show_places'][0] : 'no', |
|
| 153 | + 'search_radius' => ! empty($all_meta['gmb_search_radius'][0]) ? $all_meta['gmb_search_radius'][0] : '3000', |
|
| 154 | + 'search_places' => ! empty($all_meta['gmb_places_search_multicheckbox'][0]) ? maybe_unserialize($all_meta['gmb_places_search_multicheckbox'][0]) : '', |
|
| 155 | 155 | ), |
| 156 | - 'map_markers_icon' => ! empty( $all_meta['gmb_map_marker'] ) ? $all_meta['gmb_map_marker'][0] : 'none', |
|
| 156 | + 'map_markers_icon' => ! empty($all_meta['gmb_map_marker']) ? $all_meta['gmb_map_marker'][0] : 'none', |
|
| 157 | 157 | ) |
| 158 | - ) ); |
|
| 158 | + )); |
|
| 159 | 159 | |
| 160 | - $this->array_push_localized_script( $localized_data ); |
|
| 160 | + $this->array_push_localized_script($localized_data); |
|
| 161 | 161 | |
| 162 | 162 | ob_start(); |
| 163 | 163 | |
| 164 | - include $this->get_google_maps_template( 'public.php' ); |
|
| 164 | + include $this->get_google_maps_template('public.php'); |
|
| 165 | 165 | |
| 166 | - return apply_filters( 'gmb_shortcode_output', ob_get_clean() ); |
|
| 166 | + return apply_filters('gmb_shortcode_output', ob_get_clean()); |
|
| 167 | 167 | |
| 168 | 168 | } |
| 169 | 169 | |
@@ -175,26 +175,26 @@ discard block |
||
| 175 | 175 | * |
| 176 | 176 | * @param $localized_data |
| 177 | 177 | */ |
| 178 | - function array_push_localized_script( $localized_data ) { |
|
| 178 | + function array_push_localized_script($localized_data) { |
|
| 179 | 179 | global $wp_scripts; |
| 180 | - $data = $wp_scripts->get_data( $this->plugin_slug . '-plugin-script', 'data' ); |
|
| 180 | + $data = $wp_scripts->get_data($this->plugin_slug.'-plugin-script', 'data'); |
|
| 181 | 181 | |
| 182 | - if ( empty( $data ) ) { |
|
| 183 | - wp_localize_script( $this->plugin_slug . '-plugin-script', 'gmb_data', $localized_data ); |
|
| 182 | + if (empty($data)) { |
|
| 183 | + wp_localize_script($this->plugin_slug.'-plugin-script', 'gmb_data', $localized_data); |
|
| 184 | 184 | } else { |
| 185 | 185 | |
| 186 | - if ( ! is_array( $data ) ) { |
|
| 186 | + if ( ! is_array($data)) { |
|
| 187 | 187 | |
| 188 | - $data = json_decode( str_replace( 'var gmb_data = ', '', substr( $data, 0, - 1 ) ), true ); |
|
| 188 | + $data = json_decode(str_replace('var gmb_data = ', '', substr($data, 0, - 1)), true); |
|
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - foreach ( $data as $key => $value ) { |
|
| 193 | - $localized_data[ $key ] = $value; |
|
| 192 | + foreach ($data as $key => $value) { |
|
| 193 | + $localized_data[$key] = $value; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - $wp_scripts->add_data( $this->plugin_slug . '-plugin-script', 'data', '' ); |
|
| 197 | - wp_localize_script( $this->plugin_slug . '-plugin-script', 'gmb_data', $localized_data ); |
|
| 196 | + $wp_scripts->add_data($this->plugin_slug.'-plugin-script', 'data', ''); |
|
| 197 | + wp_localize_script($this->plugin_slug.'-plugin-script', 'gmb_data', $localized_data); |
|
| 198 | 198 | |
| 199 | 199 | } |
| 200 | 200 | |
@@ -9,14 +9,14 @@ |
||
| 9 | 9 | * @copyright 2015 WordImpress, Devin Walker |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -$map_width = isset( $visual_info['width'] ) ? $visual_info['width'] : '100'; |
|
| 13 | -$map_width .= isset( $visual_info['map_width_unit'] ) ? $visual_info['map_width_unit'] : '%'; |
|
| 14 | -$map_height = isset( $visual_info['height'] ) ? $visual_info['height'] : '500'; |
|
| 15 | -$map_height .= isset( $visual_info['map_height_unit'] ) ? $visual_info['map_height_unit'] : 'px'; |
|
| 12 | +$map_width = isset($visual_info['width']) ? $visual_info['width'] : '100'; |
|
| 13 | +$map_width .= isset($visual_info['map_width_unit']) ? $visual_info['map_width_unit'] : '%'; |
|
| 14 | +$map_height = isset($visual_info['height']) ? $visual_info['height'] : '500'; |
|
| 15 | +$map_height .= isset($visual_info['map_height_unit']) ? $visual_info['map_height_unit'] : 'px'; |
|
| 16 | 16 | ?> |
| 17 | 17 | |
| 18 | 18 | <div class="google-maps-builder-wrap"> |
| 19 | 19 | |
| 20 | - <div id="google-maps-builder-<?php echo $atts['id']; ?>" class="google-maps-builder" <?php echo ! empty( $atts['id'] ) ? ' data-map-id="' . $atts['id'] . '"' : '">Error: NO MAP ID'; ?> style="width:<?php echo $map_width; ?>; height:<?php echo $map_height; ?>"></div> |
|
| 20 | + <div id="google-maps-builder-<?php echo $atts['id']; ?>" class="google-maps-builder" <?php echo ! empty($atts['id']) ? ' data-map-id="'.$atts['id'].'"' : '">Error: NO MAP ID'; ?> style="width:<?php echo $map_width; ?>; height:<?php echo $map_height; ?>"></div> |
|
| 21 | 21 | |
| 22 | 22 | </div> |
| 23 | 23 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @return bool Whether or not function is disabled. |
| 26 | 26 | */ |
| 27 | -function gmb_is_func_disabled( $function ) { |
|
| 28 | - $disabled = explode( ',', ini_get( 'disable_functions' ) ); |
|
| 27 | +function gmb_is_func_disabled($function) { |
|
| 28 | + $disabled = explode(',', ini_get('disable_functions')); |
|
| 29 | 29 | |
| 30 | - return in_array( $function, $disabled ); |
|
| 30 | + return in_array($function, $disabled); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | * @since 2.0 |
| 39 | 39 | * @return void |
| 40 | 40 | */ |
| 41 | -function gmb_die( $message = '', $title = '', $status = 400 ) { |
|
| 42 | - add_filter( 'wp_die_ajax_handler', '_gmb_die_handler', 10, 3 ); |
|
| 43 | - add_filter( 'wp_die_handler', '_gmb_die_handler', 10, 3 ); |
|
| 44 | - wp_die( $message, $title, array( 'response' => $status ) ); |
|
| 41 | +function gmb_die($message = '', $title = '', $status = 400) { |
|
| 42 | + add_filter('wp_die_ajax_handler', '_gmb_die_handler', 10, 3); |
|
| 43 | + add_filter('wp_die_handler', '_gmb_die_handler', 10, 3); |
|
| 44 | + wp_die($message, $title, array('response' => $status)); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -54,27 +54,27 @@ discard block |
||
| 54 | 54 | function gmb_test_ajax_works() { |
| 55 | 55 | |
| 56 | 56 | // Check if the Airplane Mode plugin is installed |
| 57 | - if ( class_exists( 'Airplane_Mode_Core' ) ) { |
|
| 57 | + if (class_exists('Airplane_Mode_Core')) { |
|
| 58 | 58 | |
| 59 | 59 | $airplane = Airplane_Mode_Core::getInstance(); |
| 60 | 60 | |
| 61 | - if ( method_exists( $airplane, 'enabled' ) ) { |
|
| 61 | + if (method_exists($airplane, 'enabled')) { |
|
| 62 | 62 | |
| 63 | - if ( $airplane->enabled() ) { |
|
| 63 | + if ($airplane->enabled()) { |
|
| 64 | 64 | return true; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | } else { |
| 68 | 68 | |
| 69 | - if ( $airplane->check_status() == 'on' ) { |
|
| 69 | + if ($airplane->check_status() == 'on') { |
|
| 70 | 70 | return true; |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - add_filter( 'block_local_requests', '__return_false' ); |
|
| 75 | + add_filter('block_local_requests', '__return_false'); |
|
| 76 | 76 | |
| 77 | - if ( get_transient( '_gmb_ajax_works' ) ) { |
|
| 77 | + if (get_transient('_gmb_ajax_works')) { |
|
| 78 | 78 | return true; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -86,35 +86,35 @@ discard block |
||
| 86 | 86 | ) |
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | - $ajax = wp_remote_post( gmb_get_ajax_url(), $params ); |
|
| 89 | + $ajax = wp_remote_post(gmb_get_ajax_url(), $params); |
|
| 90 | 90 | $works = true; |
| 91 | 91 | |
| 92 | - if ( is_wp_error( $ajax ) ) { |
|
| 92 | + if (is_wp_error($ajax)) { |
|
| 93 | 93 | |
| 94 | 94 | $works = false; |
| 95 | 95 | |
| 96 | 96 | } else { |
| 97 | 97 | |
| 98 | - if( empty( $ajax['response'] ) ) { |
|
| 98 | + if (empty($ajax['response'])) { |
|
| 99 | 99 | $works = false; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - if( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) { |
|
| 102 | + if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) { |
|
| 103 | 103 | $works = false; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) { |
|
| 106 | + if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) { |
|
| 107 | 107 | $works = false; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) { |
|
| 110 | + if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) { |
|
| 111 | 111 | $works = false; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if ( $works ) { |
|
| 117 | - set_transient( '_gmb_ajax_works', '1', DAY_IN_SECONDS ); |
|
| 116 | + if ($works) { |
|
| 117 | + set_transient('_gmb_ajax_works', '1', DAY_IN_SECONDS); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | return $works; |
@@ -130,16 +130,16 @@ discard block |
||
| 130 | 130 | * @return string |
| 131 | 131 | */ |
| 132 | 132 | function gmb_get_ajax_url() { |
| 133 | - $scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
| 133 | + $scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin'; |
|
| 134 | 134 | |
| 135 | 135 | $current_url = gmb_get_current_page_url(); |
| 136 | - $ajax_url = admin_url( 'admin-ajax.php', $scheme ); |
|
| 136 | + $ajax_url = admin_url('admin-ajax.php', $scheme); |
|
| 137 | 137 | |
| 138 | - if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) { |
|
| 139 | - $ajax_url = preg_replace( '/^http/', 'https', $ajax_url ); |
|
| 138 | + if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) { |
|
| 139 | + $ajax_url = preg_replace('/^http/', 'https', $ajax_url); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - return apply_filters( 'gmb_ajax_url', $ajax_url ); |
|
| 142 | + return apply_filters('gmb_ajax_url', $ajax_url); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -150,25 +150,25 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | function gmb_get_current_page_url() { |
| 152 | 152 | |
| 153 | - if ( is_front_page() ) : |
|
| 153 | + if (is_front_page()) : |
|
| 154 | 154 | $page_url = home_url(); |
| 155 | 155 | else : |
| 156 | 156 | $page_url = 'http'; |
| 157 | 157 | |
| 158 | - if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) { |
|
| 158 | + if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { |
|
| 159 | 159 | $page_url .= "s"; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $page_url .= "://"; |
| 163 | 163 | |
| 164 | - if ( isset( $_SERVER["SERVER_PORT"] ) && $_SERVER["SERVER_PORT"] != "80" ) { |
|
| 165 | - $page_url .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; |
|
| 164 | + if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] != "80") { |
|
| 165 | + $page_url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; |
|
| 166 | 166 | } else { |
| 167 | - $page_url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; |
|
| 167 | + $page_url .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; |
|
| 168 | 168 | } |
| 169 | 169 | endif; |
| 170 | 170 | |
| 171 | - return apply_filters( 'gmb_get_current_page_url', esc_url( $page_url ) ); |
|
| 171 | + return apply_filters('gmb_get_current_page_url', esc_url($page_url)); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
@@ -183,31 +183,31 @@ discard block |
||
| 183 | 183 | function gmb_get_host() { |
| 184 | 184 | $host = false; |
| 185 | 185 | |
| 186 | - if ( defined( 'WPE_APIKEY' ) ) { |
|
| 186 | + if (defined('WPE_APIKEY')) { |
|
| 187 | 187 | $host = 'WP Engine'; |
| 188 | - } elseif ( defined( 'PAGELYBIN' ) ) { |
|
| 188 | + } elseif (defined('PAGELYBIN')) { |
|
| 189 | 189 | $host = 'Pagely'; |
| 190 | - } elseif ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) { |
|
| 190 | + } elseif (DB_HOST == 'localhost:/tmp/mysql5.sock') { |
|
| 191 | 191 | $host = 'ICDSoft'; |
| 192 | - } elseif ( DB_HOST == 'mysqlv5' ) { |
|
| 192 | + } elseif (DB_HOST == 'mysqlv5') { |
|
| 193 | 193 | $host = 'NetworkSolutions'; |
| 194 | - } elseif ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) { |
|
| 194 | + } elseif (strpos(DB_HOST, 'ipagemysql.com') !== false) { |
|
| 195 | 195 | $host = 'iPage'; |
| 196 | - } elseif ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) { |
|
| 196 | + } elseif (strpos(DB_HOST, 'ipowermysql.com') !== false) { |
|
| 197 | 197 | $host = 'IPower'; |
| 198 | - } elseif ( strpos( DB_HOST, '.gridserver.com' ) !== false ) { |
|
| 198 | + } elseif (strpos(DB_HOST, '.gridserver.com') !== false) { |
|
| 199 | 199 | $host = 'MediaTemple Grid'; |
| 200 | - } elseif ( strpos( DB_HOST, '.pair.com' ) !== false ) { |
|
| 200 | + } elseif (strpos(DB_HOST, '.pair.com') !== false) { |
|
| 201 | 201 | $host = 'pair Networks'; |
| 202 | - } elseif ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) { |
|
| 202 | + } elseif (strpos(DB_HOST, '.stabletransit.com') !== false) { |
|
| 203 | 203 | $host = 'Rackspace Cloud'; |
| 204 | - } elseif ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) { |
|
| 204 | + } elseif (strpos(DB_HOST, '.sysfix.eu') !== false) { |
|
| 205 | 205 | $host = 'SysFix.eu Power Hosting'; |
| 206 | - } elseif ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) { |
|
| 206 | + } elseif (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) { |
|
| 207 | 207 | $host = 'Flywheel'; |
| 208 | 208 | } else { |
| 209 | 209 | // Adding a general fallback for data gathering |
| 210 | - $host = 'DBH: ' . DB_HOST . ', SRV: ' . $_SERVER['SERVER_NAME']; |
|
| 210 | + $host = 'DBH: '.DB_HOST.', SRV: '.$_SERVER['SERVER_NAME']; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | return $host; |
@@ -152,8 +152,10 @@ |
||
| 152 | 152 | |
| 153 | 153 | if ( is_front_page() ) : |
| 154 | 154 | $page_url = home_url(); |
| 155 | - else : |
|
| 155 | + else { |
|
| 156 | + : |
|
| 156 | 157 | $page_url = 'http'; |
| 158 | + } |
|
| 157 | 159 | |
| 158 | 160 | if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) { |
| 159 | 161 | $page_url .= "s"; |
@@ -678,8 +678,8 @@ |
||
| 678 | 678 | ); |
| 679 | 679 | |
| 680 | 680 | echo '<div class="autocomplete-wrap"><input type="text" name="' . $field->args( 'id' ) . '[geocode]" id="' . $field->args( 'id' ) . '" value="" class="search-autocomplete" /><p class="autocomplete-description">' . |
| 681 | - sprintf( __( 'Enter the name of a place or an address above to create a map marker or %1$sDrop a Marker%2$s', $this->plugin_slug ), '<a href="#" class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>', '</a>' ) . |
|
| 682 | - '</p></div>'; |
|
| 681 | + sprintf( __( 'Enter the name of a place or an address above to create a map marker or %1$sDrop a Marker%2$s', $this->plugin_slug ), '<a href="#" class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>', '</a>' ) . |
|
| 682 | + '</p></div>'; |
|
| 683 | 683 | |
| 684 | 684 | } |
| 685 | 685 | |
@@ -53,20 +53,20 @@ discard block |
||
| 53 | 53 | $this->plugin_slug = Google_Maps_Builder()->get_plugin_slug(); |
| 54 | 54 | |
| 55 | 55 | //CPT |
| 56 | - add_filter( 'manage_edit-google_maps_columns', array( $this, 'setup_custom_columns' ) ); |
|
| 57 | - add_action( 'manage_google_maps_posts_custom_column', array( $this, 'configure_custom_columns' ), 10, 2 ); |
|
| 58 | - add_filter( 'get_user_option_closedpostboxes_google_maps', array( $this, 'closed_meta_boxes' ) ); |
|
| 56 | + add_filter('manage_edit-google_maps_columns', array($this, 'setup_custom_columns')); |
|
| 57 | + add_action('manage_google_maps_posts_custom_column', array($this, 'configure_custom_columns'), 10, 2); |
|
| 58 | + add_filter('get_user_option_closedpostboxes_google_maps', array($this, 'closed_meta_boxes')); |
|
| 59 | 59 | |
| 60 | 60 | //Custom Meta Fields |
| 61 | - add_action( 'cmb2_render_google_geocoder', array( $this, 'cmb2_render_google_geocoder' ), 10, 2 ); |
|
| 62 | - add_action( 'cmb2_render_google_maps_preview', array( $this, 'cmb2_render_google_maps_preview' ), 10, 2 ); |
|
| 63 | - add_action( 'cmb2_render_search_options', array( $this, 'cmb2_render_search_options' ), 10, 2 ); |
|
| 64 | - add_action( 'cmb2_render_width_height', array( $this, 'cmb2_render_width_height' ), 10, 2 ); |
|
| 65 | - add_action( 'cmb2_render_lat_lng', array( $this, 'cmb2_render_lat_lng' ), 10, 2 ); |
|
| 66 | - add_action( 'post_submitbox_misc_actions', array( $this, 'gmb_add_shortcode_to_publish_metabox' ) ); |
|
| 61 | + add_action('cmb2_render_google_geocoder', array($this, 'cmb2_render_google_geocoder'), 10, 2); |
|
| 62 | + add_action('cmb2_render_google_maps_preview', array($this, 'cmb2_render_google_maps_preview'), 10, 2); |
|
| 63 | + add_action('cmb2_render_search_options', array($this, 'cmb2_render_search_options'), 10, 2); |
|
| 64 | + add_action('cmb2_render_width_height', array($this, 'cmb2_render_width_height'), 10, 2); |
|
| 65 | + add_action('cmb2_render_lat_lng', array($this, 'cmb2_render_lat_lng'), 10, 2); |
|
| 66 | + add_action('post_submitbox_misc_actions', array($this, 'gmb_add_shortcode_to_publish_metabox')); |
|
| 67 | 67 | |
| 68 | 68 | //Add metaboxes and fields to CPT |
| 69 | - add_action( 'cmb2_init', array( $this, 'cpt2_metaboxes_fields' ) ); |
|
| 69 | + add_action('cmb2_init', array($this, 'cpt2_metaboxes_fields')); |
|
| 70 | 70 | |
| 71 | 71 | } |
| 72 | 72 | |
@@ -76,18 +76,18 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function gmb_add_shortcode_to_publish_metabox() { |
| 78 | 78 | |
| 79 | - if ( 'google_maps' !== get_post_type() ) { |
|
| 79 | + if ('google_maps' !== get_post_type()) { |
|
| 80 | 80 | return false; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | global $post; |
| 84 | 84 | |
| 85 | 85 | //Only enqueue scripts for CPT on post type screen |
| 86 | - if ( 'google_maps' === $post->post_type ) { |
|
| 87 | - echo '<a href="#" class="button button-primary" id="map-builder"><span class="dashicons dashicons-location-alt"></span>' . __( 'Open Map Builder', $this->plugin_slug ) . '</a>'; |
|
| 86 | + if ('google_maps' === $post->post_type) { |
|
| 87 | + echo '<a href="#" class="button button-primary" id="map-builder"><span class="dashicons dashicons-location-alt"></span>'.__('Open Map Builder', $this->plugin_slug).'</a>'; |
|
| 88 | 88 | //Shortcode column with select all input |
| 89 | - $shortcode = htmlentities( '[google_maps id="' . $post->ID . '"]' ); |
|
| 90 | - echo '<div class="shortcode-wrap box-sizing"><label>' . __( 'Map Shortcode:', $this->plugin_slug ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="' . $shortcode . '"></div>'; |
|
| 89 | + $shortcode = htmlentities('[google_maps id="'.$post->ID.'"]'); |
|
| 90 | + echo '<div class="shortcode-wrap box-sizing"><label>'.__('Map Shortcode:', $this->plugin_slug).'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="'.$shortcode.'"></div>'; |
|
| 91 | 91 | |
| 92 | 92 | } |
| 93 | 93 | |
@@ -102,13 +102,13 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function get_default_map_options() { |
| 104 | 104 | |
| 105 | - $width_height = gmb_get_option( 'gmb_width_height' ); |
|
| 105 | + $width_height = gmb_get_option('gmb_width_height'); |
|
| 106 | 106 | |
| 107 | 107 | $defaults = array( |
| 108 | - 'width' => ( isset( $width_height['width'] ) ) ? $width_height['width'] : '100', |
|
| 109 | - 'width_unit' => ( isset( $width_height['map_width_unit'] ) ) ? $width_height['map_width_unit'] : '%', |
|
| 110 | - 'height' => ( isset( $width_height['height'] ) ) ? $width_height['height'] : '600', |
|
| 111 | - 'height_unit' => ( isset( $width_height['map_height_unit'] ) ) ? $width_height['map_height_unit'] : 'px' |
|
| 108 | + 'width' => (isset($width_height['width'])) ? $width_height['width'] : '100', |
|
| 109 | + 'width_unit' => (isset($width_height['map_width_unit'])) ? $width_height['map_width_unit'] : '%', |
|
| 110 | + 'height' => (isset($width_height['height'])) ? $width_height['height'] : '600', |
|
| 111 | + 'height_unit' => (isset($width_height['map_height_unit'])) ? $width_height['map_height_unit'] : 'px' |
|
| 112 | 112 | ); |
| 113 | 113 | |
| 114 | 114 | return $defaults; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @since 1.0.0 |
| 121 | 121 | */ |
| 122 | 122 | public function settings_init() { |
| 123 | - register_setting( $this->plugin_slug, $this->plugin_slug ); |
|
| 123 | + register_setting($this->plugin_slug, $this->plugin_slug); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -135,331 +135,331 @@ discard block |
||
| 135 | 135 | $default_options = $this->get_default_map_options(); |
| 136 | 136 | |
| 137 | 137 | // MARKER WITH AUTOCOMPLETE |
| 138 | - $marker_box = cmb2_get_metabox( array( |
|
| 138 | + $marker_box = cmb2_get_metabox(array( |
|
| 139 | 139 | 'id' => 'google_maps_markers', |
| 140 | - 'title' => __( 'Map Markers', $this->plugin_slug ), |
|
| 141 | - 'object_types' => array( 'google_maps' ), // post type |
|
| 140 | + 'title' => __('Map Markers', $this->plugin_slug), |
|
| 141 | + 'object_types' => array('google_maps'), // post type |
|
| 142 | 142 | 'context' => 'normal', // 'normal', 'advanced', or 'side' |
| 143 | 143 | 'priority' => 'high', // 'high', 'core', 'default' or 'low' |
| 144 | 144 | 'show_names' => true, // Show field names on the left |
| 145 | - ) ); |
|
| 146 | - $marker_box->add_field( array( |
|
| 147 | - 'name' => __( 'Create Marker', $this->plugin_slug ), |
|
| 148 | - 'id' => $prefix . 'geocoder', |
|
| 145 | + )); |
|
| 146 | + $marker_box->add_field(array( |
|
| 147 | + 'name' => __('Create Marker', $this->plugin_slug), |
|
| 148 | + 'id' => $prefix.'geocoder', |
|
| 149 | 149 | 'type' => 'google_geocoder' |
| 150 | - ) ); |
|
| 151 | - $group_field_id = $marker_box->add_field( array( |
|
| 152 | - 'name' => __( 'Existing Markers', $this->plugin_slug ), |
|
| 153 | - 'id' => $prefix . 'markers_group', |
|
| 150 | + )); |
|
| 151 | + $group_field_id = $marker_box->add_field(array( |
|
| 152 | + 'name' => __('Existing Markers', $this->plugin_slug), |
|
| 153 | + 'id' => $prefix.'markers_group', |
|
| 154 | 154 | 'type' => 'group', |
| 155 | - 'description' => __( 'Map marker data is contained within the repeatable fields below. You may add or update marker data here or directly on the map.', $this->plugin_slug ) . '<a href="#" class="button button-small toggle-repeater-groups">' . __( 'Toggle Marker Groups', $this->plugin_slug ) . '</a>', |
|
| 155 | + 'description' => __('Map marker data is contained within the repeatable fields below. You may add or update marker data here or directly on the map.', $this->plugin_slug).'<a href="#" class="button button-small toggle-repeater-groups">'.__('Toggle Marker Groups', $this->plugin_slug).'</a>', |
|
| 156 | 156 | 'options' => array( |
| 157 | - 'group_title' => __( 'Marker: {#}', 'cmb' ), |
|
| 158 | - 'add_button' => __( 'Add Another Marker', $this->plugin_slug ), |
|
| 159 | - 'remove_button' => __( 'Remove Marker', $this->plugin_slug ), |
|
| 157 | + 'group_title' => __('Marker: {#}', 'cmb'), |
|
| 158 | + 'add_button' => __('Add Another Marker', $this->plugin_slug), |
|
| 159 | + 'remove_button' => __('Remove Marker', $this->plugin_slug), |
|
| 160 | 160 | 'sortable' => true, // beta |
| 161 | 161 | ), |
| 162 | - ) ); |
|
| 163 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 164 | - 'name' => __( 'Marker Title', $this->plugin_slug ), |
|
| 162 | + )); |
|
| 163 | + $marker_box->add_group_field($group_field_id, array( |
|
| 164 | + 'name' => __('Marker Title', $this->plugin_slug), |
|
| 165 | 165 | 'id' => 'title', |
| 166 | 166 | 'type' => 'text', |
| 167 | - ) ); |
|
| 168 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 169 | - 'name' => __( 'Marker Description', $this->plugin_slug ), |
|
| 170 | - 'description' => __( 'Write a short description for this marker', $this->plugin_slug ), |
|
| 167 | + )); |
|
| 168 | + $marker_box->add_group_field($group_field_id, array( |
|
| 169 | + 'name' => __('Marker Description', $this->plugin_slug), |
|
| 170 | + 'description' => __('Write a short description for this marker', $this->plugin_slug), |
|
| 171 | 171 | 'id' => 'description', |
| 172 | 172 | 'type' => 'textarea_small', |
| 173 | - ) ); |
|
| 174 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 175 | - 'name' => __( 'Marker Reference', $this->plugin_slug ), |
|
| 173 | + )); |
|
| 174 | + $marker_box->add_group_field($group_field_id, array( |
|
| 175 | + 'name' => __('Marker Reference', $this->plugin_slug), |
|
| 176 | 176 | 'id' => 'reference', |
| 177 | 177 | 'type' => 'text', |
| 178 | - ) ); |
|
| 179 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 180 | - 'name' => __( 'Marker Place ID', $this->plugin_slug ), |
|
| 178 | + )); |
|
| 179 | + $marker_box->add_group_field($group_field_id, array( |
|
| 180 | + 'name' => __('Marker Place ID', $this->plugin_slug), |
|
| 181 | 181 | 'id' => 'place_id', |
| 182 | 182 | 'type' => 'text', |
| 183 | - ) ); |
|
| 184 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 185 | - 'name' => __( 'Hide Place Details', $this->plugin_slug ), |
|
| 183 | + )); |
|
| 184 | + $marker_box->add_group_field($group_field_id, array( |
|
| 185 | + 'name' => __('Hide Place Details', $this->plugin_slug), |
|
| 186 | 186 | 'id' => 'hide_details', |
| 187 | 187 | 'type' => 'checkbox', |
| 188 | - ) ); |
|
| 189 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 190 | - 'name' => __( 'Marker Latitude', $this->plugin_slug ), |
|
| 188 | + )); |
|
| 189 | + $marker_box->add_group_field($group_field_id, array( |
|
| 190 | + 'name' => __('Marker Latitude', $this->plugin_slug), |
|
| 191 | 191 | 'id' => 'lat', |
| 192 | 192 | 'type' => 'text', |
| 193 | - ) ); |
|
| 194 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 195 | - 'name' => __( 'Marker Longitude', $this->plugin_slug ), |
|
| 193 | + )); |
|
| 194 | + $marker_box->add_group_field($group_field_id, array( |
|
| 195 | + 'name' => __('Marker Longitude', $this->plugin_slug), |
|
| 196 | 196 | 'id' => 'lng', |
| 197 | 197 | 'type' => 'text', |
| 198 | - ) ); |
|
| 199 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 200 | - 'name' => __( 'Marker Image', $this->plugin_slug ), |
|
| 198 | + )); |
|
| 199 | + $marker_box->add_group_field($group_field_id, array( |
|
| 200 | + 'name' => __('Marker Image', $this->plugin_slug), |
|
| 201 | 201 | 'id' => 'marker_img', |
| 202 | 202 | 'type' => 'file', |
| 203 | 203 | 'row_classes' => 'gmb-hidden', |
| 204 | 204 | 'options' => array( |
| 205 | 205 | 'url' => false, |
| 206 | - 'add_upload_file_text' => __( 'Add Marker Image', $this->plugin_slug ) |
|
| 206 | + 'add_upload_file_text' => __('Add Marker Image', $this->plugin_slug) |
|
| 207 | 207 | ), |
| 208 | - ) ); |
|
| 209 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 210 | - 'name' => __( 'Marker Data', $this->plugin_slug ), |
|
| 208 | + )); |
|
| 209 | + $marker_box->add_group_field($group_field_id, array( |
|
| 210 | + 'name' => __('Marker Data', $this->plugin_slug), |
|
| 211 | 211 | 'id' => 'marker', |
| 212 | 212 | 'row_classes' => 'gmb-hidden', |
| 213 | 213 | 'type' => 'textarea_code', |
| 214 | - ) ); |
|
| 215 | - $marker_box->add_group_field( $group_field_id, array( |
|
| 216 | - 'name' => __( 'Marker Label Data', $this->plugin_slug ), |
|
| 214 | + )); |
|
| 215 | + $marker_box->add_group_field($group_field_id, array( |
|
| 216 | + 'name' => __('Marker Label Data', $this->plugin_slug), |
|
| 217 | 217 | 'id' => 'label', |
| 218 | 218 | 'row_classes' => 'gmb-hidden', |
| 219 | 219 | 'type' => 'textarea_code', |
| 220 | - ) ); |
|
| 220 | + )); |
|
| 221 | 221 | |
| 222 | 222 | // PREVIEW |
| 223 | - $preview_box = cmb2_get_metabox( array( |
|
| 223 | + $preview_box = cmb2_get_metabox(array( |
|
| 224 | 224 | 'id' => 'google_maps_preview_metabox', |
| 225 | - 'title' => __( 'Google Map Preview', $this->plugin_slug ), |
|
| 226 | - 'object_types' => array( 'google_maps' ), // post type |
|
| 225 | + 'title' => __('Google Map Preview', $this->plugin_slug), |
|
| 226 | + 'object_types' => array('google_maps'), // post type |
|
| 227 | 227 | 'context' => 'normal', // 'normal', 'advanced', or 'side' |
| 228 | 228 | 'priority' => 'high', // 'high', 'core', 'default' or 'low' |
| 229 | 229 | 'show_names' => false, // Show field names on the left |
| 230 | - ) ); |
|
| 230 | + )); |
|
| 231 | 231 | |
| 232 | - $preview_box->add_field( array( |
|
| 233 | - 'name' => __( 'Map Preview', $this->plugin_slug ), |
|
| 234 | - 'id' => $prefix . 'preview', |
|
| 232 | + $preview_box->add_field(array( |
|
| 233 | + 'name' => __('Map Preview', $this->plugin_slug), |
|
| 234 | + 'id' => $prefix.'preview', |
|
| 235 | 235 | 'type' => 'google_maps_preview', |
| 236 | 236 | 'default' => '', |
| 237 | - ) ); |
|
| 237 | + )); |
|
| 238 | 238 | |
| 239 | 239 | // SEARCH OPTIONS |
| 240 | - $search_options = cmb2_get_metabox( array( |
|
| 240 | + $search_options = cmb2_get_metabox(array( |
|
| 241 | 241 | 'id' => 'google_maps_search_options', |
| 242 | - 'title' => __( 'Google Places', $this->plugin_slug ), |
|
| 243 | - 'object_types' => array( 'google_maps' ), // post type |
|
| 242 | + 'title' => __('Google Places', $this->plugin_slug), |
|
| 243 | + 'object_types' => array('google_maps'), // post type |
|
| 244 | 244 | 'context' => 'normal', // 'normal', 'advanced', or 'side' |
| 245 | 245 | 'priority' => 'core', // 'high', 'core', 'default' or 'low' |
| 246 | 246 | 'show_names' => true, // Show field names on the left |
| 247 | - ) ); |
|
| 247 | + )); |
|
| 248 | 248 | |
| 249 | 249 | $search_options->add_field( |
| 250 | 250 | array( |
| 251 | - 'name' => __( 'Show Places?', $this->plugin_slug ), |
|
| 252 | - 'desc' => __( 'Display establishments, prominent points of interest, geographic locations, and more.', $this->plugin_slug ), |
|
| 253 | - 'id' => $prefix . 'show_places', |
|
| 251 | + 'name' => __('Show Places?', $this->plugin_slug), |
|
| 252 | + 'desc' => __('Display establishments, prominent points of interest, geographic locations, and more.', $this->plugin_slug), |
|
| 253 | + 'id' => $prefix.'show_places', |
|
| 254 | 254 | 'type' => 'radio_inline', |
| 255 | 255 | 'options' => array( |
| 256 | - 'yes' => __( 'Yes', 'cmb' ), |
|
| 257 | - 'no' => __( 'No', 'cmb' ), |
|
| 256 | + 'yes' => __('Yes', 'cmb'), |
|
| 257 | + 'no' => __('No', 'cmb'), |
|
| 258 | 258 | ), |
| 259 | 259 | ) |
| 260 | 260 | ); |
| 261 | 261 | |
| 262 | 262 | $search_options->add_field( |
| 263 | 263 | array( |
| 264 | - 'name' => __( 'Search Radius', $this->plugin_slug ), |
|
| 265 | - 'desc' => __( 'Defines the distance (in meters) within which to return Place results. The maximum allowed radius is 50,000 meters.', $this->plugin_slug ), |
|
| 264 | + 'name' => __('Search Radius', $this->plugin_slug), |
|
| 265 | + 'desc' => __('Defines the distance (in meters) within which to return Place results. The maximum allowed radius is 50,000 meters.', $this->plugin_slug), |
|
| 266 | 266 | 'default' => '1000', |
| 267 | - 'id' => $prefix . 'search_radius', |
|
| 267 | + 'id' => $prefix.'search_radius', |
|
| 268 | 268 | 'type' => 'text_small' |
| 269 | 269 | ) |
| 270 | 270 | ); |
| 271 | 271 | |
| 272 | 272 | $search_options->add_field( |
| 273 | 273 | array( |
| 274 | - 'name' => __( 'Place Types', $this->plugin_slug ), |
|
| 275 | - 'desc' => __( 'Select which type of places you would like to display on this map.', $this->plugin_slug ), |
|
| 276 | - 'id' => $prefix . 'places_search_multicheckbox', |
|
| 274 | + 'name' => __('Place Types', $this->plugin_slug), |
|
| 275 | + 'desc' => __('Select which type of places you would like to display on this map.', $this->plugin_slug), |
|
| 276 | + 'id' => $prefix.'places_search_multicheckbox', |
|
| 277 | 277 | 'type' => 'multicheck', |
| 278 | - 'options' => apply_filters( 'gmb_place_types', array( |
|
| 279 | - 'accounting' => __( 'Accounting', $this->plugin_slug ), |
|
| 280 | - 'airport' => __( 'Airport', $this->plugin_slug ), |
|
| 281 | - 'amusement_park' => __( 'Amusement Park', $this->plugin_slug ), |
|
| 282 | - 'aquarium' => __( 'Aquarium', $this->plugin_slug ), |
|
| 283 | - 'art_gallery' => __( 'Art Gallery', $this->plugin_slug ), |
|
| 284 | - 'atm' => __( 'ATM', $this->plugin_slug ), |
|
| 285 | - 'bakery' => __( 'Bakery', $this->plugin_slug ), |
|
| 286 | - 'bank' => __( 'Bank', $this->plugin_slug ), |
|
| 287 | - 'bar' => __( 'Bar', $this->plugin_slug ), |
|
| 288 | - 'beauty_salon' => __( 'Beauty Salon', $this->plugin_slug ), |
|
| 289 | - 'bicycle_store' => __( 'Bicycle Store', $this->plugin_slug ), |
|
| 290 | - 'book_store' => __( 'Book Store', $this->plugin_slug ), |
|
| 291 | - 'bowling_alley' => __( 'Bowling Alley', $this->plugin_slug ), |
|
| 292 | - 'bus_station' => __( 'Bus Station', $this->plugin_slug ), |
|
| 293 | - 'cafe' => __( 'Cafe', $this->plugin_slug ), |
|
| 294 | - 'campground' => __( 'Campground', $this->plugin_slug ), |
|
| 295 | - 'car_dealer' => __( 'Car Dealer', $this->plugin_slug ), |
|
| 296 | - 'car_rental' => __( 'Car Rental', $this->plugin_slug ), |
|
| 297 | - 'car_repair' => __( 'Car Repair', $this->plugin_slug ), |
|
| 298 | - 'car_wash' => __( 'Car Wash', $this->plugin_slug ), |
|
| 299 | - 'casino' => __( 'Casino', $this->plugin_slug ), |
|
| 300 | - 'cemetery' => __( 'Cemetery', $this->plugin_slug ), |
|
| 301 | - 'church' => __( 'Church', $this->plugin_slug ), |
|
| 302 | - 'city_hall' => __( 'City Hall', $this->plugin_slug ), |
|
| 303 | - 'clothing_store' => __( 'Clothing Store', $this->plugin_slug ), |
|
| 304 | - 'convenience_store' => __( 'Convenience Store', $this->plugin_slug ), |
|
| 305 | - 'courthouse' => __( 'Courthouse', $this->plugin_slug ), |
|
| 306 | - 'dentist' => __( 'Dentist', $this->plugin_slug ), |
|
| 307 | - 'department_store' => __( 'Department Store', $this->plugin_slug ), |
|
| 308 | - 'doctor' => __( 'Doctor', $this->plugin_slug ), |
|
| 309 | - 'electrician' => __( 'Electrician', $this->plugin_slug ), |
|
| 310 | - 'electronics_store' => __( 'Electronics Store', $this->plugin_slug ), |
|
| 311 | - 'embassy' => __( 'Embassy', $this->plugin_slug ), |
|
| 312 | - 'establishment' => __( 'Establishment', $this->plugin_slug ), |
|
| 313 | - 'finance' => __( 'Finance', $this->plugin_slug ), |
|
| 314 | - 'fire_station' => __( 'Fire Station', $this->plugin_slug ), |
|
| 315 | - 'florist' => __( 'Florist', $this->plugin_slug ), |
|
| 316 | - 'food' => __( 'Food', $this->plugin_slug ), |
|
| 317 | - 'funeral_home' => __( 'Funeral Home', $this->plugin_slug ), |
|
| 318 | - 'furniture_store' => __( 'Furniture_store', $this->plugin_slug ), |
|
| 319 | - 'gas_station' => __( 'Gas Station', $this->plugin_slug ), |
|
| 320 | - 'general_contractor' => __( 'General Contractor', $this->plugin_slug ), |
|
| 321 | - 'grocery_or_supermarket' => __( 'Grocery or Supermarket', $this->plugin_slug ), |
|
| 322 | - 'gym' => __( 'Gym', $this->plugin_slug ), |
|
| 323 | - 'hair_care' => __( 'Hair Care', $this->plugin_slug ), |
|
| 324 | - 'hardware_store' => __( 'Hardware Store', $this->plugin_slug ), |
|
| 325 | - 'health' => __( 'Health', $this->plugin_slug ), |
|
| 326 | - 'hindu_temple' => __( 'Hindu Temple', $this->plugin_slug ), |
|
| 327 | - 'home_goods_store' => __( 'Home Goods Store', $this->plugin_slug ), |
|
| 328 | - 'hospital' => __( 'Hospital', $this->plugin_slug ), |
|
| 329 | - 'insurance_agency' => __( 'Insurance Agency', $this->plugin_slug ), |
|
| 330 | - 'jewelry_store' => __( 'Jewelry Store', $this->plugin_slug ), |
|
| 331 | - 'laundry' => __( 'Laundry', $this->plugin_slug ), |
|
| 332 | - 'lawyer' => __( 'Lawyer', $this->plugin_slug ), |
|
| 333 | - 'library' => __( 'Library', $this->plugin_slug ), |
|
| 334 | - 'liquor_store' => __( 'Liquor Store', $this->plugin_slug ), |
|
| 335 | - 'local_government_office' => __( 'Local Government Office', $this->plugin_slug ), |
|
| 336 | - 'locksmith' => __( 'Locksmith', $this->plugin_slug ), |
|
| 337 | - 'lodging' => __( 'Lodging', $this->plugin_slug ), |
|
| 338 | - 'meal_delivery' => __( 'Meal Delivery', $this->plugin_slug ), |
|
| 339 | - 'meal_takeaway' => __( 'Meal Takeaway', $this->plugin_slug ), |
|
| 340 | - 'mosque' => __( 'Mosque', $this->plugin_slug ), |
|
| 341 | - 'movie_rental' => __( 'Movie Rental', $this->plugin_slug ), |
|
| 342 | - 'movie_theater' => __( 'Movie Theater', $this->plugin_slug ), |
|
| 343 | - 'moving_company' => __( 'Moving Company', $this->plugin_slug ), |
|
| 344 | - 'museum' => __( 'Museum', $this->plugin_slug ), |
|
| 345 | - 'night_club' => __( 'Night Club', $this->plugin_slug ), |
|
| 346 | - 'painter' => __( 'Painter', $this->plugin_slug ), |
|
| 347 | - 'park' => __( 'Park', $this->plugin_slug ), |
|
| 348 | - 'parking' => __( 'Parking', $this->plugin_slug ), |
|
| 349 | - 'pet_store' => __( 'Pet Store', $this->plugin_slug ), |
|
| 350 | - 'pharmacy' => __( 'Pharmacy', $this->plugin_slug ), |
|
| 351 | - 'physiotherapist' => __( 'Physiotherapist', $this->plugin_slug ), |
|
| 352 | - 'place_of_worship' => __( 'Place of Worship', $this->plugin_slug ), |
|
| 353 | - 'plumber' => __( 'Plumber', $this->plugin_slug ), |
|
| 354 | - 'police' => __( 'Police', $this->plugin_slug ), |
|
| 355 | - 'post_office' => __( 'Post Office', $this->plugin_slug ), |
|
| 356 | - 'real_estate_agency' => __( 'Real Estate Agency', $this->plugin_slug ), |
|
| 357 | - 'restaurant' => __( 'Restaurant', $this->plugin_slug ), |
|
| 358 | - 'roofing_contractor' => __( 'Roofing Contractor', $this->plugin_slug ), |
|
| 359 | - 'rv_park' => __( 'RV Park', $this->plugin_slug ), |
|
| 360 | - 'school' => __( 'School', $this->plugin_slug ), |
|
| 361 | - 'shoe_store' => __( 'Shoe Store', $this->plugin_slug ), |
|
| 362 | - 'shopping_mall' => __( 'Shopping Mall', $this->plugin_slug ), |
|
| 363 | - 'spa' => __( 'Spa', $this->plugin_slug ), |
|
| 364 | - 'stadium' => __( 'Stadium', $this->plugin_slug ), |
|
| 365 | - 'storage' => __( 'Storage', $this->plugin_slug ), |
|
| 366 | - 'store' => __( 'Store', $this->plugin_slug ), |
|
| 367 | - 'subway_station' => __( 'Subway Station', $this->plugin_slug ), |
|
| 368 | - 'synagogue' => __( 'Synagogue', $this->plugin_slug ), |
|
| 369 | - 'taxi_stand' => __( 'Taxi Stand', $this->plugin_slug ), |
|
| 370 | - 'train_station' => __( 'Train Station', $this->plugin_slug ), |
|
| 371 | - 'travel_agency' => __( 'Travel Agency', $this->plugin_slug ), |
|
| 372 | - 'university' => __( 'University', $this->plugin_slug ), |
|
| 373 | - 'veterinary_care' => __( 'Veterinary Care', $this->plugin_slug ), |
|
| 374 | - 'zoo' => __( 'Zoo', $this->plugin_slug ) |
|
| 375 | - ) ) |
|
| 278 | + 'options' => apply_filters('gmb_place_types', array( |
|
| 279 | + 'accounting' => __('Accounting', $this->plugin_slug), |
|
| 280 | + 'airport' => __('Airport', $this->plugin_slug), |
|
| 281 | + 'amusement_park' => __('Amusement Park', $this->plugin_slug), |
|
| 282 | + 'aquarium' => __('Aquarium', $this->plugin_slug), |
|
| 283 | + 'art_gallery' => __('Art Gallery', $this->plugin_slug), |
|
| 284 | + 'atm' => __('ATM', $this->plugin_slug), |
|
| 285 | + 'bakery' => __('Bakery', $this->plugin_slug), |
|
| 286 | + 'bank' => __('Bank', $this->plugin_slug), |
|
| 287 | + 'bar' => __('Bar', $this->plugin_slug), |
|
| 288 | + 'beauty_salon' => __('Beauty Salon', $this->plugin_slug), |
|
| 289 | + 'bicycle_store' => __('Bicycle Store', $this->plugin_slug), |
|
| 290 | + 'book_store' => __('Book Store', $this->plugin_slug), |
|
| 291 | + 'bowling_alley' => __('Bowling Alley', $this->plugin_slug), |
|
| 292 | + 'bus_station' => __('Bus Station', $this->plugin_slug), |
|
| 293 | + 'cafe' => __('Cafe', $this->plugin_slug), |
|
| 294 | + 'campground' => __('Campground', $this->plugin_slug), |
|
| 295 | + 'car_dealer' => __('Car Dealer', $this->plugin_slug), |
|
| 296 | + 'car_rental' => __('Car Rental', $this->plugin_slug), |
|
| 297 | + 'car_repair' => __('Car Repair', $this->plugin_slug), |
|
| 298 | + 'car_wash' => __('Car Wash', $this->plugin_slug), |
|
| 299 | + 'casino' => __('Casino', $this->plugin_slug), |
|
| 300 | + 'cemetery' => __('Cemetery', $this->plugin_slug), |
|
| 301 | + 'church' => __('Church', $this->plugin_slug), |
|
| 302 | + 'city_hall' => __('City Hall', $this->plugin_slug), |
|
| 303 | + 'clothing_store' => __('Clothing Store', $this->plugin_slug), |
|
| 304 | + 'convenience_store' => __('Convenience Store', $this->plugin_slug), |
|
| 305 | + 'courthouse' => __('Courthouse', $this->plugin_slug), |
|
| 306 | + 'dentist' => __('Dentist', $this->plugin_slug), |
|
| 307 | + 'department_store' => __('Department Store', $this->plugin_slug), |
|
| 308 | + 'doctor' => __('Doctor', $this->plugin_slug), |
|
| 309 | + 'electrician' => __('Electrician', $this->plugin_slug), |
|
| 310 | + 'electronics_store' => __('Electronics Store', $this->plugin_slug), |
|
| 311 | + 'embassy' => __('Embassy', $this->plugin_slug), |
|
| 312 | + 'establishment' => __('Establishment', $this->plugin_slug), |
|
| 313 | + 'finance' => __('Finance', $this->plugin_slug), |
|
| 314 | + 'fire_station' => __('Fire Station', $this->plugin_slug), |
|
| 315 | + 'florist' => __('Florist', $this->plugin_slug), |
|
| 316 | + 'food' => __('Food', $this->plugin_slug), |
|
| 317 | + 'funeral_home' => __('Funeral Home', $this->plugin_slug), |
|
| 318 | + 'furniture_store' => __('Furniture_store', $this->plugin_slug), |
|
| 319 | + 'gas_station' => __('Gas Station', $this->plugin_slug), |
|
| 320 | + 'general_contractor' => __('General Contractor', $this->plugin_slug), |
|
| 321 | + 'grocery_or_supermarket' => __('Grocery or Supermarket', $this->plugin_slug), |
|
| 322 | + 'gym' => __('Gym', $this->plugin_slug), |
|
| 323 | + 'hair_care' => __('Hair Care', $this->plugin_slug), |
|
| 324 | + 'hardware_store' => __('Hardware Store', $this->plugin_slug), |
|
| 325 | + 'health' => __('Health', $this->plugin_slug), |
|
| 326 | + 'hindu_temple' => __('Hindu Temple', $this->plugin_slug), |
|
| 327 | + 'home_goods_store' => __('Home Goods Store', $this->plugin_slug), |
|
| 328 | + 'hospital' => __('Hospital', $this->plugin_slug), |
|
| 329 | + 'insurance_agency' => __('Insurance Agency', $this->plugin_slug), |
|
| 330 | + 'jewelry_store' => __('Jewelry Store', $this->plugin_slug), |
|
| 331 | + 'laundry' => __('Laundry', $this->plugin_slug), |
|
| 332 | + 'lawyer' => __('Lawyer', $this->plugin_slug), |
|
| 333 | + 'library' => __('Library', $this->plugin_slug), |
|
| 334 | + 'liquor_store' => __('Liquor Store', $this->plugin_slug), |
|
| 335 | + 'local_government_office' => __('Local Government Office', $this->plugin_slug), |
|
| 336 | + 'locksmith' => __('Locksmith', $this->plugin_slug), |
|
| 337 | + 'lodging' => __('Lodging', $this->plugin_slug), |
|
| 338 | + 'meal_delivery' => __('Meal Delivery', $this->plugin_slug), |
|
| 339 | + 'meal_takeaway' => __('Meal Takeaway', $this->plugin_slug), |
|
| 340 | + 'mosque' => __('Mosque', $this->plugin_slug), |
|
| 341 | + 'movie_rental' => __('Movie Rental', $this->plugin_slug), |
|
| 342 | + 'movie_theater' => __('Movie Theater', $this->plugin_slug), |
|
| 343 | + 'moving_company' => __('Moving Company', $this->plugin_slug), |
|
| 344 | + 'museum' => __('Museum', $this->plugin_slug), |
|
| 345 | + 'night_club' => __('Night Club', $this->plugin_slug), |
|
| 346 | + 'painter' => __('Painter', $this->plugin_slug), |
|
| 347 | + 'park' => __('Park', $this->plugin_slug), |
|
| 348 | + 'parking' => __('Parking', $this->plugin_slug), |
|
| 349 | + 'pet_store' => __('Pet Store', $this->plugin_slug), |
|
| 350 | + 'pharmacy' => __('Pharmacy', $this->plugin_slug), |
|
| 351 | + 'physiotherapist' => __('Physiotherapist', $this->plugin_slug), |
|
| 352 | + 'place_of_worship' => __('Place of Worship', $this->plugin_slug), |
|
| 353 | + 'plumber' => __('Plumber', $this->plugin_slug), |
|
| 354 | + 'police' => __('Police', $this->plugin_slug), |
|
| 355 | + 'post_office' => __('Post Office', $this->plugin_slug), |
|
| 356 | + 'real_estate_agency' => __('Real Estate Agency', $this->plugin_slug), |
|
| 357 | + 'restaurant' => __('Restaurant', $this->plugin_slug), |
|
| 358 | + 'roofing_contractor' => __('Roofing Contractor', $this->plugin_slug), |
|
| 359 | + 'rv_park' => __('RV Park', $this->plugin_slug), |
|
| 360 | + 'school' => __('School', $this->plugin_slug), |
|
| 361 | + 'shoe_store' => __('Shoe Store', $this->plugin_slug), |
|
| 362 | + 'shopping_mall' => __('Shopping Mall', $this->plugin_slug), |
|
| 363 | + 'spa' => __('Spa', $this->plugin_slug), |
|
| 364 | + 'stadium' => __('Stadium', $this->plugin_slug), |
|
| 365 | + 'storage' => __('Storage', $this->plugin_slug), |
|
| 366 | + 'store' => __('Store', $this->plugin_slug), |
|
| 367 | + 'subway_station' => __('Subway Station', $this->plugin_slug), |
|
| 368 | + 'synagogue' => __('Synagogue', $this->plugin_slug), |
|
| 369 | + 'taxi_stand' => __('Taxi Stand', $this->plugin_slug), |
|
| 370 | + 'train_station' => __('Train Station', $this->plugin_slug), |
|
| 371 | + 'travel_agency' => __('Travel Agency', $this->plugin_slug), |
|
| 372 | + 'university' => __('University', $this->plugin_slug), |
|
| 373 | + 'veterinary_care' => __('Veterinary Care', $this->plugin_slug), |
|
| 374 | + 'zoo' => __('Zoo', $this->plugin_slug) |
|
| 375 | + )) |
|
| 376 | 376 | ) |
| 377 | 377 | ); |
| 378 | 378 | |
| 379 | 379 | /** |
| 380 | 380 | * Display Options |
| 381 | 381 | */ |
| 382 | - $display_options = cmb2_get_metabox( array( |
|
| 382 | + $display_options = cmb2_get_metabox(array( |
|
| 383 | 383 | 'id' => 'google_maps_options', |
| 384 | - 'title' => __( 'Display Options', $this->plugin_slug ), |
|
| 385 | - 'object_types' => array( 'google_maps' ), // post type |
|
| 384 | + 'title' => __('Display Options', $this->plugin_slug), |
|
| 385 | + 'object_types' => array('google_maps'), // post type |
|
| 386 | 386 | 'context' => 'side', // 'normal', 'advanced', or 'side' |
| 387 | 387 | 'priority' => 'default', // 'high', 'core', 'default' or 'low' |
| 388 | 388 | 'show_names' => true, // Show field names on the left |
| 389 | - ) ); |
|
| 389 | + )); |
|
| 390 | 390 | |
| 391 | - $display_options->add_field( array( |
|
| 392 | - 'name' => __( 'Map Size', $this->plugin_slug ), |
|
| 393 | - 'id' => $prefix . 'width_height', |
|
| 391 | + $display_options->add_field(array( |
|
| 392 | + 'name' => __('Map Size', $this->plugin_slug), |
|
| 393 | + 'id' => $prefix.'width_height', |
|
| 394 | 394 | 'type' => 'width_height', |
| 395 | 395 | 'width_std' => $default_options['width'], |
| 396 | 396 | 'width_unit_std' => $default_options['width_unit'], |
| 397 | 397 | 'height_std' => $default_options['height'], |
| 398 | 398 | 'desc' => '', |
| 399 | - ) ); |
|
| 400 | - $display_options->add_field( array( |
|
| 401 | - 'name' => __( 'Map Location', $this->plugin_slug ), |
|
| 402 | - 'id' => $prefix . 'lat_lng', |
|
| 399 | + )); |
|
| 400 | + $display_options->add_field(array( |
|
| 401 | + 'name' => __('Map Location', $this->plugin_slug), |
|
| 402 | + 'id' => $prefix.'lat_lng', |
|
| 403 | 403 | 'type' => 'lat_lng', |
| 404 | 404 | 'lat_std' => '', |
| 405 | 405 | 'lng_std' => '', |
| 406 | 406 | 'desc' => '', |
| 407 | - ) ); |
|
| 408 | - $display_options->add_field( array( |
|
| 409 | - 'name' => __( 'Map Type', $this->plugin_slug ), |
|
| 410 | - 'id' => $prefix . 'type', |
|
| 407 | + )); |
|
| 408 | + $display_options->add_field(array( |
|
| 409 | + 'name' => __('Map Type', $this->plugin_slug), |
|
| 410 | + 'id' => $prefix.'type', |
|
| 411 | 411 | 'type' => 'select', |
| 412 | 412 | 'default' => 'default', |
| 413 | 413 | 'options' => array( |
| 414 | - 'RoadMap' => __( 'Road Map', $this->plugin_slug ), |
|
| 415 | - 'Satellite' => __( 'Satellite', $this->plugin_slug ), |
|
| 416 | - 'Hybrid' => __( 'Hybrid', $this->plugin_slug ), |
|
| 417 | - 'Terrain' => __( 'Terrain', $this->plugin_slug ) |
|
| 414 | + 'RoadMap' => __('Road Map', $this->plugin_slug), |
|
| 415 | + 'Satellite' => __('Satellite', $this->plugin_slug), |
|
| 416 | + 'Hybrid' => __('Hybrid', $this->plugin_slug), |
|
| 417 | + 'Terrain' => __('Terrain', $this->plugin_slug) |
|
| 418 | 418 | ), |
| 419 | - ) ); |
|
| 419 | + )); |
|
| 420 | 420 | |
| 421 | - $display_options->add_field( array( |
|
| 421 | + $display_options->add_field(array( |
|
| 422 | 422 | 'name' => 'Map Theme', |
| 423 | - 'desc' => sprintf( __( 'Set optional preconfigured %1$sSnazzy Maps%2$s styles. %3$sUpgrade to Pro%2$s for more styles and to set your own.', $this->plugin_slug ), '<a href="' . esc_url( 'http://snazzymaps.com' ) . '" class="snazzy-link new-window" target="_blank">', '</a>', '<a href="' . esc_url( 'https://wordimpress.com/plugins/maps-builder-pro/?utm_source=MBF&utm_medium=BANNER&utm_term=MAP_OPTIONS&utm_campaign=MBF' ) . '" class="new-window" target="_blank">' ), |
|
| 424 | - 'id' => $prefix . 'theme', |
|
| 423 | + 'desc' => sprintf(__('Set optional preconfigured %1$sSnazzy Maps%2$s styles. %3$sUpgrade to Pro%2$s for more styles and to set your own.', $this->plugin_slug), '<a href="'.esc_url('http://snazzymaps.com').'" class="snazzy-link new-window" target="_blank">', '</a>', '<a href="'.esc_url('https://wordimpress.com/plugins/maps-builder-pro/?utm_source=MBF&utm_medium=BANNER&utm_term=MAP_OPTIONS&utm_campaign=MBF').'" class="new-window" target="_blank">'), |
|
| 424 | + 'id' => $prefix.'theme', |
|
| 425 | 425 | 'type' => 'select', |
| 426 | 426 | 'default' => 'none', |
| 427 | 427 | 'options' => array( |
| 428 | - 'none' => __( 'None', $this->plugin_slug ), |
|
| 429 | - '68' => __( 'Aqua', $this->plugin_slug ), |
|
| 430 | - '73' => __( 'A Dark World', $this->plugin_slug ), |
|
| 431 | - '28' => __( 'Bluish', $this->plugin_slug ), |
|
| 432 | - '80' => __( 'Cool Grey', $this->plugin_slug ), |
|
| 433 | - '77' => __( 'Clean Cut', $this->plugin_slug ), |
|
| 434 | - '36' => __( 'Flat Green', $this->plugin_slug ), |
|
| 435 | - '44' => __( 'MapBox', $this->plugin_slug ), |
|
| 436 | - '83' => __( 'Muted Blue', $this->plugin_slug ), |
|
| 437 | - '22' => __( 'Old Timey', $this->plugin_slug ), |
|
| 438 | - '1' => __( 'Pale Dawn', $this->plugin_slug ), |
|
| 439 | - '19' => __( 'Paper', $this->plugin_slug ), |
|
| 440 | - '37' => __( 'Lunar Landscape', $this->plugin_slug ), |
|
| 441 | - '75' => __( 'Shade of Green', $this->plugin_slug ), |
|
| 442 | - '27' => __( 'Shift Worker', $this->plugin_slug ), |
|
| 443 | - '15' => __( 'Subtle Grayscale', $this->plugin_slug ), |
|
| 444 | - '50' => __( 'The Endless Atlas', $this->plugin_slug ), |
|
| 428 | + 'none' => __('None', $this->plugin_slug), |
|
| 429 | + '68' => __('Aqua', $this->plugin_slug), |
|
| 430 | + '73' => __('A Dark World', $this->plugin_slug), |
|
| 431 | + '28' => __('Bluish', $this->plugin_slug), |
|
| 432 | + '80' => __('Cool Grey', $this->plugin_slug), |
|
| 433 | + '77' => __('Clean Cut', $this->plugin_slug), |
|
| 434 | + '36' => __('Flat Green', $this->plugin_slug), |
|
| 435 | + '44' => __('MapBox', $this->plugin_slug), |
|
| 436 | + '83' => __('Muted Blue', $this->plugin_slug), |
|
| 437 | + '22' => __('Old Timey', $this->plugin_slug), |
|
| 438 | + '1' => __('Pale Dawn', $this->plugin_slug), |
|
| 439 | + '19' => __('Paper', $this->plugin_slug), |
|
| 440 | + '37' => __('Lunar Landscape', $this->plugin_slug), |
|
| 441 | + '75' => __('Shade of Green', $this->plugin_slug), |
|
| 442 | + '27' => __('Shift Worker', $this->plugin_slug), |
|
| 443 | + '15' => __('Subtle Grayscale', $this->plugin_slug), |
|
| 444 | + '50' => __('The Endless Atlas', $this->plugin_slug), |
|
| 445 | 445 | ) |
| 446 | - ) ); |
|
| 447 | - $display_options->add_field( array( |
|
| 448 | - 'name' => __( 'Map Theme JSON', $this->plugin_slug ), |
|
| 446 | + )); |
|
| 447 | + $display_options->add_field(array( |
|
| 448 | + 'name' => __('Map Theme JSON', $this->plugin_slug), |
|
| 449 | 449 | 'desc' => 'Contains the map theme JSON', |
| 450 | 450 | 'row_classes' => 'hidden', |
| 451 | 451 | 'default' => 'none', |
| 452 | - 'id' => $prefix . 'theme_json', |
|
| 452 | + 'id' => $prefix.'theme_json', |
|
| 453 | 453 | 'type' => 'textarea_code' |
| 454 | - ) ); |
|
| 454 | + )); |
|
| 455 | 455 | |
| 456 | - $display_options->add_field( array( |
|
| 456 | + $display_options->add_field(array( |
|
| 457 | 457 | 'name' => 'Zoom', |
| 458 | - 'desc' => __( 'Adjust the map zoom (0-21)', $this->plugin_slug ), |
|
| 459 | - 'id' => $prefix . 'zoom', |
|
| 458 | + 'desc' => __('Adjust the map zoom (0-21)', $this->plugin_slug), |
|
| 459 | + 'id' => $prefix.'zoom', |
|
| 460 | 460 | 'type' => 'select', |
| 461 | 461 | 'default' => '15', |
| 462 | - 'options' => apply_filters( 'gmb_map_zoom_levels', array( |
|
| 462 | + 'options' => apply_filters('gmb_map_zoom_levels', array( |
|
| 463 | 463 | '21' => '21', |
| 464 | 464 | '20' => '20', |
| 465 | 465 | '19' => '19', |
@@ -484,100 +484,100 @@ discard block |
||
| 484 | 484 | '0' => '0', |
| 485 | 485 | ) |
| 486 | 486 | ) |
| 487 | - ) ); |
|
| 487 | + )); |
|
| 488 | 488 | |
| 489 | 489 | // CONTROL OPTIONS |
| 490 | 490 | |
| 491 | - $control_options = cmb2_get_metabox( array( |
|
| 491 | + $control_options = cmb2_get_metabox(array( |
|
| 492 | 492 | 'id' => 'google_maps_control_options', |
| 493 | - 'title' => __( 'Map Controls', $this->plugin_slug ), |
|
| 494 | - 'object_types' => array( 'google_maps' ), // post type |
|
| 493 | + 'title' => __('Map Controls', $this->plugin_slug), |
|
| 494 | + 'object_types' => array('google_maps'), // post type |
|
| 495 | 495 | 'context' => 'side', // 'normal', 'advanced', or 'side' |
| 496 | 496 | 'priority' => 'default', // 'high', 'core', 'default' or 'low' |
| 497 | 497 | 'show_names' => true, // Show field names on the left |
| 498 | - ) ); |
|
| 498 | + )); |
|
| 499 | 499 | |
| 500 | - $control_options->add_field( array( |
|
| 501 | - 'name' => __( 'Zoom Control', $this->plugin_slug ), |
|
| 502 | - 'before' => '<span class="gmb-tooltip-text">' . __( 'Test test 123', $this->plugin_slug ) . '</span>', |
|
| 500 | + $control_options->add_field(array( |
|
| 501 | + 'name' => __('Zoom Control', $this->plugin_slug), |
|
| 502 | + 'before' => '<span class="gmb-tooltip-text">'.__('Test test 123', $this->plugin_slug).'</span>', |
|
| 503 | 503 | 'row_classes' => 'gmb-tooltip-field', |
| 504 | - 'id' => $prefix . 'zoom_control', |
|
| 504 | + 'id' => $prefix.'zoom_control', |
|
| 505 | 505 | 'type' => 'select', |
| 506 | 506 | 'default' => 'default', |
| 507 | 507 | 'options' => array( |
| 508 | - 'none' => __( 'None', $this->plugin_slug ), |
|
| 509 | - 'small' => __( 'Small', $this->plugin_slug ), |
|
| 510 | - 'large' => __( 'Large', $this->plugin_slug ), |
|
| 511 | - 'default' => __( 'Default', $this->plugin_slug ), |
|
| 508 | + 'none' => __('None', $this->plugin_slug), |
|
| 509 | + 'small' => __('Small', $this->plugin_slug), |
|
| 510 | + 'large' => __('Large', $this->plugin_slug), |
|
| 511 | + 'default' => __('Default', $this->plugin_slug), |
|
| 512 | 512 | ), |
| 513 | - ) ); |
|
| 513 | + )); |
|
| 514 | 514 | |
| 515 | - $control_options->add_field( array( |
|
| 516 | - 'name' => __( 'Street View', $this->plugin_slug ), |
|
| 517 | - 'id' => $prefix . 'street_view', |
|
| 515 | + $control_options->add_field(array( |
|
| 516 | + 'name' => __('Street View', $this->plugin_slug), |
|
| 517 | + 'id' => $prefix.'street_view', |
|
| 518 | 518 | 'type' => 'select', |
| 519 | 519 | 'default' => 'true', |
| 520 | 520 | 'options' => array( |
| 521 | - 'none' => __( 'None', $this->plugin_slug ), |
|
| 522 | - 'true' => __( 'Standard', $this->plugin_slug ), |
|
| 521 | + 'none' => __('None', $this->plugin_slug), |
|
| 522 | + 'true' => __('Standard', $this->plugin_slug), |
|
| 523 | 523 | ), |
| 524 | - ) ); |
|
| 524 | + )); |
|
| 525 | 525 | |
| 526 | - $control_options->add_field( array( |
|
| 527 | - 'name' => __( 'Pan Control', $this->plugin_slug ), |
|
| 528 | - 'id' => $prefix . 'pan', |
|
| 526 | + $control_options->add_field(array( |
|
| 527 | + 'name' => __('Pan Control', $this->plugin_slug), |
|
| 528 | + 'id' => $prefix.'pan', |
|
| 529 | 529 | 'type' => 'select', |
| 530 | 530 | 'default' => 'true', |
| 531 | 531 | 'options' => array( |
| 532 | - 'none' => __( 'None', $this->plugin_slug ), |
|
| 533 | - 'true' => __( 'Standard', $this->plugin_slug ), |
|
| 532 | + 'none' => __('None', $this->plugin_slug), |
|
| 533 | + 'true' => __('Standard', $this->plugin_slug), |
|
| 534 | 534 | ), |
| 535 | - ) ); |
|
| 535 | + )); |
|
| 536 | 536 | |
| 537 | - $control_options->add_field( array( |
|
| 538 | - 'name' => __( 'Map Type Control', $this->plugin_slug ), |
|
| 539 | - 'id' => $prefix . 'map_type_control', |
|
| 537 | + $control_options->add_field(array( |
|
| 538 | + 'name' => __('Map Type Control', $this->plugin_slug), |
|
| 539 | + 'id' => $prefix.'map_type_control', |
|
| 540 | 540 | 'type' => 'select', |
| 541 | 541 | 'default' => 'horizontal_bar', |
| 542 | 542 | 'options' => array( |
| 543 | - 'none' => __( 'None', $this->plugin_slug ), |
|
| 544 | - 'dropdown_menu' => __( 'Dropdown Menu', $this->plugin_slug ), |
|
| 545 | - 'horizontal_bar' => __( 'Horizontal Bar', $this->plugin_slug ), |
|
| 543 | + 'none' => __('None', $this->plugin_slug), |
|
| 544 | + 'dropdown_menu' => __('Dropdown Menu', $this->plugin_slug), |
|
| 545 | + 'horizontal_bar' => __('Horizontal Bar', $this->plugin_slug), |
|
| 546 | 546 | ), |
| 547 | - ) ); |
|
| 547 | + )); |
|
| 548 | 548 | |
| 549 | - $control_options->add_field( array( |
|
| 550 | - 'name' => __( 'Draggable Map', $this->plugin_slug ), |
|
| 551 | - 'id' => $prefix . 'draggable', |
|
| 549 | + $control_options->add_field(array( |
|
| 550 | + 'name' => __('Draggable Map', $this->plugin_slug), |
|
| 551 | + 'id' => $prefix.'draggable', |
|
| 552 | 552 | 'type' => 'select', |
| 553 | 553 | 'default' => 'true', |
| 554 | 554 | 'options' => array( |
| 555 | - 'none' => __( 'None', $this->plugin_slug ), |
|
| 556 | - 'true' => __( 'Standard', $this->plugin_slug ), |
|
| 555 | + 'none' => __('None', $this->plugin_slug), |
|
| 556 | + 'true' => __('Standard', $this->plugin_slug), |
|
| 557 | 557 | ), |
| 558 | - ) ); |
|
| 558 | + )); |
|
| 559 | 559 | |
| 560 | - $control_options->add_field( array( |
|
| 561 | - 'name' => __( 'Double Click to Zoom', $this->plugin_slug ), |
|
| 562 | - 'id' => $prefix . 'double_click', |
|
| 560 | + $control_options->add_field(array( |
|
| 561 | + 'name' => __('Double Click to Zoom', $this->plugin_slug), |
|
| 562 | + 'id' => $prefix.'double_click', |
|
| 563 | 563 | 'type' => 'select', |
| 564 | 564 | 'default' => 'true', |
| 565 | 565 | 'options' => array( |
| 566 | - 'none' => __( 'None', $this->plugin_slug ), |
|
| 567 | - 'true' => __( 'Standard', $this->plugin_slug ), |
|
| 566 | + 'none' => __('None', $this->plugin_slug), |
|
| 567 | + 'true' => __('Standard', $this->plugin_slug), |
|
| 568 | 568 | ), |
| 569 | - ) ); |
|
| 569 | + )); |
|
| 570 | 570 | |
| 571 | - $control_options->add_field( array( |
|
| 572 | - 'name' => __( 'Mouse Wheel to Zoom', $this->plugin_slug ), |
|
| 573 | - 'id' => $prefix . 'wheel_zoom', |
|
| 571 | + $control_options->add_field(array( |
|
| 572 | + 'name' => __('Mouse Wheel to Zoom', $this->plugin_slug), |
|
| 573 | + 'id' => $prefix.'wheel_zoom', |
|
| 574 | 574 | 'type' => 'select', |
| 575 | 575 | 'default' => 'true', |
| 576 | 576 | 'options' => array( |
| 577 | - 'none' => __( 'Disabled', $this->plugin_slug ), |
|
| 578 | - 'true' => __( 'Standard', $this->plugin_slug ), |
|
| 577 | + 'none' => __('Disabled', $this->plugin_slug), |
|
| 578 | + 'true' => __('Standard', $this->plugin_slug), |
|
| 579 | 579 | ), |
| 580 | - ) ); |
|
| 580 | + )); |
|
| 581 | 581 | |
| 582 | 582 | } |
| 583 | 583 | |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | * @param $field |
| 590 | 590 | * @param $meta |
| 591 | 591 | */ |
| 592 | - function cmb2_render_width_height( $field, $meta ) { |
|
| 592 | + function cmb2_render_width_height($field, $meta) { |
|
| 593 | 593 | $default_options = $this->get_default_map_options(); |
| 594 | 594 | $meta = wp_parse_args( |
| 595 | 595 | $meta, array( |
@@ -603,24 +603,24 @@ discard block |
||
| 603 | 603 | $output = '<div id="width_height_wrap" class="clear clearfix">'; |
| 604 | 604 | //width |
| 605 | 605 | $output .= '<div id="width_wrap" class="clear">'; |
| 606 | - $output .= '<label class="width-label size-label">' . __( 'Width', $this->plugin_slug ) . '</label><input type="text" class="regular-text map-width" name="' . $field->args( 'id' ) . '[width]" id="' . $field->args( 'id' ) . '-width" value="' . ( $meta['width'] ? $meta['width'] : $field->args( 'width_std' ) ) . '" />'; |
|
| 606 | + $output .= '<label class="width-label size-label">'.__('Width', $this->plugin_slug).'</label><input type="text" class="regular-text map-width" name="'.$field->args('id').'[width]" id="'.$field->args('id').'-width" value="'.($meta['width'] ? $meta['width'] : $field->args('width_std')).'" />'; |
|
| 607 | 607 | $output .= '<div class="size-labels-wrap">'; |
| 608 | - $output .= '<input id="width_unit_percent" type="radio" name="' . $field->args( 'id' ) . '[map_width_unit]" class="width_radio" value="%" ' . ( $meta['map_width_unit'] === '%' || $field->args( 'width_unit_std' ) === '%' ? 'checked="checked"' : '' ) . '><label class="width_unit_label">%</label>'; |
|
| 609 | - $output .= '<input id="width_unit_px" type="radio" name="' . $field->args( 'id' ) . '[map_width_unit]" class="width_radio" value="px" ' . ( $meta['map_width_unit'] === 'px' ? 'checked="checked"' : '' ) . ' ><label class="width_unit_label">px</label>'; |
|
| 608 | + $output .= '<input id="width_unit_percent" type="radio" name="'.$field->args('id').'[map_width_unit]" class="width_radio" value="%" '.($meta['map_width_unit'] === '%' || $field->args('width_unit_std') === '%' ? 'checked="checked"' : '').'><label class="width_unit_label">%</label>'; |
|
| 609 | + $output .= '<input id="width_unit_px" type="radio" name="'.$field->args('id').'[map_width_unit]" class="width_radio" value="px" '.($meta['map_width_unit'] === 'px' ? 'checked="checked"' : '').' ><label class="width_unit_label">px</label>'; |
|
| 610 | 610 | $output .= '</div>'; |
| 611 | 611 | $output .= '</div>'; |
| 612 | 612 | |
| 613 | 613 | //height |
| 614 | 614 | $output .= '<div id="height_wrap" class="clear clearfix">'; |
| 615 | - $output .= '<label for="' . $field->args( 'id' ) . '[height]" class="height-label size-label">' . __( 'Height', $this->plugin_slug ) . ':</label><input type="text" class="regular-text map-height" name="' . $field->args( 'id' ) . '[height]" id="' . $field->args( 'id' ) . '-height" value="' . ( $meta['height'] ? $meta['height'] : $field->args( 'height_std' ) ) . '" />'; |
|
| 615 | + $output .= '<label for="'.$field->args('id').'[height]" class="height-label size-label">'.__('Height', $this->plugin_slug).':</label><input type="text" class="regular-text map-height" name="'.$field->args('id').'[height]" id="'.$field->args('id').'-height" value="'.($meta['height'] ? $meta['height'] : $field->args('height_std')).'" />'; |
|
| 616 | 616 | |
| 617 | 617 | $output .= '<div class="size-labels-wrap">'; |
| 618 | - $output .= '<input id="height_unit_percent" type="radio" name="' . $field->args( 'id' ) . '[map_height_unit]" class="height_radio" value="%" ' . ( $meta['map_height_unit'] === '%' || $field->args( 'height_unit_std' ) === '%' ? 'checked="checked"' : '' ) . '><label class="height_unit_label">%</label>'; |
|
| 619 | - $output .= '<input id="height_unit_px" type="radio" name="' . $field->args( 'id' ) . '[map_height_unit]" class="height_radio" value="px" ' . ( $meta['map_height_unit'] === 'px' ? 'checked="checked"' : '' ) . ' ><label class="height_unit_label">px</label>'; |
|
| 618 | + $output .= '<input id="height_unit_percent" type="radio" name="'.$field->args('id').'[map_height_unit]" class="height_radio" value="%" '.($meta['map_height_unit'] === '%' || $field->args('height_unit_std') === '%' ? 'checked="checked"' : '').'><label class="height_unit_label">%</label>'; |
|
| 619 | + $output .= '<input id="height_unit_px" type="radio" name="'.$field->args('id').'[map_height_unit]" class="height_radio" value="px" '.($meta['map_height_unit'] === 'px' ? 'checked="checked"' : '').' ><label class="height_unit_label">px</label>'; |
|
| 620 | 620 | $output .= '</div>'; |
| 621 | 621 | $output .= '</div>'; |
| 622 | 622 | |
| 623 | - $output .= '<p class="cmb2-metabox-description">' . __( 'Configure the default map width and height.', $this->plugin_slug ) . '</p>'; |
|
| 623 | + $output .= '<p class="cmb2-metabox-description">'.__('Configure the default map width and height.', $this->plugin_slug).'</p>'; |
|
| 624 | 624 | |
| 625 | 625 | $output .= '</div>'; //end #width_height_wrap |
| 626 | 626 | |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | * @param $field |
| 638 | 638 | * @param $meta |
| 639 | 639 | */ |
| 640 | - function cmb2_render_lat_lng( $field, $meta ) { |
|
| 640 | + function cmb2_render_lat_lng($field, $meta) { |
|
| 641 | 641 | $meta = wp_parse_args( |
| 642 | 642 | $meta, array( |
| 643 | 643 | 'latitude' => '', |
@@ -648,13 +648,13 @@ discard block |
||
| 648 | 648 | //lat lng |
| 649 | 649 | $output = '<div id="lat-lng-wrap"> |
| 650 | 650 | <div class="coordinates-wrap clear"> |
| 651 | - <div class="lat-lng-wrap lat-wrap clear"><span>' . __( 'Latitude:', $this->plugin_slug ) . '</span> |
|
| 652 | - <input type="text" class="regular-text latitude" name="' . $field->args( 'id' ) . '[latitude]" id="' . $field->args( 'id' ) . '-latitude" value="' . ( $meta['latitude'] ? $meta['latitude'] : $field->args( 'lat_std' ) ) . '" /> |
|
| 651 | + <div class="lat-lng-wrap lat-wrap clear"><span>' . __('Latitude:', $this->plugin_slug).'</span> |
|
| 652 | + <input type="text" class="regular-text latitude" name="' . $field->args('id').'[latitude]" id="'.$field->args('id').'-latitude" value="'.($meta['latitude'] ? $meta['latitude'] : $field->args('lat_std')).'" /> |
|
| 653 | 653 | </div> |
| 654 | - <div class="lat-lng-wrap lng-wrap clear"><span>' . __( 'Longitude:', $this->plugin_slug ) . '</span> |
|
| 655 | - <input type="text" class="regular-text longitude" name="' . $field->args( 'id' ) . '[longitude]" id="' . $field->args( 'id' ) . '-longitude" value="' . ( $meta['longitude'] ? $meta['longitude'] : $field->args( 'lng_std' ) ) . '" /> |
|
| 654 | + <div class="lat-lng-wrap lng-wrap clear"><span>' . __('Longitude:', $this->plugin_slug).'</span> |
|
| 655 | + <input type="text" class="regular-text longitude" name="' . $field->args('id').'[longitude]" id="'.$field->args('id').'-longitude" value="'.($meta['longitude'] ? $meta['longitude'] : $field->args('lng_std')).'" /> |
|
| 656 | 656 | </div>'; |
| 657 | - $output .= '<div class="wpgp-message lat-lng-change-message clear"><p>' . __( 'Lat/lng changed', $this->plugin_slug ) . '</p><a href="#" class="button lat-lng-update-btn button-small" data-lat="" data-lng="">' . __( 'Update', $this->plugin_slug ) . '</a></div>'; |
|
| 657 | + $output .= '<div class="wpgp-message lat-lng-change-message clear"><p>'.__('Lat/lng changed', $this->plugin_slug).'</p><a href="#" class="button lat-lng-update-btn button-small" data-lat="" data-lng="">'.__('Update', $this->plugin_slug).'</a></div>'; |
|
| 658 | 658 | $output .= '</div><!-- /.coordinates-wrap --> |
| 659 | 659 | </div>'; |
| 660 | 660 | |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | * @since 1.0.0 |
| 670 | 670 | * @return array |
| 671 | 671 | */ |
| 672 | - function cmb2_render_google_geocoder( $field, $meta ) { |
|
| 672 | + function cmb2_render_google_geocoder($field, $meta) { |
|
| 673 | 673 | |
| 674 | 674 | $meta = wp_parse_args( |
| 675 | 675 | $meta, array( |
@@ -677,8 +677,8 @@ discard block |
||
| 677 | 677 | ) |
| 678 | 678 | ); |
| 679 | 679 | |
| 680 | - echo '<div class="autocomplete-wrap"><input type="text" name="' . $field->args( 'id' ) . '[geocode]" id="' . $field->args( 'id' ) . '" value="" class="search-autocomplete" /><p class="autocomplete-description">' . |
|
| 681 | - sprintf( __( 'Enter the name of a place or an address above to create a map marker or %1$sDrop a Marker%2$s', $this->plugin_slug ), '<a href="#" class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>', '</a>' ) . |
|
| 680 | + echo '<div class="autocomplete-wrap"><input type="text" name="'.$field->args('id').'[geocode]" id="'.$field->args('id').'" value="" class="search-autocomplete" /><p class="autocomplete-description">'. |
|
| 681 | + sprintf(__('Enter the name of a place or an address above to create a map marker or %1$sDrop a Marker%2$s', $this->plugin_slug), '<a href="#" class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>', '</a>'). |
|
| 682 | 682 | '</p></div>'; |
| 683 | 683 | |
| 684 | 684 | } |
@@ -687,29 +687,29 @@ discard block |
||
| 687 | 687 | * Custom Google Geocoder field |
| 688 | 688 | * @since 1.0.0 |
| 689 | 689 | */ |
| 690 | - function cmb2_render_google_maps_preview( $field, $meta ) { |
|
| 690 | + function cmb2_render_google_maps_preview($field, $meta) { |
|
| 691 | 691 | global $post; |
| 692 | - $meta = wp_parse_args( $meta, array() ); |
|
| 693 | - $wh_value = get_post_meta( $post->ID, 'gmb_width_height', true ); |
|
| 694 | - $lat_lng = get_post_meta( $post->ID, 'gmb_lat_lng', true ); |
|
| 692 | + $meta = wp_parse_args($meta, array()); |
|
| 693 | + $wh_value = get_post_meta($post->ID, 'gmb_width_height', true); |
|
| 694 | + $lat_lng = get_post_meta($post->ID, 'gmb_lat_lng', true); |
|
| 695 | 695 | $default_options = $this->get_default_map_options(); |
| 696 | 696 | |
| 697 | - $output = '<div class="places-loading wpgp-loading">' . __( 'Loading Places', $this->plugin_slug ) . '</div><div id="google-map-wrap">'; |
|
| 697 | + $output = '<div class="places-loading wpgp-loading">'.__('Loading Places', $this->plugin_slug).'</div><div id="google-map-wrap">'; |
|
| 698 | 698 | $output .= '<div id="map" style="height:600px; width:100%;"></div>'; |
| 699 | 699 | |
| 700 | - $output .= '<div class="map-modal-upsell"><p class="upsell-intro">' . __( 'Want more?', $this->plugin_slug ) . '</p><a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=MODAL&utm_campaign=MBF%20Modal" class="button button-small upsell-button" target="_blank">' . __( 'Go Pro!', $this->plugin_slug ) . '</a></div>'; |
|
| 700 | + $output .= '<div class="map-modal-upsell"><p class="upsell-intro">'.__('Want more?', $this->plugin_slug).'</p><a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=MODAL&utm_campaign=MBF%20Modal" class="button button-small upsell-button" target="_blank">'.__('Go Pro!', $this->plugin_slug).'</a></div>'; |
|
| 701 | 701 | |
| 702 | 702 | //Toolbar |
| 703 | 703 | $output .= '<div id="map-toolbar">'; |
| 704 | - $output .= '<button class="add-location button button-small gmb-magnific-inline" data-target="cmb2-id-gmb-geocoder" data-auto-focus="true"><span class="dashicons dashicons-pressthis"></span>' . __( 'Add Location', $this->plugin_slug ) . '</button>'; |
|
| 705 | - $output .= '<button class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>' . __( 'Drop a Marker', $this->plugin_slug ) . '</button>'; |
|
| 706 | - $output .= '<button class="goto-location button button-small gmb-magnific-inline" data-target="map-autocomplete-wrap" data-auto-focus="true"><span class="dashicons dashicons-admin-site"></span>' . __( 'Goto Location', $this->plugin_slug ) . '</button>'; |
|
| 707 | - $output .= '<button class="edit-title button button-small gmb-magnific-inline" data-target="map-title-wrap" data-auto-focus="true"><span class="dashicons dashicons-edit"></span>' . __( 'Edit Map Title', $this->plugin_slug ) . '</button>'; |
|
| 704 | + $output .= '<button class="add-location button button-small gmb-magnific-inline" data-target="cmb2-id-gmb-geocoder" data-auto-focus="true"><span class="dashicons dashicons-pressthis"></span>'.__('Add Location', $this->plugin_slug).'</button>'; |
|
| 705 | + $output .= '<button class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>'.__('Drop a Marker', $this->plugin_slug).'</button>'; |
|
| 706 | + $output .= '<button class="goto-location button button-small gmb-magnific-inline" data-target="map-autocomplete-wrap" data-auto-focus="true"><span class="dashicons dashicons-admin-site"></span>'.__('Goto Location', $this->plugin_slug).'</button>'; |
|
| 707 | + $output .= '<button class="edit-title button button-small gmb-magnific-inline" data-target="map-title-wrap" data-auto-focus="true"><span class="dashicons dashicons-edit"></span>'.__('Edit Map Title', $this->plugin_slug).'</button>'; |
|
| 708 | 708 | |
| 709 | 709 | $output .= '<div class="live-lat-lng-wrap clearfix">'; |
| 710 | - $output .= '<button disabled class="update-lat-lng button button-small">' . __( 'Set Lat/Lng', $this->plugin_slug ) . '</button>'; |
|
| 711 | - $output .= '<div class="live-latitude-wrap"><span class="live-latitude-label">' . __( 'Lat:', $this->plugin_slug ) . '</span><span class="live-latitude">' . ( isset( $lat_lng['latitude'] ) ? $lat_lng['latitude'] : '' ) . '</span></div>'; |
|
| 712 | - $output .= '<div class="live-longitude-wrap"><span class="live-longitude-label">' . __( 'Lng:', $this->plugin_slug ) . '</span><span class="live-longitude">' . ( isset( $lat_lng['longitude'] ) ? $lat_lng['longitude'] : '' ) . '</span></div>'; |
|
| 710 | + $output .= '<button disabled class="update-lat-lng button button-small">'.__('Set Lat/Lng', $this->plugin_slug).'</button>'; |
|
| 711 | + $output .= '<div class="live-latitude-wrap"><span class="live-latitude-label">'.__('Lat:', $this->plugin_slug).'</span><span class="live-latitude">'.(isset($lat_lng['latitude']) ? $lat_lng['latitude'] : '').'</span></div>'; |
|
| 712 | + $output .= '<div class="live-longitude-wrap"><span class="live-longitude-label">'.__('Lng:', $this->plugin_slug).'</span><span class="live-longitude">'.(isset($lat_lng['longitude']) ? $lat_lng['longitude'] : '').'</span></div>'; |
|
| 713 | 713 | $output .= '</div>'; //End .live-lat-lng-wrap |
| 714 | 714 | $output .= '</div>'; //End #map-toolbar |
| 715 | 715 | $output .= '</div>'; //End #map |
@@ -720,9 +720,9 @@ discard block |
||
| 720 | 720 | $output .= '<div class="inner-modal-wrap">'; |
| 721 | 721 | $output .= '<div class="inner-modal-container">'; |
| 722 | 722 | $output .= '<div class="inner-modal clearfix">'; |
| 723 | - $output .= '<label for="post_title" class="map-title">' . __( 'Map Title', $this->plugin_slug ) . '</label>'; |
|
| 724 | - $output .= '<p class="cmb2-metabox-description">' . __( 'Give your Map a descriptive title', $this->plugin_slug ) . '</p>'; |
|
| 725 | - $output .= '<button type="button" class="gmb-modal-close">×</button><input type="text" name="model_post_title" size="30" value="' . get_the_title() . '" id="modal_title" spellcheck="true" autocomplete="off" placeholder="' . __( 'Enter map title', $this->plugin_slug ) . '">'; |
|
| 723 | + $output .= '<label for="post_title" class="map-title">'.__('Map Title', $this->plugin_slug).'</label>'; |
|
| 724 | + $output .= '<p class="cmb2-metabox-description">'.__('Give your Map a descriptive title', $this->plugin_slug).'</p>'; |
|
| 725 | + $output .= '<button type="button" class="gmb-modal-close">×</button><input type="text" name="model_post_title" size="30" value="'.get_the_title().'" id="modal_title" spellcheck="true" autocomplete="off" placeholder="'.__('Enter map title', $this->plugin_slug).'">'; |
|
| 726 | 726 | $output .= '</div>'; |
| 727 | 727 | $output .= '</div>'; |
| 728 | 728 | $output .= '</div>'; |
@@ -732,8 +732,8 @@ discard block |
||
| 732 | 732 | $output .= '<div class="inner-modal-wrap">'; |
| 733 | 733 | $output .= '<div class="inner-modal-container">'; |
| 734 | 734 | $output .= '<div class="inner-modal clearfix">'; |
| 735 | - $output .= '<label for="map-location-autocomplete" class="map-title">' . __( 'Enter a Location', $this->plugin_slug ) . '</label>'; |
|
| 736 | - $output .= '<p class="cmb2-metabox-description">' . __( 'Type your point of interest below and the map will be re-centered over that location', $this->plugin_slug ) . '</p>'; |
|
| 735 | + $output .= '<label for="map-location-autocomplete" class="map-title">'.__('Enter a Location', $this->plugin_slug).'</label>'; |
|
| 736 | + $output .= '<p class="cmb2-metabox-description">'.__('Type your point of interest below and the map will be re-centered over that location', $this->plugin_slug).'</p>'; |
|
| 737 | 737 | $output .= '<button type="button" class="gmb-modal-close">×</button>'; |
| 738 | 738 | $output .= '<input type="text" name="" size="30" id="map-location-autocomplete">'; |
| 739 | 739 | $output .= '</div>'; |
@@ -744,9 +744,9 @@ discard block |
||
| 744 | 744 | $output .= '<div class="warning-message wpgp-message"></div>'; |
| 745 | 745 | |
| 746 | 746 | //Markers Modal |
| 747 | - include( 'views/markers.php' ); |
|
| 747 | + include('views/markers.php'); |
|
| 748 | 748 | |
| 749 | - echo apply_filters( 'google_maps_preview', $output ); |
|
| 749 | + echo apply_filters('google_maps_preview', $output); |
|
| 750 | 750 | |
| 751 | 751 | } |
| 752 | 752 | |
@@ -757,12 +757,12 @@ discard block |
||
| 757 | 757 | * |
| 758 | 758 | * @return array |
| 759 | 759 | */ |
| 760 | - function setup_custom_columns( $columns ) { |
|
| 760 | + function setup_custom_columns($columns) { |
|
| 761 | 761 | $columns = array( |
| 762 | 762 | 'cb' => '<input type="checkbox" />', |
| 763 | - 'title' => __( 'Google Map Title', $this->plugin_slug ), |
|
| 764 | - 'shortcode' => __( 'Shortcode', $this->plugin_slug ), |
|
| 765 | - 'date' => __( 'Creation Date', $this->plugin_slug ) |
|
| 763 | + 'title' => __('Google Map Title', $this->plugin_slug), |
|
| 764 | + 'shortcode' => __('Shortcode', $this->plugin_slug), |
|
| 765 | + 'date' => __('Creation Date', $this->plugin_slug) |
|
| 766 | 766 | ); |
| 767 | 767 | |
| 768 | 768 | return $columns; |
@@ -777,13 +777,13 @@ discard block |
||
| 777 | 777 | * @param $column |
| 778 | 778 | * @param $post_id |
| 779 | 779 | */ |
| 780 | - function configure_custom_columns( $column, $post_id ) { |
|
| 781 | - switch ( $column ) { |
|
| 780 | + function configure_custom_columns($column, $post_id) { |
|
| 781 | + switch ($column) { |
|
| 782 | 782 | case 'shortcode' : |
| 783 | 783 | |
| 784 | 784 | //Shortcode column with select all input |
| 785 | - $shortcode = htmlentities( '[google_maps id="' . $post_id . '"]' ); |
|
| 786 | - echo '<input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="' . $shortcode . '">'; |
|
| 785 | + $shortcode = htmlentities('[google_maps id="'.$post_id.'"]'); |
|
| 786 | + echo '<input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="'.$shortcode.'">'; |
|
| 787 | 787 | |
| 788 | 788 | break; |
| 789 | 789 | /* Just break out of the switch statement for everything else. */ |
@@ -800,10 +800,10 @@ discard block |
||
| 800 | 800 | * |
| 801 | 801 | * @return array |
| 802 | 802 | */ |
| 803 | - function closed_meta_boxes( $closed ) { |
|
| 803 | + function closed_meta_boxes($closed) { |
|
| 804 | 804 | |
| 805 | - if ( false === $closed ) { |
|
| 806 | - $closed = array( 'google_maps_options', 'google_maps_control_options', 'google_maps_markers' ); |
|
| 805 | + if (false === $closed) { |
|
| 806 | + $closed = array('google_maps_options', 'google_maps_control_options', 'google_maps_markers'); |
|
| 807 | 807 | } |
| 808 | 808 | |
| 809 | 809 | return $closed; |