/**
  * Change a resumes location data upon editing
  * @param  int $resume_id
  * @param  string $new_location
  */
 public function change_location_data($resume_id, $new_location)
 {
     if (apply_filters('resume_manager_geolocation_enabled', true)) {
         $address_data = WP_Job_Manager_Geocode::get_location_data($new_location);
         WP_Job_Manager_Geocode::clear_location_data($resume_id);
         WP_Job_Manager_Geocode::save_location_data($resume_id, $address_data);
     }
 }
Пример #2
0
 /**
  * Create an array of all of the points found.
  *
  * @since Jobify 1.0
  *
  * @return void
  */
 public function json_points()
 {
     $points = array();
     while ($this->jobs->have_posts()) {
         $this->jobs->the_post();
         $job = get_post();
         if (!$job->geolocation_lat) {
             if (!class_exists('WP_Job_Manager_Geocode')) {
                 continue;
             }
             $address_data = WP_Job_Manager_Geocode::get_location_data($job->_job_location);
             if (!is_wp_error($address_data) && $address_data) {
                 foreach ($address_data as $key => $value) {
                     if ($value) {
                         update_post_meta($job->ID, 'geolocation_' . $key, $value);
                     }
                 }
             }
         }
         $points[] = array('job' => $job->ID, 'location' => array($job->geolocation_lat, $job->geolocation_long), 'permalink' => get_permalink(get_post()->ID), 'title' => sprintf(_x('%s at %s', 'Job title at Company Name', 'jobify'), get_post_field('post_title', get_post()->ID), get_the_company_name(get_post()->ID)));
     }
     return $points;
 }