/**
  * Enqueue the single view script & add localized data
  */
 private function enqueueScripts()
 {
     if (isset($this->location_data['latitude']) && isset($this->location_data['longitude'])) {
         wp_enqueue_script('simple-locator-single', \SimpleLocator\Helpers::plugin_url() . '/assets/js/simple-locator-single.js', array('jquery', 'simple-locator'), '1.0');
         wp_localize_script('simple-locator-single', 'wpsl_locator_single', $this->location_data);
     }
 }
예제 #2
0
 public function __construct()
 {
     $this->plugin_dir = \SimpleLocator\Helpers::plugin_url();
     $this->styles_repo = new MapStyles();
     $this->settings_repo = new SettingsRepository();
     $this->setPostType();
 }
 /**
  * Enqueue the single view script & add localized data
  */
 private function enqueueScripts()
 {
     wp_enqueue_script('google-maps');
     wp_enqueue_script('simple-locator');
     wp_enqueue_script('simple-locator-all', \SimpleLocator\Helpers::plugin_url() . '/assets/js/simple-locator-all-locations.js', array('jquery'), '1.0');
     wp_localize_script('simple-locator-all', 'wpsl_locator_all', array('locations' => $this->locations));
 }