Regions for WP Job Manager - Version 1.8.0

Version Description

Download this release

Release Info

Developer adampickering
Plugin Icon wp plugin Regions for WP Job Manager
Version 1.8.0
Comparing to
See all releases

Code changes from version 1.7.3 to 1.8.0

assets/js/main.js CHANGED
@@ -15,7 +15,7 @@
15
  var self = this;
16
 
17
  this.cache.$document.on( 'ready', function() {
18
- self.$forms = $( '.search_jobs, .job_search_form' );
19
 
20
  self.addSubmission();
21
  self.addRegions();
@@ -30,22 +30,18 @@
30
 
31
  addRegions: function() {
32
  this.$forms.each(function(i, el) {
33
- $(this).find( '.search_region' ).chosen();
34
- });
35
 
36
- this.$forms.each(function(i, el) {
37
- var location = $(this).find( '.search_location' );
 
 
 
38
  location.html( '' );
39
  location.removeClass( 'search_location' ).addClass( 'search_region' );
40
 
41
- var $chosen = $( this ).find( '#search_region_chosen' );
42
- var $std = $(this).find( '#search_region' );
43
-
44
- if ( $chosen.length ) {
45
- $chosen.detach().appendTo(location);
46
- } else {
47
- $std.detach().appendTo(location);
48
- }
49
  });
50
  },
51
 
15
  var self = this;
16
 
17
  this.cache.$document.on( 'ready', function() {
18
+ self.$forms = $( '.search_jobs' );
19
 
20
  self.addSubmission();
21
  self.addRegions();
30
 
31
  addRegions: function() {
32
  this.$forms.each(function(i, el) {
33
+ var $regions = $(el).find( 'select.search_region' );
 
34
 
35
+ if ( ! $regions.length ) {
36
+ return;
37
+ }
38
+
39
+ var location = $(el).find( '.search_location' );
40
  location.html( '' );
41
  location.removeClass( 'search_location' ).addClass( 'search_region' );
42
 
43
+ $regions.detach().appendTo(location);
44
+ $regions.chosen();
 
 
 
 
 
 
45
  });
46
  },
47
 
includes/class-taxonomy.php CHANGED
@@ -3,7 +3,7 @@
3
  class Astoundify_Job_Manager_Regions_Taxonomy extends Astoundify_Job_Manager_Regions {
4
 
5
  public function __construct() {
6
- add_action( 'init', array( $this, 'register_taxonomy' ), 0 );
7
  }
8
 
9
  /**
@@ -59,4 +59,4 @@ class Astoundify_Job_Manager_Regions_Taxonomy extends Astoundify_Job_Manager_Reg
59
  );
60
  }
61
 
62
- }
3
  class Astoundify_Job_Manager_Regions_Taxonomy extends Astoundify_Job_Manager_Regions {
4
 
5
  public function __construct() {
6
+ add_action( 'init', array( $this, 'register_taxonomy' ), 1 );
7
  }
8
 
9
  /**
59
  );
60
  }
61
 
62
+ }
includes/class-template.php CHANGED
@@ -5,6 +5,7 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
5
  public function __construct() {
6
  add_filter( 'submit_job_form_fields', array( $this, 'submit_job_form_fields' ) );
7
  add_filter( 'the_job_location', array( $this, 'the_job_location' ), 10, 2 );
 
8
 
9
  add_action( 'wp', array( $this, 'sort' ) );
10
  }
@@ -26,6 +27,16 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
26
  wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . '/assets/js/main.js', array( 'jquery', 'chosen' ), 20140525, true );
27
  }
28
 
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Add the field to the submission form.
31
  */
@@ -53,6 +64,7 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
53
  wp_dropdown_categories( apply_filters( 'job_manager_regions_dropdown_args', array(
54
  'show_option_all' => __( 'All Regions', 'wp-job-manager-locations' ),
55
  'hierarchical' => true,
 
56
  'taxonomy' => 'job_listing_region',
57
  'name' => 'search_region',
58
  'class' => 'search_region',
@@ -95,7 +107,7 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
95
  if ( is_singular( 'job_listing' ) ) {
96
  return get_the_term_list( $post->ID, 'job_listing_region', '', ', ', '' );
97
  } else {
98
- $terms = wp_get_object_terms( $post->ID, 'job_listing_region' );
99
 
100
  if ( empty( $terms ) ) {
101
  return;
5
  public function __construct() {
6
  add_filter( 'submit_job_form_fields', array( $this, 'submit_job_form_fields' ) );
7
  add_filter( 'the_job_location', array( $this, 'the_job_location' ), 10, 2 );
8
+ add_filter( 'submit_job_form_fields_get_job_data', array( $this, 'submit_job_form_fields_get_job_data' ), 10, 2 );
9
 
10
  add_action( 'wp', array( $this, 'sort' ) );
11
  }
27
  wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . '/assets/js/main.js', array( 'jquery', 'chosen' ), 20140525, true );
28
  }
29
 
30
+ public function submit_job_form_fields_get_job_data( $fields, $job ) {
31
+ $field = isset( $fields[ 'job' ][ 'job_region' ] ) ? $fields[ 'job' ][ 'job_region' ] : false;
32
+
33
+ if ( $field ) {
34
+ $fields[ 'job' ][ 'job_region' ][ 'value' ] = wp_get_object_terms( $job->ID, $field['taxonomy'], array( 'fields' => 'ids' ) );
35
+ }
36
+
37
+ return $fields;
38
+ }
39
+
40
  /**
41
  * Add the field to the submission form.
42
  */
64
  wp_dropdown_categories( apply_filters( 'job_manager_regions_dropdown_args', array(
65
  'show_option_all' => __( 'All Regions', 'wp-job-manager-locations' ),
66
  'hierarchical' => true,
67
+ 'orderby' => 'name',
68
  'taxonomy' => 'job_listing_region',
69
  'name' => 'search_region',
70
  'class' => 'search_region',
107
  if ( is_singular( 'job_listing' ) ) {
108
  return get_the_term_list( $post->ID, 'job_listing_region', '', ', ', '' );
109
  } else {
110
+ $terms = wp_get_object_terms( $post->ID, 'job_listing_region', array( 'orderby' => 'term_order', 'order' => 'desc') );
111
 
112
  if ( empty( $terms ) ) {
113
  return;
readme.txt CHANGED
@@ -6,8 +6,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=contact@
6
  Contributors: Astoundify
7
  Tags: job, job listing, job region
8
  Requires at least: 4.1
9
- Tested up to: 4.2.1
10
- Stable Tag: 1.7.3
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -32,6 +32,10 @@ Astoundify has released two themes that are fully integrated with the WP Job Man
32
 
33
  == Changelog ==
34
 
 
 
 
 
35
  = 1.7.3: April 1, 2015 =
36
 
37
  * Fix: Make sure the regions dropdown can always replace the location input.
6
  Contributors: Astoundify
7
  Tags: job, job listing, job region
8
  Requires at least: 4.1
9
+ Tested up to: 4.3.0
10
+ Stable Tag: 1.8.0
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
13
 
32
 
33
  == Changelog ==
34
 
35
+ = 1.8.0: August 12, 2015 =
36
+
37
+ * Fix: Listify 1.0.6 compatibility.
38
+
39
  = 1.7.3: April 1, 2015 =
40
 
41
  * Fix: Make sure the regions dropdown can always replace the location input.
wp-job-manager-locations.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
  * Plugin Name: WP Job Manager - Predefined Regions
4
- * Plugin URI: https://github.com/astoundify/wp-job-manager-regions/
5
  * Description: Create predefined regions/locations that job submissions can associate themselves with.
6
  * Author: Astoundify
7
  * Author URI: http://astoundify.com
8
- * Version: 1.7.3
9
  * Text Domain: wp-job-manager-locations
10
  */
11
 
1
  <?php
2
  /**
3
  * Plugin Name: WP Job Manager - Predefined Regions
4
+ * Plugin URI: https://wordpress.org/plugins/wp-job-manager-locations/
5
  * Description: Create predefined regions/locations that job submissions can associate themselves with.
6
  * Author: Astoundify
7
  * Author URI: http://astoundify.com
8
+ * Version: 1.8.0
9
  * Text Domain: wp-job-manager-locations
10
  */
11