Google_Maps_Builder_Settings

Class Google_Maps_Builder_Settings.

Defined (1)

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

/includes/admin/class-gmb-settings.php  
  1. class Google_Maps_Builder_Settings extends Google_Maps_Builder_Core_Settings { 
  2.  
  3. /** 
  4. * Option key, and option page slug. 
  5. * @var string 
  6. */ 
  7. protected static $key = 'gmb_settings'; 
  8.  
  9.  
  10. /** 
  11. * Constructor 
  12. * @since 0.1.0 
  13. */ 
  14. public function __construct() { 
  15. parent::__construct(); 
  16. $this->page_name = __( 'Google Maps Builder Settings', 'google-maps-builder' ); 
  17.  
  18. add_action( 'cmb2_render_lat_lng_default', array( $this, 'cmb2_render_lat_lng_default' ), 10, 2 ); 
  19.  
  20. //upsell markup 
  21. add_action( 'gmb_settings_page_after_logo', array( $this, 'settings_upsell' ) ); 
  22. add_action( 'gmb_social_media_after_logo', array( $this, 'settings_social_media_upsell' ) ); 
  23.  
  24.  
  25. /** 
  26. * Add links to Plugin listings view 
  27. * @param $links 
  28. * @return mixed 
  29. */ 
  30. function add_plugin_page_links( $links, $file ) { 
  31.  
  32. if ( $file == GMB_PLUGIN_BASE ) { 
  33.  
  34. // Add Widget Page link to our plugin 
  35. $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>'; 
  36. array_unshift( $links, $settings_link ); 
  37.  
  38. return $links; 
  39.  
  40. /** 
  41. * Add Plugin Meta Links 
  42. * @description: Adds links to the plugin listing page in wp-admin 
  43. * @param $meta 
  44. * @param $file 
  45. * @return array 
  46. */ 
  47. function add_plugin_meta_links( $meta, $file ) { 
  48.  
  49. if ( $file == GMB_PLUGIN_BASE ) { 
  50. $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>"; 
  51. $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>"; 
  52. $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>'; 
  53. $meta[] = '<a href=" 
  54. 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>'; 
  55.  
  56. return $meta; 
  57.  
  58. /** 
  59. * Add upsell in settings page 
  60. * @since 2.1.0 
  61. * @uses "gmb_settings_page_after_logo" action 
  62. */ 
  63. public function settings_upsell() { ?> 
  64. <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 gmb-settings-header-btn"> 
  65. <?php _e( 'Upgrade to Pro', 'google-maps-builder' ); ?> 
  66. </a> 
  67. <?php 
  68.  
  69. /** 
  70. * Add upsell in social media section. 
  71. * @since 2.1.0 
  72. * @uses "gmb_social_media_after_logo" action 
  73. */ 
  74. public function settings_social_media_upsell() { 
  75. ?> 
  76. <div class="go-pro"> 
  77. <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-settings-header-btn"> 
  78. <?php esc_html_e( 'Upgrade to Pro', 'google-maps-builder' ); ?> 
  79. </a> 
  80. </div> 
  81. <?php 
  82.  
  83. /** 
  84. * Handle main data for the settings page 
  85. * @since 2.1.0 
  86. * @return array 
  87. */ 
  88. protected function settings_page_data() { 
  89. //place holder 
  90. $data = array( 
  91. 'welcome' => sprintf( '%1s Maps Builder %s', __( 'Welcome to', 'maps-builder-pro' ), Google_Maps_Builder()->meta['Version'] ),  
  92. 'sub_heading' => $this->sub_heading() 
  93. ); 
  94.  
  95. return $this->view_data( $data, true ); 
  96.  
  97. /** 
  98. * Sub heading markup for settings page 
  99. * @since 2.1.0 
  100. * @return string 
  101. */ 
  102. protected function sub_heading() { 
  103. $out = __( 'Thanks for using Maps Builder. ', 'google-maps-pro' ); 
  104. $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">' ); 
  105.  
  106. return $out; 
  107.  
  108.  
  109.