コード例 #1
0
 private static function saveData()
 {
     if (isset($_POST['gmsites-options'])) {
         $options = $_POST['options'];
         self::$updated = true;
         if ((object) $options != GoogleMapsSites::options()) {
             self::$updated = update_site_option('_google_maps_sites_options', $options);
         }
     }
 }
コード例 #2
0
        public function registerScripts()
        {
            echo '<script type="text/javascript">
				var ajaxurl = "' . admin_url('admin-ajax.php') . '";
				var googleMapsSitesID = "' . GoogleMapsSites::options()->mapid . '"
				var googleMapsSitesLatitude = "' . GoogleMapsSites::options()->latitude . '"
				var googleMapsSitesLongitude = "' . GoogleMapsSites::options()->longitude . '"
			 </script>';
            wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js');
            wp_enqueue_script('jquery');
            wp_enqueue_script('sitemapGoogleMapAPI', 'https://maps.googleapis.com/maps/api/js?key=' . GoogleMapsSites::options()->apikey . '&sensor=false');
            wp_enqueue_script('sitemapGoogleMapAPI');
            wp_register_script('sitemapInformations', GMSITES__PLUGIN_URL . 'js/classes/sitemap-informations.js');
            wp_enqueue_script('sitemapInformations');
            wp_register_script('sitemapScripts', GMSITES__PLUGIN_URL . 'js/sitemap.js');
            wp_enqueue_script('sitemapScripts');
        }