*/ class Andreadb_Google_Maps_Public { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of the plugin. * @param string $version The version of this plugin. */ public function __construct($plugin_name, $version) { $this->plugin_name = $plugin_name; $this->version = $version; } /** * Register the JavaScript for the public-facing side of the site. * * @since 1.0.0 */ public function dba_google_maps_enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Andreadb_Google_Maps_Loader as all of the hooks are defined * in that particular class. * * The Andreadb_Google_Maps_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ $api_key = get_option('dba_google_maps_api_key'); wp_enqueue_script($this->plugin_name, 'https://maps.googleapis.com/maps/api/js?key=' . $api_key, array('jquery'), null, false); } /** * Register the andreadb_google_maps shortcode. * * @since 1.0.0 * @access public * @uses add_shortcode() */ public function register_dba_google_maps_shortcodes() { add_shortcode('andreadb_google_maps', array($this, 'dba_google_maps_shortcode')); } /** * Displays shortcode on pages * * @since 1.0.0 * @param array $atts Array of shortcode parameters * @return string Slider HTML */ public function dba_google_maps_shortcode($atts) { extract(shortcode_atts( array('id' => 0), $atts, 'andreadb_google_maps' )); if (!$id) { return false; } $google_maps_general = get_post_meta($id, 'dba_google_maps_general', true); $google_maps_markers = get_post_meta($id, 'dba_google_maps_markers', true); $google_maps_controls = get_post_meta($id, 'dba_google_maps_controls', true); $html = '
'; return $html; } }