@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function __construct() { |
| 20 | 20 | parent::__construct(); |
| 21 | - $this->page_name = __( 'Google Maps Builder Settings', $this->plugin_slug ); |
|
| 21 | + $this->page_name = __('Google Maps Builder Settings', $this->plugin_slug); |
|
| 22 | 22 | |
| 23 | 23 | $this->plugin_slug = Google_Maps_Builder()->get_plugin_slug(); |
| 24 | - add_action( 'cmb2_render_lat_lng_default', array( $this, 'cmb2_render_lat_lng_default' ), 10, 2 ); |
|
| 24 | + add_action('cmb2_render_lat_lng_default', array($this, 'cmb2_render_lat_lng_default'), 10, 2); |
|
| 25 | 25 | |
| 26 | 26 | //upsell markup |
| 27 | - add_action( 'gmb_settings_page_after_logo', array( $this, 'settings_upsell' ) ); |
|
| 28 | - add_action( 'gmb_social_media_after_logo', array( $this, 'settings_social_media_upsell' ) ); |
|
| 27 | + add_action('gmb_settings_page_after_logo', array($this, 'settings_upsell')); |
|
| 28 | + add_action('gmb_social_media_after_logo', array($this, 'settings_social_media_upsell')); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @return mixed |
| 38 | 38 | */ |
| 39 | - function add_plugin_page_links( $links, $file ) { |
|
| 39 | + function add_plugin_page_links($links, $file) { |
|
| 40 | 40 | |
| 41 | - if ( $file == GMB_PLUGIN_BASE ) { |
|
| 41 | + if ($file == GMB_PLUGIN_BASE) { |
|
| 42 | 42 | |
| 43 | 43 | // Add Widget Page link to our plugin |
| 44 | - $settings_link = '<a href="edit.php?post_type=google_maps&page=' . self::$key . '" title="' . __( 'Visit the Google Maps Builder plugin settings page', 'google-maps-builder' ) . '">' . __( 'Settings', 'google-maps-builder' ) . '</a>'; |
|
| 45 | - array_unshift( $links, $settings_link ); |
|
| 44 | + $settings_link = '<a href="edit.php?post_type=google_maps&page='.self::$key.'" title="'.__('Visit the Google Maps Builder plugin settings page', 'google-maps-builder').'">'.__('Settings', 'google-maps-builder').'</a>'; |
|
| 45 | + array_unshift($links, $settings_link); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | return $links; |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | * |
| 59 | 59 | * @return array |
| 60 | 60 | */ |
| 61 | - function add_plugin_meta_links( $meta, $file ) { |
|
| 61 | + function add_plugin_meta_links($meta, $file) { |
|
| 62 | 62 | |
| 63 | - if ( $file == GMB_PLUGIN_BASE ) { |
|
| 64 | - $meta[] = "<a href='http://wordpress.org/support/view/plugin-reviews/google-maps-builder' target='_blank' title='" . __( 'Rate Google Maps Builder on WordPress.org', 'google-maps-builder' ) . "'>" . __( 'Rate Plugin', 'google-maps-builder' ) . "</a>"; |
|
| 65 | - $meta[] = "<a href='https://wordimpress.com/documentation/maps-builder-pro/' target='_blank' title='" . __( 'View the plugin documentation', 'google-maps-builder' ) . "'>" . __( 'Documentation', 'google-maps-builder' ) . "</a>"; |
|
| 66 | - $meta[] = '<a href="http://wordpress.org/support/plugin/google-maps-builder/" target="_blank" title="' . __( 'Get plugin support via the WordPress community', 'google-maps-builder' ) . '">' . __( 'Support', 'google-maps-builder' ) . '</a>'; |
|
| 63 | + if ($file == GMB_PLUGIN_BASE) { |
|
| 64 | + $meta[] = "<a href='http://wordpress.org/support/view/plugin-reviews/google-maps-builder' target='_blank' title='".__('Rate Google Maps Builder on WordPress.org', 'google-maps-builder')."'>".__('Rate Plugin', 'google-maps-builder')."</a>"; |
|
| 65 | + $meta[] = "<a href='https://wordimpress.com/documentation/maps-builder-pro/' target='_blank' title='".__('View the plugin documentation', 'google-maps-builder')."'>".__('Documentation', 'google-maps-builder')."</a>"; |
|
| 66 | + $meta[] = '<a href="http://wordpress.org/support/plugin/google-maps-builder/" target="_blank" title="'.__('Get plugin support via the WordPress community', 'google-maps-builder').'">'.__('Support', 'google-maps-builder').'</a>'; |
|
| 67 | 67 | $meta[] = '<a href=" |
| 68 | -https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=LISTING&utm_campaign=MBF%20LISTING" title="' . __( 'Upgrade to Maps Builder Pro', 'google-maps-builder' ) . '" target="_blank">' . __( 'Upgrade to Pro', 'google-maps-builder' ) . ' »</a>'; |
|
| 68 | +https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=LISTING&utm_campaign=MBF%20LISTING" title="' . __('Upgrade to Maps Builder Pro', 'google-maps-builder').'" target="_blank">'.__('Upgrade to Pro', 'google-maps-builder').' »</a>'; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | return $meta; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function settings_upsell() { ?> |
| 82 | 82 | <a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SETTINGS&utm_campaign=MBF%20Settings" target="_blank" class="button button-primary gmb-orange-btn gmb-settings-header-btn"> |
| 83 | - <?php _e( 'Upgrade to Pro', 'google-maps-builder' ); ?> |
|
| 83 | + <?php _e('Upgrade to Pro', 'google-maps-builder'); ?> |
|
| 84 | 84 | </a> |
| 85 | 85 | <?php |
| 86 | 86 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ?> |
| 97 | 97 | <div class="go-pro"> |
| 98 | 98 | <a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SETTINGS&utm_campaign=MBF%20Settings" target="_blank" class="button button-primary button-small gmb-orange-btn gmb-settings-header-btn"> |
| 99 | - <?php esc_html_e( 'Upgrade to Pro', 'google-maps-builder' ); ?> |
|
| 99 | + <?php esc_html_e('Upgrade to Pro', 'google-maps-builder'); ?> |
|
| 100 | 100 | </a> |
| 101 | 101 | </div> |
| 102 | 102 | <?php |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | protected function settings_page_data() { |
| 113 | 113 | //place holder |
| 114 | 114 | $data = array( |
| 115 | - 'welcome' => sprintf( '%1s Maps Builder %s', __( 'Welcome to', 'maps-builder-pro' ), Google_Maps_Builder()->meta['Version'] ), |
|
| 115 | + 'welcome' => sprintf('%1s Maps Builder %s', __('Welcome to', 'maps-builder-pro'), Google_Maps_Builder()->meta['Version']), |
|
| 116 | 116 | 'sub_heading' => $this->sub_heading() |
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | - return $this->view_data( $data, true ); |
|
| 119 | + return $this->view_data($data, true); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | * @return string |
| 128 | 128 | */ |
| 129 | 129 | protected function sub_heading() { |
| 130 | - $out = __( 'Thanks for using Maps Builder', 'google-maps-pro' ); |
|
| 131 | - $out .= sprintf( __( 'To get started, read over the %1$sdocumentation%2$s, take a gander at the settings, and build yourself some maps! If you enjoy this plugin please consider telling a friend, rating it %3$s5-stars%2$s, or purchasing the %4$sPro%2$s edition.', 'google-maps-builder' ), '<a href="https://wordimpress.com/documentation/maps-builder-pro/" target="_blank">', '</a>', '<a href="https://wordpress.org/support/view/plugin-reviews/google-maps-builder?filter=5#postform" target="_blank">', '<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SETTINGS&utm_campaign=MBF%20Settings" target="_blank">' ); |
|
| 130 | + $out = __('Thanks for using Maps Builder', 'google-maps-pro'); |
|
| 131 | + $out .= sprintf(__('To get started, read over the %1$sdocumentation%2$s, take a gander at the settings, and build yourself some maps! If you enjoy this plugin please consider telling a friend, rating it %3$s5-stars%2$s, or purchasing the %4$sPro%2$s edition.', 'google-maps-builder'), '<a href="https://wordimpress.com/documentation/maps-builder-pro/" target="_blank">', '</a>', '<a href="https://wordpress.org/support/view/plugin-reviews/google-maps-builder?filter=5#postform" target="_blank">', '<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SETTINGS&utm_campaign=MBF%20Settings" target="_blank">'); |
|
| 132 | 132 | |
| 133 | 133 | return $out; |
| 134 | 134 | |
@@ -35,18 +35,18 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | parent::__construct(); |
| 37 | 37 | |
| 38 | - add_action( 'cmb2_render_google_maps_preview', array( $this, 'cmb2_render_google_maps_preview' ), 10, 2 ); |
|
| 38 | + add_action('cmb2_render_google_maps_preview', array($this, 'cmb2_render_google_maps_preview'), 10, 2); |
|
| 39 | 39 | // Load admin style sheet and JavaScript. |
| 40 | - add_action( 'wp_ajax_hide_welcome', array( $this, 'hide_welcome_callback' ) ); |
|
| 40 | + add_action('wp_ajax_hide_welcome', array($this, 'hide_welcome_callback')); |
|
| 41 | 41 | |
| 42 | 42 | //Add links/information to plugin row meta |
| 43 | - add_filter( 'cmb2_get_metabox_form_format', array( $this, 'gmb_modify_cmb2_form_output' ), 10, 3 ); |
|
| 43 | + add_filter('cmb2_get_metabox_form_format', array($this, 'gmb_modify_cmb2_form_output'), 10, 3); |
|
| 44 | 44 | |
| 45 | 45 | //Widget upsell |
| 46 | - add_action( 'gmb_after_widget_form', array( $this, 'widget_upsell' ) ); |
|
| 46 | + add_action('gmb_after_widget_form', array($this, 'widget_upsell')); |
|
| 47 | 47 | |
| 48 | 48 | //Useful class for free-only styling |
| 49 | - add_filter( 'admin_body_class', array( $this, 'admin_body_classes' ) ); |
|
| 49 | + add_filter('admin_body_class', array($this, 'admin_body_classes')); |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
@@ -55,32 +55,32 @@ discard block |
||
| 55 | 55 | * |
| 56 | 56 | * @since 1.0.0 |
| 57 | 57 | */ |
| 58 | - function cmb2_render_google_maps_preview( $field, $meta ) { |
|
| 58 | + function cmb2_render_google_maps_preview($field, $meta) { |
|
| 59 | 59 | |
| 60 | 60 | /* @var $post */ |
| 61 | 61 | global $post; |
| 62 | 62 | |
| 63 | - $meta = wp_parse_args( $meta, array() ); |
|
| 64 | - $wh_value = get_post_meta( $post->ID, 'gmb_width_height', true ); |
|
| 65 | - $lat_lng = get_post_meta( $post->ID, 'gmb_lat_lng', true ); |
|
| 63 | + $meta = wp_parse_args($meta, array()); |
|
| 64 | + $wh_value = get_post_meta($post->ID, 'gmb_width_height', true); |
|
| 65 | + $lat_lng = get_post_meta($post->ID, 'gmb_lat_lng', true); |
|
| 66 | 66 | $default_options = $this->get_default_map_options(); |
| 67 | 67 | |
| 68 | - $output = '<div class="places-loading wpgp-loading">' . __( 'Loading Places', 'google-maps-builder' ) . '</div><div id="google-map-wrap">'; |
|
| 68 | + $output = '<div class="places-loading wpgp-loading">'.__('Loading Places', 'google-maps-builder').'</div><div id="google-map-wrap">'; |
|
| 69 | 69 | $output .= '<div id="map" style="height:600px; width:100%;"></div>'; |
| 70 | 70 | |
| 71 | - $output .= '<div class="map-modal-upsell"><p class="upsell-intro">' . __( 'Want more?', 'google-maps-builder' ) . '</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!', 'google-maps-builder' ) . '</a></div>'; |
|
| 71 | + $output .= '<div class="map-modal-upsell"><p class="upsell-intro">'.__('Want more?', 'google-maps-builder').'</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!', 'google-maps-builder').'</a></div>'; |
|
| 72 | 72 | |
| 73 | 73 | //Toolbar |
| 74 | 74 | $output .= '<div id="map-toolbar">'; |
| 75 | - $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', 'google-maps-builder' ) . '</button>'; |
|
| 76 | - $output .= '<button class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>' . __( 'Drop a Marker', 'google-maps-builder' ) . '</button>'; |
|
| 77 | - $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', 'google-maps-builder' ) . '</button>'; |
|
| 78 | - $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', 'google-maps-builder' ) . '</button>'; |
|
| 75 | + $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', 'google-maps-builder').'</button>'; |
|
| 76 | + $output .= '<button class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>'.__('Drop a Marker', 'google-maps-builder').'</button>'; |
|
| 77 | + $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', 'google-maps-builder').'</button>'; |
|
| 78 | + $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', 'google-maps-builder').'</button>'; |
|
| 79 | 79 | |
| 80 | 80 | $output .= '<div class="live-lat-lng-wrap clearfix">'; |
| 81 | - $output .= '<button disabled class="update-lat-lng button button-small">' . __( 'Set Lat/Lng', 'google-maps-builder' ) . '</button>'; |
|
| 82 | - $output .= '<div class="live-latitude-wrap"><span class="live-latitude-label">' . __( 'Lat:', 'google-maps-builder' ) . '</span><span class="live-latitude">' . ( isset( $lat_lng['latitude'] ) ? $lat_lng['latitude'] : '' ) . '</span></div>'; |
|
| 83 | - $output .= '<div class="live-longitude-wrap"><span class="live-longitude-label">' . __( 'Lng:', 'google-maps-builder' ) . '</span><span class="live-longitude">' . ( isset( $lat_lng['longitude'] ) ? $lat_lng['longitude'] : '' ) . '</span></div>'; |
|
| 81 | + $output .= '<button disabled class="update-lat-lng button button-small">'.__('Set Lat/Lng', 'google-maps-builder').'</button>'; |
|
| 82 | + $output .= '<div class="live-latitude-wrap"><span class="live-latitude-label">'.__('Lat:', 'google-maps-builder').'</span><span class="live-latitude">'.(isset($lat_lng['latitude']) ? $lat_lng['latitude'] : '').'</span></div>'; |
|
| 83 | + $output .= '<div class="live-longitude-wrap"><span class="live-longitude-label">'.__('Lng:', 'google-maps-builder').'</span><span class="live-longitude">'.(isset($lat_lng['longitude']) ? $lat_lng['longitude'] : '').'</span></div>'; |
|
| 84 | 84 | $output .= '</div>'; //End .live-lat-lng-wrap |
| 85 | 85 | $output .= '</div>'; //End #map-toolbar |
| 86 | 86 | $output .= '</div>'; //End #map |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | $output .= '<div class="inner-modal-wrap">'; |
| 92 | 92 | $output .= '<div class="inner-modal-container">'; |
| 93 | 93 | $output .= '<div class="inner-modal clearfix">'; |
| 94 | - $output .= '<label for="post_title" class="map-title">' . __( 'Map Title', 'google-maps-builder' ) . '</label>'; |
|
| 95 | - $output .= '<p class="cmb2-metabox-description">' . __( 'Give your Map a descriptive title', 'google-maps-builder' ) . '</p>'; |
|
| 96 | - $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', 'google-maps-builder' ) . '">'; |
|
| 94 | + $output .= '<label for="post_title" class="map-title">'.__('Map Title', 'google-maps-builder').'</label>'; |
|
| 95 | + $output .= '<p class="cmb2-metabox-description">'.__('Give your Map a descriptive title', 'google-maps-builder').'</p>'; |
|
| 96 | + $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', 'google-maps-builder').'">'; |
|
| 97 | 97 | $output .= '</div>'; |
| 98 | 98 | $output .= '</div>'; |
| 99 | 99 | $output .= '</div>'; |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | $output .= '<div class="inner-modal-wrap">'; |
| 104 | 104 | $output .= '<div class="inner-modal-container">'; |
| 105 | 105 | $output .= '<div class="inner-modal clearfix">'; |
| 106 | - $output .= '<label for="map-location-autocomplete" class="map-title">' . __( 'Enter a Location', 'google-maps-builder' ) . '</label>'; |
|
| 107 | - $output .= '<p class="cmb2-metabox-description">' . __( 'Type your point of interest below and the map will be re-centered over that location', 'google-maps-builder' ) . '</p>'; |
|
| 106 | + $output .= '<label for="map-location-autocomplete" class="map-title">'.__('Enter a Location', 'google-maps-builder').'</label>'; |
|
| 107 | + $output .= '<p class="cmb2-metabox-description">'.__('Type your point of interest below and the map will be re-centered over that location', 'google-maps-builder').'</p>'; |
|
| 108 | 108 | $output .= '<button type="button" class="gmb-modal-close">×</button>'; |
| 109 | 109 | $output .= '<input type="text" name="" size="30" id="map-location-autocomplete">'; |
| 110 | 110 | $output .= '</div>'; |
@@ -115,9 +115,9 @@ discard block |
||
| 115 | 115 | $output .= '<div class="warning-message wpgp-message"></div>'; |
| 116 | 116 | |
| 117 | 117 | //Markers Modal |
| 118 | - gmb_include_view( 'admin/views/markers.php', false, $this->view_data() ); |
|
| 118 | + gmb_include_view('admin/views/markers.php', false, $this->view_data()); |
|
| 119 | 119 | |
| 120 | - echo apply_filters( 'google_maps_preview', $output ); |
|
| 120 | + echo apply_filters('google_maps_preview', $output); |
|
| 121 | 121 | |
| 122 | 122 | } |
| 123 | 123 | |
@@ -134,12 +134,12 @@ discard block |
||
| 134 | 134 | * |
| 135 | 135 | * @return string |
| 136 | 136 | */ |
| 137 | - function gmb_modify_cmb2_form_output( $form_format, $object_id, $cmb ) { |
|
| 137 | + function gmb_modify_cmb2_form_output($form_format, $object_id, $cmb) { |
|
| 138 | 138 | |
| 139 | 139 | //only modify the give settings form |
| 140 | - if ( 'gmb_settings' == $object_id && 'plugin_options' == $cmb->cmb_id ) { |
|
| 140 | + if ('gmb_settings' == $object_id && 'plugin_options' == $cmb->cmb_id) { |
|
| 141 | 141 | |
| 142 | - return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="gmb-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>'; |
|
| 142 | + return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="gmb-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div></form>'; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | return $form_format; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | <div class="gmb-widget-upgrade clear"> |
| 160 | 160 | <span class="powered-by"></span> |
| 161 | 161 | <a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=WIDGET&utm_campaign=MBF%20Widgets" target="_blank" class="button button-small"> |
| 162 | - <?php _e( 'Upgrade to Pro', 'google-maps-builder' ); ?> |
|
| 162 | + <?php _e('Upgrade to Pro', 'google-maps-builder'); ?> |
|
| 163 | 163 | <span class="new-window"></span> |
| 164 | 164 | </a> |
| 165 | 165 | </div> |
@@ -175,11 +175,11 @@ discard block |
||
| 175 | 175 | * |
| 176 | 176 | * @return String Altered body classes. |
| 177 | 177 | */ |
| 178 | - function admin_body_classes( $classes ) { |
|
| 178 | + function admin_body_classes($classes) { |
|
| 179 | 179 | |
| 180 | 180 | global $post; |
| 181 | 181 | |
| 182 | - if ( isset( $post->post_type ) && $post->post_type == 'google_maps' ) { |
|
| 182 | + if (isset($post->post_type) && $post->post_type == 'google_maps') { |
|
| 183 | 183 | $classes .= 'maps-builder-free'; |
| 184 | 184 | } |
| 185 | 185 | |