Regions for WP Job Manager - Version 1.17.3

Version Description

Download this release

Release Info

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

Code changes from version 1.17.2 to 1.17.3

assets/js/main.js CHANGED
@@ -9,10 +9,6 @@
9
 
10
  init: function() {
11
  this.bindEvents();
12
-
13
- this.select2_args = job_manager_select2_args || {};
14
- this.select2_args['allowClear'] = true;
15
- this.select2_args['minimumResultsForSearch'] = 10;
16
  },
17
 
18
  bindEvents: function() {
@@ -21,6 +17,15 @@
21
  this.cache.$document.on( 'ready', function() {
22
  self.$forms = $( '.search_jobs' );
23
 
 
 
 
 
 
 
 
 
 
24
  self.addSubmission();
25
  self.addRegions();
26
  self.updateResults();
9
 
10
  init: function() {
11
  this.bindEvents();
 
 
 
 
12
  },
13
 
14
  bindEvents: function() {
17
  this.cache.$document.on( 'ready', function() {
18
  self.$forms = $( '.search_jobs' );
19
 
20
+ if ( typeof job_manager_select2_args === "undefined" ) {
21
+ this.select2_args = {};
22
+ } else {
23
+ this.select2_args = job_manager_select2_args;
24
+ }
25
+
26
+ this.select2_args['allowClear'] = true;
27
+ this.select2_args['minimumResultsForSearch'] = 10;
28
+
29
  self.addSubmission();
30
  self.addRegions();
31
  self.updateResults();
includes/class-template.php CHANGED
@@ -5,9 +5,15 @@ 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( 'submit_resume_form_fields', array( $this, 'submit_resume_form_fields' ) );
 
8
  if ( get_option( 'job_manager_enable_regions_filter' ) ) {
9
- add_filter( 'the_job_location', array( $this, 'the_job_location' ), 10, 2 );
 
 
 
 
10
  }
 
11
  add_filter( 'submit_job_form_fields_get_job_data', array( $this, 'submit_job_form_fields_get_job_data' ), 10, 2 );
12
  add_filter( 'submit_resume_form_fields_get_resume_data', array( $this, 'submit_resume_form_fields_get_resume_data' ), 10, 2 );
13
  add_filter( 'job_manager_term_select_field_wp_dropdown_categories_args', array( $this, 'job_manager_term_select_field_wp_dropdown_categories_args' ), 10, 3 );
@@ -44,7 +50,7 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
44
  wp_enqueue_style( 'chosen' );
45
  }
46
 
47
- wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . 'assets/js/main.js', array( 'jquery' ), 20140525, true );
48
  }
49
 
50
  public function submit_resume_form_fields_get_resume_data( $fields, $job ) {
@@ -158,10 +164,11 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
158
  *
159
  * @since 1.0.0
160
  */
161
- public function the_job_location( $job_location, $post ) {
 
162
  $terms = wp_get_object_terms(
163
  $post->ID,
164
- 'job_listing_region',
165
  apply_filters( 'job_manager_locations_get_terms', array(
166
  'orderby' => 'term_order',
167
  'order' => 'desc'
@@ -174,7 +181,7 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
174
  return;
175
  }
176
 
177
- if ( is_singular( 'job_listing' ) ) {
178
  foreach ( $terms as $term ) {
179
  $_terms[] = '<a href=" ' . esc_url( get_term_link( $term ) ) . '">' . $term->name . '</a>';
180
  }
5
  public function __construct() {
6
  add_filter( 'submit_job_form_fields', array( $this, 'submit_job_form_fields' ) );
7
  add_filter( 'submit_resume_form_fields', array( $this, 'submit_resume_form_fields' ) );
8
+
9
  if ( get_option( 'job_manager_enable_regions_filter' ) ) {
10
+ add_filter( 'the_job_location', array( $this, 'the_listing_location' ), 10, 2 );
11
+ }
12
+
13
+ if ( get_option( 'resume_manager_enable_regions_filter' ) ) {
14
+ add_filter( 'the_candidate_location', array( $this, 'the_listing_location' ), 10, 2 );
15
  }
16
+
17
  add_filter( 'submit_job_form_fields_get_job_data', array( $this, 'submit_job_form_fields_get_job_data' ), 10, 2 );
18
  add_filter( 'submit_resume_form_fields_get_resume_data', array( $this, 'submit_resume_form_fields_get_resume_data' ), 10, 2 );
19
  add_filter( 'job_manager_term_select_field_wp_dropdown_categories_args', array( $this, 'job_manager_term_select_field_wp_dropdown_categories_args' ), 10, 3 );
50
  wp_enqueue_style( 'chosen' );
51
  }
52
 
53
+ wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . 'assets/js/main.js', array( 'jquery' ), 20190128, true );
54
  }
55
 
56
  public function submit_resume_form_fields_get_resume_data( $fields, $job ) {
164
  *
165
  * @since 1.0.0
166
  */
167
+ public function the_listing_location( $job_location, $post ) {
168
+
169
  $terms = wp_get_object_terms(
170
  $post->ID,
171
+ 'job_listing' === $post->post_type ? 'job_listing_region' : 'resume_region',
172
  apply_filters( 'job_manager_locations_get_terms', array(
173
  'orderby' => 'term_order',
174
  'order' => 'desc'
181
  return;
182
  }
183
 
184
+ if ( is_singular( array( 'job_listing', 'resume' ) ) ) {
185
  foreach ( $terms as $term ) {
186
  $_terms[] = '<a href=" ' . esc_url( get_term_link( $term ) ) . '">' . $term->name . '</a>';
187
  }
languages/wp-job-manager-locations.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the Regions for WP Job Manager package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Regions for WP Job Manager 1.16.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wp-job-manager-locations\n"
8
- "POT-Creation-Date: 2019-01-14 15:35:04+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -14,7 +14,7 @@ msgstr ""
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "X-Generator: grunt-wp-i18n1.0.0\n"
16
 
17
- #: includes/class-taxonomy.php:17 includes/class-template.php:82
18
  msgid "Job Region"
19
  msgstr ""
20
 
@@ -63,15 +63,15 @@ msgstr ""
63
  msgid "Resume Regions"
64
  msgstr ""
65
 
66
- #: includes/class-template.php:66
67
  msgid "Region"
68
  msgstr ""
69
 
70
- #: includes/class-template.php:102
71
  msgid "All Regions"
72
  msgstr ""
73
 
74
- #: includes/class-template.php:119
75
  msgid "Select Region"
76
  msgstr ""
77
 
@@ -96,11 +96,10 @@ msgid "Replace the entered address with the selected region on output."
96
  msgstr ""
97
 
98
  #: wp-job-manager-locations.php:109 wp-job-manager-locations.php:110
99
- #: wp-job-manager-locations.php:130 wp-job-manager-locations.php:131
100
  msgid "Search by Region"
101
  msgstr ""
102
 
103
- #: wp-job-manager-locations.php:111 wp-job-manager-locations.php:132
104
  msgid ""
105
  "Use a dropdown of defined regions instead of a text input. Disables radius "
106
  "search."
2
  # This file is distributed under the same license as the Regions for WP Job Manager package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Regions for WP Job Manager 1.17.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wp-job-manager-locations\n"
8
+ "POT-Creation-Date: 2019-01-30 16:45:28+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "X-Generator: grunt-wp-i18n1.0.0\n"
16
 
17
+ #: includes/class-taxonomy.php:17 includes/class-template.php:94
18
  msgid "Job Region"
19
  msgstr ""
20
 
63
  msgid "Resume Regions"
64
  msgstr ""
65
 
66
+ #: includes/class-template.php:78
67
  msgid "Region"
68
  msgstr ""
69
 
70
+ #: includes/class-template.php:114
71
  msgid "All Regions"
72
  msgstr ""
73
 
74
+ #: includes/class-template.php:131
75
  msgid "Select Region"
76
  msgstr ""
77
 
96
  msgstr ""
97
 
98
  #: wp-job-manager-locations.php:109 wp-job-manager-locations.php:110
 
99
  msgid "Search by Region"
100
  msgstr ""
101
 
102
+ #: wp-job-manager-locations.php:111
103
  msgid ""
104
  "Use a dropdown of defined regions instead of a text input. Disables radius "
105
  "search."
readme.txt CHANGED
@@ -6,7 +6,7 @@ Contributors: Astoundify
6
  Tags: job, job listing, job region
7
  Requires at least: 4.7.0
8
  Tested up to: 5.0.3
9
- Stable Tag: 1.17.2
10
  License: GPLv3
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
 
@@ -31,7 +31,12 @@ Astoundify has released two themes that are fully integrated with the WP Job Man
31
 
32
  == Changelog ==
33
 
34
- = 1.17.1: January 28, 2018 =
 
 
 
 
 
35
 
36
  * Fix: Ensure select2 arguments are always defined.
37
 
6
  Tags: job, job listing, job region
7
  Requires at least: 4.7.0
8
  Tested up to: 5.0.3
9
+ Stable Tag: 1.17.3
10
  License: GPLv3
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
 
31
 
32
  == Changelog ==
33
 
34
+ = 1.17.3: January 30, 2018 =
35
+
36
+ * Fix: Output region instead of candidate location if setting is enabled.
37
+ * Fix: Further WP Job Manager compatibility.
38
+
39
+ = 1.17.1/2: January 26, 2018 =
40
 
41
  * Fix: Ensure select2 arguments are always defined.
42
 
wp-job-manager-locations.php CHANGED
@@ -5,7 +5,7 @@
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.17.2
9
  * Text Domain: wp-job-manager-locations
10
  * Domain Path: /languages
11
  */
@@ -82,9 +82,9 @@ class Astoundify_Job_Manager_Regions {
82
  /* Resumes */
83
  add_filter( 'resume_manager_settings', array( $this, 'resume_manager_settings' ) );
84
 
85
- add_filter( 'resume_manager_output_resumes_defaults', array( $this, 'resume_manager_output_resumes_defaults' ) );
86
- add_filter( 'resume_manager_get_resumes', array( $this, 'resume_manager_get_resumes' ), 10, 2 );
87
- add_filter( 'resume_manager_get_resumes_args', array( $this, 'job_manager_get_listings_args' ) );
88
  }
89
 
90
  /**
@@ -124,14 +124,14 @@ class Astoundify_Job_Manager_Regions {
124
  'desc' => __( 'Replace the entered address with the selected region on output.', 'wp-job-manager-locations' ),
125
  'type' => 'checkbox'
126
  );
127
- $settings[ 'resume_listings' ][1][] = array(
128
- 'name' => 'resume_manager_regions_filter',
129
- 'std' => '0',
130
- 'label' => __( 'Search by Region', 'wp-job-manager-locations' ),
131
- 'cb_label' => __( 'Search by Region', 'wp-job-manager-locations' ),
132
- 'desc' => __( 'Use a dropdown of defined regions instead of a text input. Disables radius search.', 'wp-job-manager-locations' ),
133
- 'type' => 'checkbox'
134
- );
135
 
136
  return $settings;
137
  }
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.17.3
9
  * Text Domain: wp-job-manager-locations
10
  * Domain Path: /languages
11
  */
82
  /* Resumes */
83
  add_filter( 'resume_manager_settings', array( $this, 'resume_manager_settings' ) );
84
 
85
+ // add_filter( 'resume_manager_output_resumes_defaults', array( $this, 'resume_manager_output_resumes_defaults' ) );
86
+ // add_filter( 'resume_manager_get_resumes', array( $this, 'resume_manager_get_resumes' ), 10, 2 );
87
+ // add_filter( 'resume_manager_get_resumes_args', array( $this, 'job_manager_get_listings_args' ) );
88
  }
89
 
90
  /**
124
  'desc' => __( 'Replace the entered address with the selected region on output.', 'wp-job-manager-locations' ),
125
  'type' => 'checkbox'
126
  );
127
+ // $settings[ 'resume_listings' ][1][] = array(
128
+ // 'name' => 'resume_manager_regions_filter',
129
+ // 'std' => '0',
130
+ // 'label' => __( 'Search by Region', 'wp-job-manager-locations' ),
131
+ // 'cb_label' => __( 'Search by Region', 'wp-job-manager-locations' ),
132
+ // 'desc' => __( 'Use a dropdown of defined regions instead of a text input. Disables radius search.', 'wp-job-manager-locations' ),
133
+ // 'type' => 'checkbox'
134
+ // );
135
 
136
  return $settings;
137
  }