Regions for WP Job Manager - Version 1.16.0

Version Description

Download this release

Release Info

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

Code changes from version 1.14.0 to 1.16.0

assets/js/main.js CHANGED
@@ -25,9 +25,13 @@
25
  },
26
 
27
  addSubmission: function() {
28
- $( '#job_region, #resume_region' ).chosen({
29
- search_contains: true
30
- });
 
 
 
 
31
  },
32
 
33
  addRegions: function() {
@@ -55,10 +59,18 @@
55
  search_contains: true
56
  };
57
 
58
- if ( ! wrapper ) {
59
- $regions.chosen( args );
 
 
 
 
60
  } else {
61
- $regions.children( 'select' ).chosen( args );
 
 
 
 
62
  }
63
  });
64
  },
25
  },
26
 
27
  addSubmission: function() {
28
+ if ( typeof chosen === "function" ) {
29
+ $( '#job_region, #resume_region' ).chosen( {
30
+ search_contains: true,
31
+ } );
32
+ } else {
33
+ $( '#job_region, #resume_region' ).select2( job_manager_select2_multiselect_args );
34
+ }
35
  },
36
 
37
  addRegions: function() {
59
  search_contains: true
60
  };
61
 
62
+ if ( typeof chosen === "function" ) {
63
+ if ( ! wrapper ) {
64
+ $regions.chosen( args );
65
+ } else {
66
+ $regions.children( 'select' ).chosen( args );
67
+ }
68
  } else {
69
+ if ( ! wrapper ) {
70
+ $regions.select2( job_manager_select2_multiselect_args );
71
+ } else {
72
+ $regions.children( 'select' ).select2( job_manager_select2_multiselect_args );
73
+ }
74
  }
75
  });
76
  },
includes/class-template.php CHANGED
@@ -30,7 +30,15 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
30
  * Frontend scripts.
31
  */
32
  public function wp_enqueue_scripts() {
33
- wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . 'assets/js/main.js', array( 'jquery', 'chosen' ), 20140525, true );
 
 
 
 
 
 
 
 
34
  }
35
 
36
  public function submit_resume_form_fields_get_resume_data( $fields, $job ) {
@@ -92,6 +100,7 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
92
 
93
  wp_dropdown_categories( apply_filters( 'job_manager_regions_dropdown_args', array(
94
  'show_option_all' => __( 'All Regions', 'wp-job-manager-locations' ),
 
95
  'hierarchical' => true,
96
  'orderby' => 'name',
97
  'taxonomy' => 'job_listing_region',
@@ -144,22 +153,34 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
144
  * @since 1.0.0
145
  */
146
  public function the_job_location( $job_location, $post ) {
147
- if ( is_singular( 'job_listing' ) ) {
148
- return get_the_term_list( $post->ID, 'job_listing_region', '', ', ', '' );
149
- } else {
150
- $terms = wp_get_object_terms( $post->ID, 'job_listing_region', array( 'orderby' => 'term_order', 'order' => 'desc') );
 
 
 
 
151
 
152
- if ( empty( $terms ) ) {
153
- return;
154
- }
155
 
156
- $names = array();
 
 
157
 
 
158
  foreach ( $terms as $term ) {
159
- $names[] = $term->name;
160
  }
161
 
162
- return implode( ', ', $names );
 
 
 
163
  }
 
 
 
 
164
  }
165
  }
30
  * Frontend scripts.
31
  */
32
  public function wp_enqueue_scripts() {
33
+ $deps = array( 'jquery' );
34
+
35
+ if ( wp_script_is( 'chosen' ) ) {
36
+ $deps[] = 'chosen';
37
+ } else {
38
+ $deps[] = 'select2';
39
+ }
40
+
41
+ wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . 'assets/js/main.js', $deps, 20140525, true );
42
  }
43
 
44
  public function submit_resume_form_fields_get_resume_data( $fields, $job ) {
100
 
101
  wp_dropdown_categories( apply_filters( 'job_manager_regions_dropdown_args', array(
102
  'show_option_all' => __( 'All Regions', 'wp-job-manager-locations' ),
103
+ 'multiple' => false,
104
  'hierarchical' => true,
105
  'orderby' => 'name',
106
  'taxonomy' => 'job_listing_region',
153
  * @since 1.0.0
154
  */
155
  public function the_job_location( $job_location, $post ) {
156
+ $terms = wp_get_object_terms(
157
+ $post->ID,
158
+ 'job_listing_region',
159
+ apply_filters( 'job_manager_locations_get_terms', array(
160
+ 'orderby' => 'term_order',
161
+ 'order' => 'desc'
162
+ ) )
163
+ );
164
 
165
+ $_terms = array();
 
 
166
 
167
+ if ( empty( $terms ) ) {
168
+ return;
169
+ }
170
 
171
+ if ( is_singular( 'job_listing' ) ) {
172
  foreach ( $terms as $term ) {
173
+ $_terms[] = '<a href=" ' . esc_url( get_term_link( $term ) ) . '">' . $term->name . '</a>';
174
  }
175
 
176
+ } else {
177
+ foreach ( $terms as $term ) {
178
+ $_terms[] = $term->name;
179
+ }
180
  }
181
+
182
+ $separator = apply_filters( 'job_manager_locations_get_term_list_separator', ', ' );
183
+
184
+ return implode( $separator, $_terms );
185
  }
186
  }
languages/wp-job-manager-locations.pot CHANGED
@@ -1,20 +1,20 @@
1
- # Copyright (C) 2017 Astoundify
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.13.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wp-job-manager-locations\n"
8
- "POT-Creation-Date: 2017-04-12 14:12:52+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\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:74
18
  msgid "Job Region"
19
  msgstr ""
20
 
@@ -63,15 +63,15 @@ msgstr ""
63
  msgid "Resume Regions"
64
  msgstr ""
65
 
66
- #: includes/class-template.php:58
67
  msgid "Region"
68
  msgstr ""
69
 
70
- #: includes/class-template.php:94
71
  msgid "All Regions"
72
  msgstr ""
73
 
74
- #: includes/class-template.php:110
75
  msgid "Select Region"
76
  msgstr ""
77
 
1
+ # Copyright (C) 2019 Astoundify
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"
12
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\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:82
18
  msgid "Job Region"
19
  msgstr ""
20
 
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
 
readme.txt CHANGED
@@ -5,8 +5,8 @@ Donate link: https://www.paypal.me/astoundify
5
  Contributors: Astoundify
6
  Tags: job, job listing, job region
7
  Requires at least: 4.7.0
8
- Tested up to: 4.8.0
9
- Stable Tag: 1.14.0
10
  License: GPLv3
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
 
@@ -31,6 +31,19 @@ Astoundify has released two themes that are fully integrated with the WP Job Man
31
 
32
  == Changelog ==
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  = 1.14.0: July 11, 2017 =
35
 
36
  * New: Listify 2.0+ support.
5
  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.16.0
10
  License: GPLv3
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
 
31
 
32
  == Changelog ==
33
 
34
+ = 1.16.0: January 14, 2018 =
35
+
36
+ * New: WP Job Manager 1.32.0 support.
37
+
38
+ = 1.15.1: May 16, 2018 =
39
+
40
+ * Fix: Revert use `job_manager_dropdown_categories()` function instead of `wp_dropdown_categories()`.
41
+
42
+ = 1.15.0: May 12, 2018 =
43
+
44
+ * New: Use `job_manager_dropdown_categories()` function instead of `wp_dropdown_categories()`.
45
+ * New: Add `job_manager_locations_get_terms` and `job_manager_locations_get_term_list_separator` filters for modifying output.
46
+
47
  = 1.14.0: July 11, 2017 =
48
 
49
  * New: Listify 2.0+ support.
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.14.0
9
  * Text Domain: wp-job-manager-locations
10
  * Domain Path: /languages
11
  */
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.16.0
9
  * Text Domain: wp-job-manager-locations
10
  * Domain Path: /languages
11
  */