Version Description
Download this release
Release Info
Developer | adampickering |
Plugin | Regions for WP Job Manager |
Version | 1.7.1 |
Comparing to | |
See all releases |
Code changes from version 1.7.0 to 1.7.1
- assets/js/main.js +24 -12
- includes/class-template.php +4 -4
- readme.txt +10 -2
- wp-job-manager-locations.php +23 -10
assets/js/main.js
CHANGED
@@ -9,35 +9,47 @@
|
|
9 |
},
|
10 |
|
11 |
init: function() {
|
12 |
-
this.cacheElements();
|
13 |
this.bindEvents();
|
14 |
},
|
15 |
|
16 |
-
cacheElements: function() {
|
17 |
-
this.cache.$location = this.cache.$search_jobs.find( '.search_location' );
|
18 |
-
this.cache.$regions = this.cache.$search_jobs.find( '.search_region' ).first();
|
19 |
-
},
|
20 |
-
|
21 |
bindEvents: function() {
|
22 |
var self = this;
|
23 |
|
24 |
this.cache.$document.on( 'ready', function() {
|
|
|
25 |
self.addRegions();
|
26 |
self.updateResults();
|
27 |
self.resetResults();
|
28 |
});
|
29 |
},
|
30 |
|
|
|
|
|
|
|
|
|
31 |
addRegions: function() {
|
32 |
-
this.cache.$
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
},
|
35 |
|
36 |
updateResults: function() {
|
37 |
-
this.cache.$
|
38 |
-
var
|
|
|
|
|
|
|
39 |
|
40 |
-
|
|
|
41 |
});
|
42 |
},
|
43 |
|
@@ -52,4 +64,4 @@
|
|
52 |
|
53 |
jobRegions.init();
|
54 |
|
55 |
-
})(jQuery);
|
9 |
},
|
10 |
|
11 |
init: function() {
|
|
|
12 |
this.bindEvents();
|
13 |
},
|
14 |
|
|
|
|
|
|
|
|
|
|
|
15 |
bindEvents: function() {
|
16 |
var self = this;
|
17 |
|
18 |
this.cache.$document.on( 'ready', function() {
|
19 |
+
self.addSubmission();
|
20 |
self.addRegions();
|
21 |
self.updateResults();
|
22 |
self.resetResults();
|
23 |
});
|
24 |
},
|
25 |
|
26 |
+
addSubmission: function() {
|
27 |
+
$( '#job_region' ).chosen();
|
28 |
+
},
|
29 |
+
|
30 |
addRegions: function() {
|
31 |
+
this.cache.$search_jobs.each(function(i, el) {
|
32 |
+
$(this).find( '.search_region' ).chosen();
|
33 |
+
});
|
34 |
+
|
35 |
+
this.cache.$search_jobs.each(function(i, el) {
|
36 |
+
var location = $(this).find( '.search_location' );
|
37 |
+
location.html( '' );
|
38 |
+
location.removeClass( 'search_location' ).addClass( 'search_region' );
|
39 |
+
|
40 |
+
$(this).find( '#search_region_chosen' ).detach().appendTo(location);
|
41 |
+
});
|
42 |
},
|
43 |
|
44 |
updateResults: function() {
|
45 |
+
this.cache.$search_jobs.each(function(i, el) {
|
46 |
+
var region = $(this).find( '.search_region' );
|
47 |
+
|
48 |
+
region.on( 'change', function() {
|
49 |
+
var target = $(this).closest( 'div.job_listings' );
|
50 |
|
51 |
+
target.trigger( 'update_results', [ 1, false ] );
|
52 |
+
});
|
53 |
});
|
54 |
},
|
55 |
|
64 |
|
65 |
jobRegions.init();
|
66 |
|
67 |
+
})(jQuery);
|
includes/class-template.php
CHANGED
@@ -5,7 +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 |
}
|
11 |
|
@@ -19,11 +19,11 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
|
|
19 |
}
|
20 |
}
|
21 |
|
22 |
-
/**
|
23 |
* Frontend scripts.
|
24 |
*/
|
25 |
public function wp_enqueue_scripts() {
|
26 |
-
wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . '/assets/js/main.js', array( 'jquery' ), 20140525, true );
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -96,7 +96,7 @@ class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Reg
|
|
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;
|
102 |
}
|
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 |
}
|
11 |
|
19 |
}
|
20 |
}
|
21 |
|
22 |
+
/**
|
23 |
* Frontend scripts.
|
24 |
*/
|
25 |
public function wp_enqueue_scripts() {
|
26 |
+
wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . '/assets/js/main.js', array( 'jquery', 'chosen' ), 20140525, true );
|
27 |
}
|
28 |
|
29 |
/**
|
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;
|
102 |
}
|
readme.txt
CHANGED
@@ -2,12 +2,12 @@
|
|
2 |
|
3 |
Author URI: http://astoundify.com
|
4 |
Plugin URI: http://astoundify.com
|
5 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=contact@
|
6 |
Contributors: Astoundify, SpencerFinnell
|
7 |
Tags: job, job listing, job region
|
8 |
Requires at least: 3.6
|
9 |
Tested up to: 4.1
|
10 |
-
Stable Tag: 1.7.
|
11 |
License: GPLv3
|
12 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
13 |
|
@@ -32,6 +32,14 @@ Astoundify has released two themes that are fully integrated with the WP Job Man
|
|
32 |
|
33 |
== Changelog ==
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
= 1.7.0: January 8, 2015 =
|
36 |
|
37 |
* New: Add es_ES translation.
|
2 |
|
3 |
Author URI: http://astoundify.com
|
4 |
Plugin URI: http://astoundify.com
|
5 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=contact@astoundify.com&item_name=Donation+for+Astoundify WP Job Manager Regions
|
6 |
Contributors: Astoundify, SpencerFinnell
|
7 |
Tags: job, job listing, job region
|
8 |
Requires at least: 3.6
|
9 |
Tested up to: 4.1
|
10 |
+
Stable Tag: 1.7.1
|
11 |
License: GPLv3
|
12 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
13 |
|
32 |
|
33 |
== Changelog ==
|
34 |
|
35 |
+
= 1.7.1: March 15, 2015 =
|
36 |
+
|
37 |
+
* New: Add Chosen dropdown support.
|
38 |
+
* New: Add WP Job Manager Alerts support.
|
39 |
+
* New: Add Danish tranlsation.
|
40 |
+
* Tweak: Use $_REQUEST to add support for 1.21.0 of WP Jon Manager.
|
41 |
+
* Fix: Remove extra whitespace.
|
42 |
+
|
43 |
= 1.7.0: January 8, 2015 =
|
44 |
|
45 |
* New: Add es_ES translation.
|
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.7.
|
9 |
* Text Domain: wp-job-manager-locations
|
10 |
*/
|
11 |
|
@@ -96,7 +96,7 @@ class Astoundify_Job_Manager_Regions {
|
|
96 |
return $settings;
|
97 |
}
|
98 |
|
99 |
-
/**
|
100 |
* Modify the default shortcode attributes for displaying listings.
|
101 |
*
|
102 |
* If we are on a listing region term archive set the selected_region so
|
@@ -122,9 +122,9 @@ class Astoundify_Job_Manager_Regions {
|
|
122 |
public function job_manager_get_listings( $args ) {
|
123 |
$params = array();
|
124 |
|
125 |
-
if ( isset( $
|
126 |
|
127 |
-
parse_str( $
|
128 |
|
129 |
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
130 |
$region = $params[ 'search_region' ];
|
@@ -146,6 +146,7 @@ class Astoundify_Job_Manager_Regions {
|
|
146 |
}
|
147 |
|
148 |
} elseif ( isset( $_GET[ 'selected_region' ] ) ) {
|
|
|
149 |
$region = $_GET[ 'selected_region' ];
|
150 |
|
151 |
if ( is_int( $region ) ) {
|
@@ -158,8 +159,20 @@ class Astoundify_Job_Manager_Regions {
|
|
158 |
'terms' => $region,
|
159 |
'operator' => 'IN'
|
160 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
}
|
162 |
-
|
163 |
|
164 |
return $args;
|
165 |
}
|
@@ -171,9 +184,9 @@ class Astoundify_Job_Manager_Regions {
|
|
171 |
public function job_manager_get_listings_args( $args ) {
|
172 |
$params = array();
|
173 |
|
174 |
-
if ( isset( $
|
175 |
|
176 |
-
parse_str( $
|
177 |
|
178 |
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
179 |
$args[ 'search_location' ] = null;
|
@@ -185,12 +198,12 @@ class Astoundify_Job_Manager_Regions {
|
|
185 |
}
|
186 |
|
187 |
/**
|
188 |
-
* Filter the AJAX to update the "showing" text.
|
189 |
*/
|
190 |
public function custom_filter_text( $text ) {
|
191 |
$params = array();
|
192 |
|
193 |
-
parse_str( $
|
194 |
|
195 |
$term = get_term( $params[ 'search_region' ], 'job_listing_region' );
|
196 |
|
@@ -205,7 +218,7 @@ class Astoundify_Job_Manager_Regions {
|
|
205 |
public function custom_filter_rss( $args ) {
|
206 |
$params = array();
|
207 |
|
208 |
-
parse_str( $
|
209 |
|
210 |
$args[ 'job_region' ] = $params[ 'search_region' ];
|
211 |
|
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.1
|
9 |
* Text Domain: wp-job-manager-locations
|
10 |
*/
|
11 |
|
96 |
return $settings;
|
97 |
}
|
98 |
|
99 |
+
/**
|
100 |
* Modify the default shortcode attributes for displaying listings.
|
101 |
*
|
102 |
* If we are on a listing region term archive set the selected_region so
|
122 |
public function job_manager_get_listings( $args ) {
|
123 |
$params = array();
|
124 |
|
125 |
+
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
126 |
|
127 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
128 |
|
129 |
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
130 |
$region = $params[ 'search_region' ];
|
146 |
}
|
147 |
|
148 |
} elseif ( isset( $_GET[ 'selected_region' ] ) ) {
|
149 |
+
|
150 |
$region = $_GET[ 'selected_region' ];
|
151 |
|
152 |
if ( is_int( $region ) ) {
|
159 |
'terms' => $region,
|
160 |
'operator' => 'IN'
|
161 |
);
|
162 |
+
|
163 |
+
} elseif( isset( $_GET['alert_id'] ) ) { // WPJM Alerts support
|
164 |
+
|
165 |
+
$regions = wp_get_post_terms( $_GET['alert_id'], 'job_listing_region', array( 'fields' => 'ids' ) );
|
166 |
+
if ( ! empty( $regions ) ) {
|
167 |
+
$args[ 'tax_query' ][] = array(
|
168 |
+
'taxonomy' => 'job_listing_region',
|
169 |
+
'field' => 'id',
|
170 |
+
'terms' => $regions,
|
171 |
+
'operator' => 'IN'
|
172 |
+
);
|
173 |
+
}
|
174 |
+
|
175 |
}
|
|
|
176 |
|
177 |
return $args;
|
178 |
}
|
184 |
public function job_manager_get_listings_args( $args ) {
|
185 |
$params = array();
|
186 |
|
187 |
+
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
188 |
|
189 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
190 |
|
191 |
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
192 |
$args[ 'search_location' ] = null;
|
198 |
}
|
199 |
|
200 |
/**
|
201 |
+
* Filter the AJAX to update the "showing" text.
|
202 |
*/
|
203 |
public function custom_filter_text( $text ) {
|
204 |
$params = array();
|
205 |
|
206 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
207 |
|
208 |
$term = get_term( $params[ 'search_region' ], 'job_listing_region' );
|
209 |
|
218 |
public function custom_filter_rss( $args ) {
|
219 |
$params = array();
|
220 |
|
221 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
222 |
|
223 |
$args[ 'job_region' ] = $params[ 'search_region' ];
|
224 |
|