Version Description
Download this release
Release Info
Developer | erdanish4 |
Plugin | Regions for WP Job Manager |
Version | 1.17.5 |
Comparing to | |
See all releases |
Code changes from version 1.17.4 to 1.17.5
- assets/js/main.js +201 -113
- assets/js/main.min.js +1 -0
- includes/class-taxonomy.php +104 -104
- includes/class-template.php +270 -199
- includes/class-widgets.php +30 -30
- includes/widgets/class-widget-region-list.php +59 -59
- languages/wp-job-manager-locations-da_DK.po +88 -88
- languages/wp-job-manager-locations-es_ES.po +88 -88
- languages/wp-job-manager-locations-ru_RU.mo +0 -0
- languages/wp-job-manager-locations-ru_RU.po +87 -87
- languages/wp-job-manager-locations.pot +141 -141
- readme.txt +192 -184
- uninstall.php +12 -12
- wp-job-manager-locations.php +404 -404
assets/js/main.js
CHANGED
@@ -1,113 +1,201 @@
|
|
1 |
-
(function($) {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
var jobRegions = {
|
5 |
-
cache: {
|
6 |
-
$document: $(document),
|
7 |
-
$window: $(window),
|
8 |
-
},
|
9 |
-
|
10 |
-
init: function() {
|
11 |
-
this.bindEvents();
|
12 |
-
},
|
13 |
-
|
14 |
-
bindEvents: function() {
|
15 |
-
var self = this;
|
16 |
-
|
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();
|
32 |
-
self.resetResults();
|
33 |
-
});
|
34 |
-
},
|
35 |
-
|
36 |
-
addSubmission: function() {
|
37 |
-
if ( $.isFunction($.fn.chosen) ) {
|
38 |
-
$( '#job_region, #resume_region' ).chosen( {
|
39 |
-
search_contains: true,
|
40 |
-
} );
|
41 |
-
} else if( $.isFunction($.fn.select2) ) {
|
42 |
-
$( '#job_region, #resume_region' ).select2( this.select2_args );
|
43 |
-
}
|
44 |
-
},
|
45 |
-
|
46 |
-
addRegions: function() {
|
47 |
-
this.$forms.each(function(i, el) {
|
48 |
-
var wrapper = false;
|
49 |
-
var $regions = $(el).find( 'select.search_region' );
|
50 |
-
|
51 |
-
// Grab Listify's wrapper element.
|
52 |
-
if ( $regions.parent().hasClass( 'select' ) ) {
|
53 |
-
wrapper = true;
|
54 |
-
$regions = $regions.parent();
|
55 |
-
}
|
56 |
-
|
57 |
-
if ( ! $regions.length ) {
|
58 |
-
return;
|
59 |
-
}
|
60 |
-
|
61 |
-
var location = $(el).find( '.search_location' );
|
62 |
-
location.html( '' );
|
63 |
-
location.removeClass( 'search_location' ).addClass( 'search_region' );
|
64 |
-
|
65 |
-
$regions.detach().appendTo(location);
|
66 |
-
|
67 |
-
var args = {
|
68 |
-
search_contains: true
|
69 |
-
};
|
70 |
-
|
71 |
-
if ( $.isFunction($.fn.chosen) ) {
|
72 |
-
if ( ! wrapper ) {
|
73 |
-
$regions.chosen( args );
|
74 |
-
} else {
|
75 |
-
$regions.children( 'select' ).chosen( args );
|
76 |
-
}
|
77 |
-
} else {
|
78 |
-
if ( ! wrapper ) {
|
79 |
-
$regions.select2( this.select2_args );
|
80 |
-
} else {
|
81 |
-
$regions.children( 'select' ).select2( this.select2_args );
|
82 |
-
}
|
83 |
-
}
|
84 |
-
});
|
85 |
-
},
|
86 |
-
|
87 |
-
updateResults: function() {
|
88 |
-
this.$forms.each(function(i, el) {
|
89 |
-
var region = $(this).find( '.search_region' );
|
90 |
-
|
91 |
-
region.on( 'change', function() {
|
92 |
-
var target = $(this).closest( 'div.job_listings' );
|
93 |
-
|
94 |
-
target.trigger( 'update_results', [ 1, false ] );
|
95 |
-
});
|
96 |
-
});
|
97 |
-
},
|
98 |
-
|
99 |
-
resetResults: function() {
|
100 |
-
var self = this;
|
101 |
-
|
102 |
-
$( '.job_listings' ).on( 'reset', function() {
|
103 |
-
self.$forms.each(function(i, el) {
|
104 |
-
var $regions = $(el).find( 'select.search_region' );
|
105 |
-
$regions.val(0).trigger( 'change' ).trigger( 'chosen:updated' );
|
106 |
-
});
|
107 |
-
});
|
108 |
-
}
|
109 |
-
};
|
110 |
-
|
111 |
-
jobRegions.init();
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
var jobRegions = {
|
5 |
+
cache: {
|
6 |
+
$document: $(document),
|
7 |
+
$window: $(window),
|
8 |
+
},
|
9 |
+
|
10 |
+
init: function() {
|
11 |
+
this.bindEvents();
|
12 |
+
},
|
13 |
+
|
14 |
+
bindEvents: function() {
|
15 |
+
var self = this;
|
16 |
+
|
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();
|
32 |
+
self.resetResults();
|
33 |
+
});
|
34 |
+
},
|
35 |
+
|
36 |
+
addSubmission: function() {
|
37 |
+
if ( $.isFunction($.fn.chosen) ) {
|
38 |
+
$( '#job_region, #resume_region' ).chosen( {
|
39 |
+
search_contains: true,
|
40 |
+
} );
|
41 |
+
} else if( $.isFunction($.fn.select2) ) {
|
42 |
+
$( '#job_region, #resume_region' ).select2( this.select2_args );
|
43 |
+
}
|
44 |
+
},
|
45 |
+
|
46 |
+
addRegions: function() {
|
47 |
+
this.$forms.each(function(i, el) {
|
48 |
+
var wrapper = false;
|
49 |
+
var $regions = $(el).find( 'select.search_region' );
|
50 |
+
|
51 |
+
// Grab Listify's wrapper element.
|
52 |
+
if ( $regions.parent().hasClass( 'select' ) ) {
|
53 |
+
wrapper = true;
|
54 |
+
$regions = $regions.parent();
|
55 |
+
}
|
56 |
+
|
57 |
+
if ( ! $regions.length ) {
|
58 |
+
return;
|
59 |
+
}
|
60 |
+
|
61 |
+
var location = $(el).find( '.search_location' );
|
62 |
+
location.html( '' );
|
63 |
+
location.removeClass( 'search_location' ).addClass( 'search_region' );
|
64 |
+
|
65 |
+
$regions.detach().appendTo(location);
|
66 |
+
|
67 |
+
var args = {
|
68 |
+
search_contains: true
|
69 |
+
};
|
70 |
+
|
71 |
+
if ( $.isFunction($.fn.chosen) ) {
|
72 |
+
if ( ! wrapper ) {
|
73 |
+
$regions.chosen( args );
|
74 |
+
} else {
|
75 |
+
$regions.children( 'select' ).chosen( args );
|
76 |
+
}
|
77 |
+
} else {
|
78 |
+
if ( ! wrapper ) {
|
79 |
+
$regions.select2( this.select2_args );
|
80 |
+
} else {
|
81 |
+
$regions.children( 'select' ).select2( this.select2_args );
|
82 |
+
}
|
83 |
+
}
|
84 |
+
});
|
85 |
+
},
|
86 |
+
|
87 |
+
updateResults: function() {
|
88 |
+
this.$forms.each(function(i, el) {
|
89 |
+
var region = $(this).find( '.search_region' );
|
90 |
+
|
91 |
+
region.on( 'change', function() {
|
92 |
+
var target = $(this).closest( 'div.job_listings' );
|
93 |
+
|
94 |
+
target.trigger( 'update_results', [ 1, false ] );
|
95 |
+
});
|
96 |
+
});
|
97 |
+
},
|
98 |
+
|
99 |
+
resetResults: function() {
|
100 |
+
var self = this;
|
101 |
+
|
102 |
+
$( '.job_listings' ).on( 'reset', function() {
|
103 |
+
self.$forms.each(function(i, el) {
|
104 |
+
var $regions = $(el).find( 'select.search_region' );
|
105 |
+
$regions.val(0).trigger( 'change' ).trigger( 'chosen:updated' );
|
106 |
+
});
|
107 |
+
});
|
108 |
+
}
|
109 |
+
};
|
110 |
+
|
111 |
+
jobRegions.init();
|
112 |
+
|
113 |
+
var resumeRegions = {
|
114 |
+
cache: {
|
115 |
+
$document: $(document),
|
116 |
+
$window: $(window),
|
117 |
+
},
|
118 |
+
|
119 |
+
init: function() {
|
120 |
+
this.bindEvents();
|
121 |
+
},
|
122 |
+
|
123 |
+
bindEvents: function() {
|
124 |
+
var self = this;
|
125 |
+
|
126 |
+
this.cache.$document.on( 'ready', function() {
|
127 |
+
self.$forms = $( '.search_resumes' );
|
128 |
+
|
129 |
+
self.addSubmission();
|
130 |
+
self.addRegions();
|
131 |
+
self.updateResults();
|
132 |
+
self.resetResults();
|
133 |
+
});
|
134 |
+
},
|
135 |
+
|
136 |
+
addSubmission: function() {
|
137 |
+
$( '#job_region, #resume_region' ).chosen({
|
138 |
+
search_contains: true
|
139 |
+
});
|
140 |
+
},
|
141 |
+
|
142 |
+
addRegions: function() {
|
143 |
+
this.$forms.each(function(i, el) {
|
144 |
+
var wrapper = false;
|
145 |
+
var $regions = $(el).find( 'select.search_region' );
|
146 |
+
|
147 |
+
// Grab Listify's wrapper element.
|
148 |
+
if ( $regions.parent().hasClass( 'select' ) ) {
|
149 |
+
wrapper = true;
|
150 |
+
$regions = $regions.parent();
|
151 |
+
}
|
152 |
+
|
153 |
+
if ( ! $regions.length ) {
|
154 |
+
return;
|
155 |
+
}
|
156 |
+
|
157 |
+
var location = $(el).find( '.search_location' );
|
158 |
+
location.html( '' );
|
159 |
+
location.removeClass( 'search_location' ).addClass( 'search_region' );
|
160 |
+
|
161 |
+
$regions.detach().appendTo(location);
|
162 |
+
|
163 |
+
var args = {
|
164 |
+
search_contains: true
|
165 |
+
};
|
166 |
+
|
167 |
+
if ( ! wrapper ) {
|
168 |
+
$regions.chosen( args );
|
169 |
+
} else {
|
170 |
+
$regions.children( 'select' ).chosen( args );
|
171 |
+
}
|
172 |
+
});
|
173 |
+
},
|
174 |
+
|
175 |
+
updateResults: function() {
|
176 |
+
this.$forms.each(function(i, el) {
|
177 |
+
var region = $(this).find( '.search_region' );
|
178 |
+
|
179 |
+
region.on( 'change', function() {
|
180 |
+
var target = $(this).closest( 'div.resumes' );
|
181 |
+
|
182 |
+
target.trigger( 'update_results', [ 1, false ] );
|
183 |
+
});
|
184 |
+
});
|
185 |
+
},
|
186 |
+
|
187 |
+
resetResults: function() {
|
188 |
+
var self = this;
|
189 |
+
|
190 |
+
$( '.resumes' ).on( 'reset', function() {
|
191 |
+
self.$forms.each(function(i, el) {
|
192 |
+
var $regions = $(el).find( 'select.search_region' );
|
193 |
+
$regions.val(0).trigger( 'change' ).trigger( 'chosen:updated' );
|
194 |
+
});
|
195 |
+
});
|
196 |
+
}
|
197 |
+
};
|
198 |
+
|
199 |
+
resumeRegions.init();
|
200 |
+
|
201 |
+
})(jQuery);
|
assets/js/main.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(i){"use strict";({cache:{$document:i(document),$window:i(window)},init:function(){this.bindEvents()},bindEvents:function(){var e=this;this.cache.$document.on("ready",function(){e.$forms=i(".search_jobs"),"undefined"==typeof job_manager_select2_args?this.select2_args={}:this.select2_args=job_manager_select2_args,this.select2_args.allowClear=!0,this.select2_args.minimumResultsForSearch=10,e.addSubmission(),e.addRegions(),e.updateResults(),e.resetResults()})},addSubmission:function(){i.isFunction(i.fn.chosen)?i("#job_region, #resume_region").chosen({search_contains:!0}):i.isFunction(i.fn.select2)&&i("#job_region, #resume_region").select2(this.select2_args)},addRegions:function(){this.$forms.each(function(e,s){var n=!1,t=i(s).find("select.search_region");t.parent().hasClass("select")&&(n=!0,t=t.parent()),t.length&&((s=i(s).find(".search_location")).html(""),s.removeClass("search_location").addClass("search_region"),t.detach().appendTo(s),s={search_contains:!0},i.isFunction(i.fn.chosen)?(n?t.children("select"):t).chosen(s):(n?t.children("select"):t).select2(this.select2_args))})},updateResults:function(){this.$forms.each(function(e,s){i(this).find(".search_region").on("change",function(){i(this).closest("div.job_listings").trigger("update_results",[1,!1])})})},resetResults:function(){var e=this;i(".job_listings").on("reset",function(){e.$forms.each(function(e,s){i(s).find("select.search_region").val(0).trigger("change").trigger("chosen:updated")})})}}).init(),{cache:{$document:i(document),$window:i(window)},init:function(){this.bindEvents()},bindEvents:function(){var e=this;this.cache.$document.on("ready",function(){e.$forms=i(".search_resumes"),e.addSubmission(),e.addRegions(),e.updateResults(),e.resetResults()})},addSubmission:function(){i("#job_region, #resume_region").chosen({search_contains:!0})},addRegions:function(){this.$forms.each(function(e,s){var n=!1,t=i(s).find("select.search_region");t.parent().hasClass("select")&&(n=!0,t=t.parent()),t.length&&((s=i(s).find(".search_location")).html(""),s.removeClass("search_location").addClass("search_region"),t.detach().appendTo(s),s={search_contains:!0},(n?t.children("select"):t).chosen(s))})},updateResults:function(){this.$forms.each(function(e,s){i(this).find(".search_region").on("change",function(){i(this).closest("div.resumes").trigger("update_results",[1,!1])})})},resetResults:function(){var e=this;i(".resumes").on("reset",function(){e.$forms.each(function(e,s){i(s).find("select.search_region").val(0).trigger("change").trigger("chosen:updated")})})}}.init()}(jQuery);
|
includes/class-taxonomy.php
CHANGED
@@ -1,104 +1,104 @@
|
|
1 |
-
<?php
|
2 |
-
|
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 |
-
/**
|
10 |
-
* Create the `job_listing_region` taxonomy.
|
11 |
-
*
|
12 |
-
* @since 1.0.0
|
13 |
-
*/
|
14 |
-
public function register_taxonomy() {
|
15 |
-
$admin_capability = 'manage_job_listings';
|
16 |
-
|
17 |
-
$job_singular = __( 'Job Region', 'wp-job-manager-locations' );
|
18 |
-
$job_plural = __( 'Job Regions', 'wp-job-manager-locations' );
|
19 |
-
|
20 |
-
if ( current_theme_supports( 'job-manager-templates' ) ) {
|
21 |
-
$job_rewrite = array(
|
22 |
-
'slug' => _x( 'job-region', 'Job region slug - resave permalinks after changing this', 'wp-job-manager-locations' ),
|
23 |
-
'with_front' => false,
|
24 |
-
'hierarchical' => false
|
25 |
-
);
|
26 |
-
$resume_rewrite = array(
|
27 |
-
'slug' => _x( 'resume-region', 'Resume region slug - resave permalinks after changing this', 'wp-job-manager-locations' ),
|
28 |
-
'with_front' => false,
|
29 |
-
'hierarchical' => false
|
30 |
-
);
|
31 |
-
} else {
|
32 |
-
$job_rewrite = false;
|
33 |
-
$resume_rewrite = false;
|
34 |
-
}
|
35 |
-
|
36 |
-
register_taxonomy( 'job_listing_region',
|
37 |
-
array( 'job_listing' ),
|
38 |
-
array(
|
39 |
-
'hierarchical' => true,
|
40 |
-
'update_count_callback' => '_update_post_term_count',
|
41 |
-
'label' => $job_plural,
|
42 |
-
'labels' => array(
|
43 |
-
'name' => $job_plural,
|
44 |
-
'singular_name' => $job_singular,
|
45 |
-
'search_items' => sprintf( __( 'Search %s', 'wp-job-manager-locations' ), $job_plural ),
|
46 |
-
'all_items' => sprintf( __( 'All %s', 'wp-job-manager-locations' ), $job_plural ),
|
47 |
-
'parent_item' => sprintf( __( 'Parent %s', 'wp-job-manager-locations' ), $job_singular ),
|
48 |
-
'parent_item_colon' => sprintf( __( 'Parent %s:', 'wp-job-manager-locations' ), $job_singular ),
|
49 |
-
'edit_item' => sprintf( __( 'Edit %s', 'wp-job-manager-locations' ), $job_singular ),
|
50 |
-
'update_item' => sprintf( __( 'Update %s', 'wp-job-manager-locations' ), $job_singular ),
|
51 |
-
'add_new_item' => sprintf( __( 'Add New %s', 'wp-job-manager-locations' ), $job_singular ),
|
52 |
-
'new_item_name' => sprintf( __( 'New %s Name', 'wp-job-manager-locations' ), $job_singular )
|
53 |
-
),
|
54 |
-
'show_ui' => true,
|
55 |
-
'query_var' => true,
|
56 |
-
'has_archive' => true,
|
57 |
-
'capabilities' => array(
|
58 |
-
'manage_terms' => $admin_capability,
|
59 |
-
'edit_terms' => $admin_capability,
|
60 |
-
'delete_terms' => $admin_capability,
|
61 |
-
'assign_terms' => $admin_capability,
|
62 |
-
),
|
63 |
-
'show_in_rest' => true,
|
64 |
-
'rewrite' => $job_rewrite,
|
65 |
-
)
|
66 |
-
);
|
67 |
-
|
68 |
-
$resume_singular = __( 'Resume Region', 'wp-job-manager-locations' );
|
69 |
-
$resume_plural = __( 'Resume Regions', 'wp-job-manager-locations' );
|
70 |
-
|
71 |
-
register_taxonomy( 'resume_region',
|
72 |
-
array( 'resume' ),
|
73 |
-
array(
|
74 |
-
'hierarchical' => true,
|
75 |
-
'update_count_callback' => '_update_post_term_count',
|
76 |
-
'label' => $resume_plural,
|
77 |
-
'labels' => array(
|
78 |
-
'name' => $resume_plural,
|
79 |
-
'singular_name' => $resume_singular,
|
80 |
-
'search_items' => sprintf( __( 'Search %s', 'wp-job-manager-locations' ), $resume_plural ),
|
81 |
-
'all_items' => sprintf( __( 'All %s', 'wp-job-manager-locations' ), $resume_plural ),
|
82 |
-
'parent_item' => sprintf( __( 'Parent %s', 'wp-job-manager-locations' ), $resume_singular ),
|
83 |
-
'parent_item_colon' => sprintf( __( 'Parent %s:', 'wp-job-manager-locations' ), $resume_singular ),
|
84 |
-
'edit_item' => sprintf( __( 'Edit %s', 'wp-job-manager-locations' ), $resume_singular ),
|
85 |
-
'update_item' => sprintf( __( 'Update %s', 'wp-job-manager-locations' ), $resume_singular ),
|
86 |
-
'add_new_item' => sprintf( __( 'Add New %s', 'wp-job-manager-locations' ), $resume_singular ),
|
87 |
-
'new_item_name' => sprintf( __( 'New %s Name', 'wp-job-manager-locations' ), $resume_singular )
|
88 |
-
),
|
89 |
-
'show_ui' => true,
|
90 |
-
'query_var' => true,
|
91 |
-
'has_archive' => true,
|
92 |
-
'capabilities' => array(
|
93 |
-
'manage_terms' => $admin_capability,
|
94 |
-
'edit_terms' => $admin_capability,
|
95 |
-
'delete_terms' => $admin_capability,
|
96 |
-
'assign_terms' => $admin_capability,
|
97 |
-
),
|
98 |
-
'show_in_rest' => true,
|
99 |
-
'rewrite' => $resume_rewrite,
|
100 |
-
)
|
101 |
-
);
|
102 |
-
}
|
103 |
-
|
104 |
-
}
|
1 |
+
<?php
|
2 |
+
|
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 |
+
/**
|
10 |
+
* Create the `job_listing_region` taxonomy.
|
11 |
+
*
|
12 |
+
* @since 1.0.0
|
13 |
+
*/
|
14 |
+
public function register_taxonomy() {
|
15 |
+
$admin_capability = 'manage_job_listings';
|
16 |
+
|
17 |
+
$job_singular = __( 'Job Region', 'wp-job-manager-locations' );
|
18 |
+
$job_plural = __( 'Job Regions', 'wp-job-manager-locations' );
|
19 |
+
|
20 |
+
if ( current_theme_supports( 'job-manager-templates' ) ) {
|
21 |
+
$job_rewrite = array(
|
22 |
+
'slug' => _x( 'job-region', 'Job region slug - resave permalinks after changing this', 'wp-job-manager-locations' ),
|
23 |
+
'with_front' => false,
|
24 |
+
'hierarchical' => false
|
25 |
+
);
|
26 |
+
$resume_rewrite = array(
|
27 |
+
'slug' => _x( 'resume-region', 'Resume region slug - resave permalinks after changing this', 'wp-job-manager-locations' ),
|
28 |
+
'with_front' => false,
|
29 |
+
'hierarchical' => false
|
30 |
+
);
|
31 |
+
} else {
|
32 |
+
$job_rewrite = false;
|
33 |
+
$resume_rewrite = false;
|
34 |
+
}
|
35 |
+
|
36 |
+
register_taxonomy( 'job_listing_region',
|
37 |
+
array( 'job_listing' ),
|
38 |
+
array(
|
39 |
+
'hierarchical' => true,
|
40 |
+
'update_count_callback' => '_update_post_term_count',
|
41 |
+
'label' => $job_plural,
|
42 |
+
'labels' => array(
|
43 |
+
'name' => $job_plural,
|
44 |
+
'singular_name' => $job_singular,
|
45 |
+
'search_items' => sprintf( __( 'Search %s', 'wp-job-manager-locations' ), $job_plural ),
|
46 |
+
'all_items' => sprintf( __( 'All %s', 'wp-job-manager-locations' ), $job_plural ),
|
47 |
+
'parent_item' => sprintf( __( 'Parent %s', 'wp-job-manager-locations' ), $job_singular ),
|
48 |
+
'parent_item_colon' => sprintf( __( 'Parent %s:', 'wp-job-manager-locations' ), $job_singular ),
|
49 |
+
'edit_item' => sprintf( __( 'Edit %s', 'wp-job-manager-locations' ), $job_singular ),
|
50 |
+
'update_item' => sprintf( __( 'Update %s', 'wp-job-manager-locations' ), $job_singular ),
|
51 |
+
'add_new_item' => sprintf( __( 'Add New %s', 'wp-job-manager-locations' ), $job_singular ),
|
52 |
+
'new_item_name' => sprintf( __( 'New %s Name', 'wp-job-manager-locations' ), $job_singular )
|
53 |
+
),
|
54 |
+
'show_ui' => true,
|
55 |
+
'query_var' => true,
|
56 |
+
'has_archive' => true,
|
57 |
+
'capabilities' => array(
|
58 |
+
'manage_terms' => $admin_capability,
|
59 |
+
'edit_terms' => $admin_capability,
|
60 |
+
'delete_terms' => $admin_capability,
|
61 |
+
'assign_terms' => $admin_capability,
|
62 |
+
),
|
63 |
+
'show_in_rest' => true,
|
64 |
+
'rewrite' => $job_rewrite,
|
65 |
+
)
|
66 |
+
);
|
67 |
+
|
68 |
+
$resume_singular = __( 'Resume Region', 'wp-job-manager-locations' );
|
69 |
+
$resume_plural = __( 'Resume Regions', 'wp-job-manager-locations' );
|
70 |
+
|
71 |
+
register_taxonomy( 'resume_region',
|
72 |
+
array( 'resume' ),
|
73 |
+
array(
|
74 |
+
'hierarchical' => true,
|
75 |
+
'update_count_callback' => '_update_post_term_count',
|
76 |
+
'label' => $resume_plural,
|
77 |
+
'labels' => array(
|
78 |
+
'name' => $resume_plural,
|
79 |
+
'singular_name' => $resume_singular,
|
80 |
+
'search_items' => sprintf( __( 'Search %s', 'wp-job-manager-locations' ), $resume_plural ),
|
81 |
+
'all_items' => sprintf( __( 'All %s', 'wp-job-manager-locations' ), $resume_plural ),
|
82 |
+
'parent_item' => sprintf( __( 'Parent %s', 'wp-job-manager-locations' ), $resume_singular ),
|
83 |
+
'parent_item_colon' => sprintf( __( 'Parent %s:', 'wp-job-manager-locations' ), $resume_singular ),
|
84 |
+
'edit_item' => sprintf( __( 'Edit %s', 'wp-job-manager-locations' ), $resume_singular ),
|
85 |
+
'update_item' => sprintf( __( 'Update %s', 'wp-job-manager-locations' ), $resume_singular ),
|
86 |
+
'add_new_item' => sprintf( __( 'Add New %s', 'wp-job-manager-locations' ), $resume_singular ),
|
87 |
+
'new_item_name' => sprintf( __( 'New %s Name', 'wp-job-manager-locations' ), $resume_singular )
|
88 |
+
),
|
89 |
+
'show_ui' => true,
|
90 |
+
'query_var' => true,
|
91 |
+
'has_archive' => true,
|
92 |
+
'capabilities' => array(
|
93 |
+
'manage_terms' => $admin_capability,
|
94 |
+
'edit_terms' => $admin_capability,
|
95 |
+
'delete_terms' => $admin_capability,
|
96 |
+
'assign_terms' => $admin_capability,
|
97 |
+
),
|
98 |
+
'show_in_rest' => true,
|
99 |
+
'rewrite' => $resume_rewrite,
|
100 |
+
)
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
}
|
includes/class-template.php
CHANGED
@@ -1,199 +1,270 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Regions {
|
4 |
-
|
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, '
|
11 |
-
}
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
add_filter( '
|
18 |
-
|
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 );
|
20 |
-
|
21 |
-
add_action( 'wp', array( $this, 'sort' ) );
|
22 |
-
}
|
23 |
-
|
24 |
-
public function sort() {
|
25 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
|
26 |
-
|
27 |
-
if ( get_option( 'job_manager_regions_filter' ) || is_tax( 'job_listing_region' ) ) {
|
28 |
-
add_action( 'job_manager_job_filters_search_jobs_end', array( $this, 'job_manager_job_filters_search_jobs_end' ) );
|
29 |
-
} else {
|
30 |
-
add_action( 'job_manager_job_filters_search_jobs_end', array( $this, 'tax_archive_field' ) );
|
31 |
-
add_filter( 'body_class', array( $this, 'body_class' ) );
|
32 |
-
}
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
'
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
'
|
121 |
-
'
|
122 |
-
'
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Astoundify_Job_Manager_Regions_Template extends Astoundify_Job_Manager_Regions {
|
4 |
+
|
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_job_location' ), 10, 2 );
|
11 |
+
}
|
12 |
+
if ( get_option( 'resume_manager_enable_regions_filter' ) ) {
|
13 |
+
add_filter( 'the_candidate_location', array( $this, 'the_candidate_location' ), 10, 2 );
|
14 |
+
}
|
15 |
+
|
16 |
+
add_filter( 'submit_job_form_fields_get_job_data', array( $this, 'submit_job_form_fields_get_job_data' ), 10, 2 );
|
17 |
+
add_filter( 'submit_resume_form_fields_get_resume_data', array( $this, 'submit_resume_form_fields_get_resume_data' ), 10, 2 );
|
18 |
+
|
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 );
|
20 |
+
|
21 |
+
add_action( 'wp', array( $this, 'sort' ) );
|
22 |
+
}
|
23 |
+
|
24 |
+
public function sort() {
|
25 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
|
26 |
+
|
27 |
+
if ( get_option( 'job_manager_regions_filter' ) || is_tax( 'job_listing_region' ) ) {
|
28 |
+
add_action( 'job_manager_job_filters_search_jobs_end', array( $this, 'job_manager_job_filters_search_jobs_end' ) );
|
29 |
+
} else {
|
30 |
+
add_action( 'job_manager_job_filters_search_jobs_end', array( $this, 'tax_archive_field' ) );
|
31 |
+
add_filter( 'body_class', array( $this, 'body_class' ) );
|
32 |
+
}
|
33 |
+
if ( get_option( 'resume_manager_regions_filter' ) || is_tax( 'resume_region' ) ) {
|
34 |
+
add_action( 'resume_manager_resume_filters_search_resumes_end', array( $this, 'resume_manager_resume_filters_search_resumes_end' ) );
|
35 |
+
} else {
|
36 |
+
add_action( 'resume_manager_resume_filters_search_resumes_end', array( $this, 'tax_archive_field' ) );
|
37 |
+
add_filter( 'body_class', array( $this, 'body_class' ) );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Frontend scripts.
|
43 |
+
*/
|
44 |
+
public function wp_enqueue_scripts() {
|
45 |
+
$deps = array( 'jquery' );
|
46 |
+
|
47 |
+
$wpjm = WPJM();
|
48 |
+
|
49 |
+
if ( method_exists( $wpjm, 'register_select2_assets' ) ) {
|
50 |
+
$wpjm::register_select2_assets();
|
51 |
+
|
52 |
+
wp_enqueue_script( 'select2' );
|
53 |
+
wp_enqueue_style( 'select2' );
|
54 |
+
} else {
|
55 |
+
wp_enqueue_script( 'chosen' );
|
56 |
+
wp_enqueue_style( 'chosen' );
|
57 |
+
}
|
58 |
+
|
59 |
+
wp_enqueue_script( 'job-regions', wp_job_manager_regions()->plugin_url . 'assets/js/main.min.js', array( 'jquery' ), 20190128, true );
|
60 |
+
}
|
61 |
+
|
62 |
+
public function submit_resume_form_fields_get_resume_data( $fields, $job ) {
|
63 |
+
$field = isset( $fields[ 'resume_fields' ][ 'resume_region' ] ) ? $fields[ 'resume_fields' ][ 'resume_region' ] : false;
|
64 |
+
|
65 |
+
if ( $field ) {
|
66 |
+
$fields[ 'resume_fields' ][ 'resume_region' ][ 'value' ] = wp_get_object_terms( $job->ID, $field['taxonomy'], array( 'fields' => 'ids' ) );
|
67 |
+
}
|
68 |
+
|
69 |
+
return $fields;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function submit_job_form_fields_get_job_data( $fields, $job ) {
|
73 |
+
$field = isset( $fields[ 'job' ][ 'job_region' ] ) ? $fields[ 'job' ][ 'job_region' ] : false;
|
74 |
+
|
75 |
+
if ( $field ) {
|
76 |
+
$fields[ 'job' ][ 'job_region' ][ 'value' ] = wp_get_object_terms( $job->ID, $field['taxonomy'], array( 'fields' => 'ids' ) );
|
77 |
+
}
|
78 |
+
|
79 |
+
return $fields;
|
80 |
+
}
|
81 |
+
|
82 |
+
public function submit_resume_form_fields( $fields ) {
|
83 |
+
$fields[ 'resume_fields' ][ 'resume_region' ] = array(
|
84 |
+
'label' => __( 'Region', 'wp-job-manager-locations' ),
|
85 |
+
'type' => 'term-select',
|
86 |
+
'taxonomy' => 'resume_region',
|
87 |
+
'required' => true,
|
88 |
+
'priority' => '2.5',
|
89 |
+
'default' => -1
|
90 |
+
);
|
91 |
+
|
92 |
+
return $fields;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Add the field to the submission form.
|
97 |
+
*/
|
98 |
+
public function submit_job_form_fields( $fields ) {
|
99 |
+
$fields[ 'job' ][ 'job_region' ] = array(
|
100 |
+
'label' => __( 'Job Region', 'wp-job-manager-locations' ),
|
101 |
+
'type' => 'term-select',
|
102 |
+
'taxonomy' => 'job_listing_region',
|
103 |
+
'required' => true,
|
104 |
+
'priority' => '2.5',
|
105 |
+
'default' => -1
|
106 |
+
);
|
107 |
+
|
108 |
+
return $fields;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Add the field to the filters
|
113 |
+
*/
|
114 |
+
public function job_manager_job_filters_search_jobs_end( $atts ) {
|
115 |
+
if ( ( ! isset( $atts[ 'selected_region' ] ) || '' == $atts[ 'selected_region' ] ) && isset( $_GET[ 'search_region' ] ) ) {
|
116 |
+
$atts[ 'selected_region' ] = absint( $_GET[ 'search_region' ] );
|
117 |
+
}
|
118 |
+
|
119 |
+
wp_dropdown_categories( apply_filters( 'job_manager_regions_dropdown_args', array(
|
120 |
+
'show_option_all' => __( 'All Regions', 'wp-job-manager-locations' ),
|
121 |
+
'multiple' => false,
|
122 |
+
'hierarchical' => true,
|
123 |
+
'orderby' => 'name',
|
124 |
+
'taxonomy' => 'job_listing_region',
|
125 |
+
'name' => 'search_region',
|
126 |
+
'class' => 'search_region',
|
127 |
+
'hide_empty' => 0,
|
128 |
+
'selected' => isset( $atts[ 'selected_region' ] ) ? $atts[ 'selected_region' ] : ''
|
129 |
+
) ) );
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Add the field to the filters
|
134 |
+
*/
|
135 |
+
public function resume_manager_resume_filters_search_resumes_end( $atts ) {
|
136 |
+
if ( ( ! isset( $atts[ 'selected_region' ] ) || '' == $atts[ 'selected_region' ] ) && isset( $_GET[ 'search_region' ] ) ) {
|
137 |
+
$atts[ 'selected_region' ] = absint( $_GET[ 'search_region' ] );
|
138 |
+
}
|
139 |
+
|
140 |
+
wp_dropdown_categories( apply_filters( 'resume_manager_regions_dropdown_args', array(
|
141 |
+
'show_option_all' => __( 'All Regions', 'wp-job-manager-locations' ),
|
142 |
+
'hierarchical' => true,
|
143 |
+
'orderby' => 'name',
|
144 |
+
'taxonomy' => 'resume_region',
|
145 |
+
'name' => 'search_region',
|
146 |
+
'class' => 'search_region',
|
147 |
+
'hide_empty' => 0,
|
148 |
+
'selected' => isset( $atts[ 'selected_region' ] ) ? $atts[ 'selected_region' ] : ''
|
149 |
+
) ) );
|
150 |
+
}
|
151 |
+
|
152 |
+
public function job_manager_term_select_field_wp_dropdown_categories_args( $args, $key, $field ) {
|
153 |
+
if ( 'job_region' !== $key ) {
|
154 |
+
return $args;
|
155 |
+
}
|
156 |
+
|
157 |
+
$args['show_option_none'] = __( 'Select Region', 'wp-job-manager-locations' );
|
158 |
+
$args['option_none_value'] = '';
|
159 |
+
|
160 |
+
return $args;
|
161 |
+
}
|
162 |
+
public function the_job_location( $job_location, $post ) {
|
163 |
+
if ( is_singular( 'job_listing' ) ) {
|
164 |
+
return strip_tags( get_the_term_list( $post->ID, 'job_listing_region', '', ', ', '' ) );
|
165 |
+
} else {
|
166 |
+
$terms = wp_get_object_terms( $post->ID, 'job_listing_region', array( 'orderby' => 'term_order', 'order' => 'desc') );
|
167 |
+
|
168 |
+
if ( empty( $terms ) ) {
|
169 |
+
return;
|
170 |
+
}
|
171 |
+
|
172 |
+
$names = array();
|
173 |
+
|
174 |
+
foreach ( $terms as $term ) {
|
175 |
+
$names[] = $term->name;
|
176 |
+
}
|
177 |
+
|
178 |
+
return implode( ', ', $names );
|
179 |
+
}
|
180 |
+
return implode( ', ', $names );
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Replace location output with the region.
|
185 |
+
*
|
186 |
+
* @since 1.15.0
|
187 |
+
*/
|
188 |
+
public function the_candidate_location( $job_location, $post ) {
|
189 |
+
if ( is_singular( 'resume' ) ) {
|
190 |
+
return strip_tags( get_the_term_list( $post->ID, 'resume_region', '', ', ', '' ) );
|
191 |
+
} else {
|
192 |
+
$terms = wp_get_object_terms( $post->ID, 'resume_region', array( 'orderby' => 'term_order', 'order' => 'desc') );
|
193 |
+
|
194 |
+
if ( empty( $terms ) ) {
|
195 |
+
return;
|
196 |
+
}
|
197 |
+
|
198 |
+
$names = array();
|
199 |
+
|
200 |
+
foreach ( $terms as $term ) {
|
201 |
+
$names[] = $term->name;
|
202 |
+
}
|
203 |
+
|
204 |
+
return implode( ', ', $names );
|
205 |
+
}
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* If we are not using regions on the filter set a hidden field so the AJAX
|
210 |
+
* call still only looks in that area.
|
211 |
+
*/
|
212 |
+
public function tax_archive_field( $atts ) {
|
213 |
+
if ( ( ! isset( $atts[ 'selected_region' ] ) || '' == $atts[ 'selected_region' ] ) && isset( $_GET[ 'search_region' ] ) ) {
|
214 |
+
$atts[ 'selected_region' ] = absint( $_GET[ 'search_region' ] );
|
215 |
+
}
|
216 |
+
|
217 |
+
echo '<input type="hidden" name="search_region" class="search_region" value="' . $atts[
|
218 |
+
'selected_region' ]. '" />';
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* If we are not using regions on the filter set a body class so themes can hide the text
|
223 |
+
* input field so they don't have false thoughts about searching.
|
224 |
+
*/
|
225 |
+
public function body_class( $classes ) {
|
226 |
+
if ( is_tax( 'job_listing_region' ) ) {
|
227 |
+
$classes[] = 'wp-job-manager-regions-no-filter';
|
228 |
+
}
|
229 |
+
|
230 |
+
return $classes;
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Replace location output with the region.
|
235 |
+
*
|
236 |
+
* @since 1.0.0
|
237 |
+
*/
|
238 |
+
public function the_listing_location( $job_location, $post ) {
|
239 |
+
|
240 |
+
$terms = wp_get_object_terms(
|
241 |
+
$post->ID,
|
242 |
+
'job_listing' === $post->post_type ? 'job_listing_region' : 'resume_region',
|
243 |
+
apply_filters( 'job_manager_locations_get_terms', array(
|
244 |
+
'orderby' => 'term_order',
|
245 |
+
'order' => 'desc'
|
246 |
+
) )
|
247 |
+
);
|
248 |
+
|
249 |
+
$_terms = array();
|
250 |
+
|
251 |
+
if ( empty( $terms ) ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
+
|
255 |
+
if ( is_singular( array( 'job_listing', 'resume' ) ) ) {
|
256 |
+
foreach ( $terms as $term ) {
|
257 |
+
$_terms[] = '<a href=" ' . esc_url( get_term_link( $term ) ) . '">' . $term->name . '</a>';
|
258 |
+
}
|
259 |
+
|
260 |
+
} else {
|
261 |
+
foreach ( $terms as $term ) {
|
262 |
+
$_terms[] = $term->name;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
$separator = apply_filters( 'job_manager_locations_get_term_list_separator', ', ' );
|
267 |
+
|
268 |
+
return implode( $separator, $_terms );
|
269 |
+
}
|
270 |
+
}
|
includes/class-widgets.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Widgets
|
4 |
-
*/
|
5 |
-
|
6 |
-
// Exit if accessed directly
|
7 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
8 |
-
|
9 |
-
class Astoundify_Job_Manager_Regions_Widgets extends Astoundify_Job_Manager_Regions {
|
10 |
-
|
11 |
-
public function __construct() {
|
12 |
-
if ( ! class_exists( 'Jobify_Widget' ) ) {
|
13 |
-
return;
|
14 |
-
}
|
15 |
-
|
16 |
-
$widgets = array(
|
17 |
-
'class-widget-region-list.php'
|
18 |
-
);
|
19 |
-
|
20 |
-
foreach ( $widgets as $widget ) {
|
21 |
-
include_once( $this->plugin_dir . '/' . $widget );
|
22 |
-
}
|
23 |
-
|
24 |
-
add_action( 'widgets_init', array( $this, 'widgets_init' ) );
|
25 |
-
}
|
26 |
-
|
27 |
-
public function widgets_init() {
|
28 |
-
register_widget( 'Astoundify_Job_Manager_Regions_Widget' );
|
29 |
-
}
|
30 |
-
|
31 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Widgets
|
4 |
+
*/
|
5 |
+
|
6 |
+
// Exit if accessed directly
|
7 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
8 |
+
|
9 |
+
class Astoundify_Job_Manager_Regions_Widgets extends Astoundify_Job_Manager_Regions {
|
10 |
+
|
11 |
+
public function __construct() {
|
12 |
+
if ( ! class_exists( 'Jobify_Widget' ) ) {
|
13 |
+
return;
|
14 |
+
}
|
15 |
+
|
16 |
+
$widgets = array(
|
17 |
+
'class-widget-region-list.php'
|
18 |
+
);
|
19 |
+
|
20 |
+
foreach ( $widgets as $widget ) {
|
21 |
+
include_once( $this->plugin_dir . '/' . $widget );
|
22 |
+
}
|
23 |
+
|
24 |
+
add_action( 'widgets_init', array( $this, 'widgets_init' ) );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function widgets_init() {
|
28 |
+
register_widget( 'Astoundify_Job_Manager_Regions_Widget' );
|
29 |
+
}
|
30 |
+
|
31 |
}
|
includes/widgets/class-widget-region-list.php
CHANGED
@@ -1,60 +1,60 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Simple list
|
5 |
-
*/
|
6 |
-
class Astoundify_Job_Manager_Regions_Widget_List extends Jobify_Widget {
|
7 |
-
/**
|
8 |
-
* Constructor
|
9 |
-
*/
|
10 |
-
public function __construct() {
|
11 |
-
$this->widget_cssclass = 'ajmr_widget_regions';
|
12 |
-
$this->widget_description = __( 'Display a list of job regions.', 'wp-job-manager-locations' );
|
13 |
-
$this->widget_id = 'ajmr_widget_regions';
|
14 |
-
$this->widget_name = __( 'Job Regions', 'wp-job-manager-locations' );
|
15 |
-
$this->settings = array(
|
16 |
-
'title' => array(
|
17 |
-
'type' => 'text',
|
18 |
-
'std' => 'Job Regions',
|
19 |
-
'label' => __( 'Title:', 'wp-job-manager-locations' )
|
20 |
-
)
|
21 |
-
);
|
22 |
-
parent::__construct();
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* widget function.
|
27 |
-
*
|
28 |
-
* @see WP_Widget
|
29 |
-
* @access public
|
30 |
-
* @param array $args
|
31 |
-
* @param array $instance
|
32 |
-
* @return void
|
33 |
-
*/
|
34 |
-
function widget( $args, $instance ) {
|
35 |
-
if ( $this->get_cached_widget( $args ) )
|
36 |
-
return;
|
37 |
-
|
38 |
-
ob_start();
|
39 |
-
|
40 |
-
extract( $args );
|
41 |
-
|
42 |
-
echo $before_widget;
|
43 |
-
|
44 |
-
if ( $instance[ 'title' ] ) echo $before_title . $instance[ 'title' ] . $after_title;
|
45 |
-
|
46 |
-
wp_list_categories( array(
|
47 |
-
'title_li' => '',
|
48 |
-
'taxonomy' => 'job_listing_region',
|
49 |
-
'hide_empty' => 0
|
50 |
-
) );
|
51 |
-
|
52 |
-
echo $after_widget;
|
53 |
-
|
54 |
-
$content = ob_get_clean();
|
55 |
-
|
56 |
-
echo $content;
|
57 |
-
|
58 |
-
$this->cache_widget( $args, $content );
|
59 |
-
}
|
60 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Simple list
|
5 |
+
*/
|
6 |
+
class Astoundify_Job_Manager_Regions_Widget_List extends Jobify_Widget {
|
7 |
+
/**
|
8 |
+
* Constructor
|
9 |
+
*/
|
10 |
+
public function __construct() {
|
11 |
+
$this->widget_cssclass = 'ajmr_widget_regions';
|
12 |
+
$this->widget_description = __( 'Display a list of job regions.', 'wp-job-manager-locations' );
|
13 |
+
$this->widget_id = 'ajmr_widget_regions';
|
14 |
+
$this->widget_name = __( 'Job Regions', 'wp-job-manager-locations' );
|
15 |
+
$this->settings = array(
|
16 |
+
'title' => array(
|
17 |
+
'type' => 'text',
|
18 |
+
'std' => 'Job Regions',
|
19 |
+
'label' => __( 'Title:', 'wp-job-manager-locations' )
|
20 |
+
)
|
21 |
+
);
|
22 |
+
parent::__construct();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* widget function.
|
27 |
+
*
|
28 |
+
* @see WP_Widget
|
29 |
+
* @access public
|
30 |
+
* @param array $args
|
31 |
+
* @param array $instance
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
function widget( $args, $instance ) {
|
35 |
+
if ( $this->get_cached_widget( $args ) )
|
36 |
+
return;
|
37 |
+
|
38 |
+
ob_start();
|
39 |
+
|
40 |
+
extract( $args );
|
41 |
+
|
42 |
+
echo $before_widget;
|
43 |
+
|
44 |
+
if ( $instance[ 'title' ] ) echo $before_title . $instance[ 'title' ] . $after_title;
|
45 |
+
|
46 |
+
wp_list_categories( array(
|
47 |
+
'title_li' => '',
|
48 |
+
'taxonomy' => 'job_listing_region',
|
49 |
+
'hide_empty' => 0
|
50 |
+
) );
|
51 |
+
|
52 |
+
echo $after_widget;
|
53 |
+
|
54 |
+
$content = ob_get_clean();
|
55 |
+
|
56 |
+
echo $content;
|
57 |
+
|
58 |
+
$this->cache_widget( $args, $content );
|
59 |
+
}
|
60 |
}
|
languages/wp-job-manager-locations-da_DK.po
CHANGED
@@ -1,88 +1,88 @@
|
|
1 |
-
# Copyright (C) 2015
|
2 |
-
# This file is distributed under the same license as the package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Oversættelse af WP Job manager Locations\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-job-manager-regions\n"
|
7 |
-
"POT-Creation-Date: 2015-01-06 15:06:36+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2015-01-09 14:11+0100\n"
|
12 |
-
"Last-Translator: Nicklas Millard <n.millard@me.com>\n"
|
13 |
-
"Language-Team: Venicura <info@venicura.dk>\n"
|
14 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
-
"Language: da_DK\n"
|
16 |
-
"X-Generator: Poedit 1.7.1\n"
|
17 |
-
|
18 |
-
#: includes/class-taxonomy.php:17 includes/class-template.php:30
|
19 |
-
msgid "Job Region"
|
20 |
-
msgstr "Job område"
|
21 |
-
|
22 |
-
#: includes/class-taxonomy.php:18
|
23 |
-
#: includes/widgets/class-widget-region-list.php:14
|
24 |
-
#: wp-job-manager-locations.php:90
|
25 |
-
msgid "Job Regions"
|
26 |
-
msgstr "Job områder"
|
27 |
-
|
28 |
-
#: includes/class-taxonomy.php:22
|
29 |
-
msgctxt "Job region slug - resave permalinks after changing this"
|
30 |
-
msgid "job-region"
|
31 |
-
msgstr "job-område"
|
32 |
-
|
33 |
-
#: includes/class-taxonomy.php:39
|
34 |
-
msgid "Search %s"
|
35 |
-
msgstr "Søg %s"
|
36 |
-
|
37 |
-
#: includes/class-taxonomy.php:40
|
38 |
-
msgid "All %s"
|
39 |
-
msgstr "Alle %s"
|
40 |
-
|
41 |
-
#: includes/class-taxonomy.php:41
|
42 |
-
msgid "Parent %s"
|
43 |
-
msgstr "Forældre %s"
|
44 |
-
|
45 |
-
#: includes/class-taxonomy.php:42
|
46 |
-
msgid "Parent %s:"
|
47 |
-
msgstr "Forældre %s:"
|
48 |
-
|
49 |
-
#: includes/class-taxonomy.php:43
|
50 |
-
msgid "Edit %s"
|
51 |
-
msgstr "Rediger %s"
|
52 |
-
|
53 |
-
#: includes/class-taxonomy.php:44
|
54 |
-
msgid "Update %s"
|
55 |
-
msgstr "Opdater %s"
|
56 |
-
|
57 |
-
#: includes/class-taxonomy.php:45
|
58 |
-
msgid "Add New %s"
|
59 |
-
msgstr "Tilføj ny %s"
|
60 |
-
|
61 |
-
#: includes/class-taxonomy.php:46
|
62 |
-
msgid "New %s Name"
|
63 |
-
msgstr "Ny %s navn"
|
64 |
-
|
65 |
-
#: includes/class-template.php:50
|
66 |
-
msgid "All Regions"
|
67 |
-
msgstr "Alle områder"
|
68 |
-
|
69 |
-
#: includes/widgets/class-widget-region-list.php:12
|
70 |
-
msgid "Display a list of job regions."
|
71 |
-
msgstr "Vis en liste af job områder."
|
72 |
-
|
73 |
-
#: includes/widgets/class-widget-region-list.php:19
|
74 |
-
msgid "Title:"
|
75 |
-
msgstr "Titel:"
|
76 |
-
|
77 |
-
#: wp-job-manager-locations.php:91
|
78 |
-
msgid "Filter by Region"
|
79 |
-
msgstr "Filrer efter område"
|
80 |
-
|
81 |
-
#: wp-job-manager-locations.php:92
|
82 |
-
msgid "Use a dropdown instead of a text input."
|
83 |
-
msgstr "Brug en dropdown i stedet for tekst input"
|
84 |
-
|
85 |
-
#: wp-job-manager-locations.php:197
|
86 |
-
msgid "in %s"
|
87 |
-
msgstr "i %s"
|
88 |
-
|
1 |
+
# Copyright (C) 2015
|
2 |
+
# This file is distributed under the same license as the package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: Oversættelse af WP Job manager Locations\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-job-manager-regions\n"
|
7 |
+
"POT-Creation-Date: 2015-01-06 15:06:36+00:00\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2015-01-09 14:11+0100\n"
|
12 |
+
"Last-Translator: Nicklas Millard <n.millard@me.com>\n"
|
13 |
+
"Language-Team: Venicura <info@venicura.dk>\n"
|
14 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
+
"Language: da_DK\n"
|
16 |
+
"X-Generator: Poedit 1.7.1\n"
|
17 |
+
|
18 |
+
#: includes/class-taxonomy.php:17 includes/class-template.php:30
|
19 |
+
msgid "Job Region"
|
20 |
+
msgstr "Job område"
|
21 |
+
|
22 |
+
#: includes/class-taxonomy.php:18
|
23 |
+
#: includes/widgets/class-widget-region-list.php:14
|
24 |
+
#: wp-job-manager-locations.php:90
|
25 |
+
msgid "Job Regions"
|
26 |
+
msgstr "Job områder"
|
27 |
+
|
28 |
+
#: includes/class-taxonomy.php:22
|
29 |
+
msgctxt "Job region slug - resave permalinks after changing this"
|
30 |
+
msgid "job-region"
|
31 |
+
msgstr "job-område"
|
32 |
+
|
33 |
+
#: includes/class-taxonomy.php:39
|
34 |
+
msgid "Search %s"
|
35 |
+
msgstr "Søg %s"
|
36 |
+
|
37 |
+
#: includes/class-taxonomy.php:40
|
38 |
+
msgid "All %s"
|
39 |
+
msgstr "Alle %s"
|
40 |
+
|
41 |
+
#: includes/class-taxonomy.php:41
|
42 |
+
msgid "Parent %s"
|
43 |
+
msgstr "Forældre %s"
|
44 |
+
|
45 |
+
#: includes/class-taxonomy.php:42
|
46 |
+
msgid "Parent %s:"
|
47 |
+
msgstr "Forældre %s:"
|
48 |
+
|
49 |
+
#: includes/class-taxonomy.php:43
|
50 |
+
msgid "Edit %s"
|
51 |
+
msgstr "Rediger %s"
|
52 |
+
|
53 |
+
#: includes/class-taxonomy.php:44
|
54 |
+
msgid "Update %s"
|
55 |
+
msgstr "Opdater %s"
|
56 |
+
|
57 |
+
#: includes/class-taxonomy.php:45
|
58 |
+
msgid "Add New %s"
|
59 |
+
msgstr "Tilføj ny %s"
|
60 |
+
|
61 |
+
#: includes/class-taxonomy.php:46
|
62 |
+
msgid "New %s Name"
|
63 |
+
msgstr "Ny %s navn"
|
64 |
+
|
65 |
+
#: includes/class-template.php:50
|
66 |
+
msgid "All Regions"
|
67 |
+
msgstr "Alle områder"
|
68 |
+
|
69 |
+
#: includes/widgets/class-widget-region-list.php:12
|
70 |
+
msgid "Display a list of job regions."
|
71 |
+
msgstr "Vis en liste af job områder."
|
72 |
+
|
73 |
+
#: includes/widgets/class-widget-region-list.php:19
|
74 |
+
msgid "Title:"
|
75 |
+
msgstr "Titel:"
|
76 |
+
|
77 |
+
#: wp-job-manager-locations.php:91
|
78 |
+
msgid "Filter by Region"
|
79 |
+
msgstr "Filrer efter område"
|
80 |
+
|
81 |
+
#: wp-job-manager-locations.php:92
|
82 |
+
msgid "Use a dropdown instead of a text input."
|
83 |
+
msgstr "Brug en dropdown i stedet for tekst input"
|
84 |
+
|
85 |
+
#: wp-job-manager-locations.php:197
|
86 |
+
msgid "in %s"
|
87 |
+
msgstr "i %s"
|
88 |
+
|
languages/wp-job-manager-locations-es_ES.po
CHANGED
@@ -1,88 +1,88 @@
|
|
1 |
-
# Copyright (C) 2015
|
2 |
-
# This file is distributed under the same license as the package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: \n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-job-manager-regions\n"
|
7 |
-
"POT-Creation-Date: 2015-01-06 15:06:36+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2015-01-06 19:08+0100\n"
|
12 |
-
"Last-Translator: Franco <franco@associazionejoint.org>\n"
|
13 |
-
"Language-Team: \n"
|
14 |
-
"X-Generator: Poedit 1.7.1\n"
|
15 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
-
"Language: es_ES\n"
|
17 |
-
|
18 |
-
#: includes/class-taxonomy.php:17 includes/class-template.php:30
|
19 |
-
msgid "Job Region"
|
20 |
-
msgstr "Región del puesto"
|
21 |
-
|
22 |
-
#: includes/class-taxonomy.php:18
|
23 |
-
#: includes/widgets/class-widget-region-list.php:14
|
24 |
-
#: wp-job-manager-locations.php:90
|
25 |
-
msgid "Job Regions"
|
26 |
-
msgstr "Regiones disponibles"
|
27 |
-
|
28 |
-
#: includes/class-taxonomy.php:22
|
29 |
-
msgctxt "Job region slug - resave permalinks after changing this"
|
30 |
-
msgid "job-region"
|
31 |
-
msgstr "region-voluntariado"
|
32 |
-
|
33 |
-
#: includes/class-taxonomy.php:39
|
34 |
-
msgid "Search %s"
|
35 |
-
msgstr "Buscar %s"
|
36 |
-
|
37 |
-
#: includes/class-taxonomy.php:40
|
38 |
-
msgid "All %s"
|
39 |
-
msgstr "Todos %s"
|
40 |
-
|
41 |
-
#: includes/class-taxonomy.php:41
|
42 |
-
msgid "Parent %s"
|
43 |
-
msgstr "Padre %s"
|
44 |
-
|
45 |
-
#: includes/class-taxonomy.php:42
|
46 |
-
msgid "Parent %s:"
|
47 |
-
msgstr "Padres% s:"
|
48 |
-
|
49 |
-
#: includes/class-taxonomy.php:43
|
50 |
-
msgid "Edit %s"
|
51 |
-
msgstr "Editar %s"
|
52 |
-
|
53 |
-
#: includes/class-taxonomy.php:44
|
54 |
-
msgid "Update %s"
|
55 |
-
msgstr "Actualizar %s"
|
56 |
-
|
57 |
-
#: includes/class-taxonomy.php:45
|
58 |
-
msgid "Add New %s"
|
59 |
-
msgstr "Añadir nuevo/a %s"
|
60 |
-
|
61 |
-
#: includes/class-taxonomy.php:46
|
62 |
-
msgid "New %s Name"
|
63 |
-
msgstr "Nuevo nombre para %s"
|
64 |
-
|
65 |
-
#: includes/class-template.php:50
|
66 |
-
msgid "All Regions"
|
67 |
-
msgstr "Todas las regiones"
|
68 |
-
|
69 |
-
#: includes/widgets/class-widget-region-list.php:12
|
70 |
-
msgid "Display a list of job regions."
|
71 |
-
msgstr "Muestra una lista de regiones."
|
72 |
-
|
73 |
-
#: includes/widgets/class-widget-region-list.php:19
|
74 |
-
msgid "Title:"
|
75 |
-
msgstr "Título:"
|
76 |
-
|
77 |
-
#: wp-job-manager-locations.php:91
|
78 |
-
msgid "Filter by Region"
|
79 |
-
msgstr "Filtrar por región"
|
80 |
-
|
81 |
-
#: wp-job-manager-locations.php:92
|
82 |
-
msgid "Use a dropdown instead of a text input."
|
83 |
-
msgstr "Usa una lista desplegable en vez de un campo de texto."
|
84 |
-
|
85 |
-
#: wp-job-manager-locations.php:197
|
86 |
-
msgid "in %s"
|
87 |
-
msgstr "en %s"
|
88 |
-
|
1 |
+
# Copyright (C) 2015
|
2 |
+
# This file is distributed under the same license as the package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: \n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-job-manager-regions\n"
|
7 |
+
"POT-Creation-Date: 2015-01-06 15:06:36+00:00\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2015-01-06 19:08+0100\n"
|
12 |
+
"Last-Translator: Franco <franco@associazionejoint.org>\n"
|
13 |
+
"Language-Team: \n"
|
14 |
+
"X-Generator: Poedit 1.7.1\n"
|
15 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
+
"Language: es_ES\n"
|
17 |
+
|
18 |
+
#: includes/class-taxonomy.php:17 includes/class-template.php:30
|
19 |
+
msgid "Job Region"
|
20 |
+
msgstr "Región del puesto"
|
21 |
+
|
22 |
+
#: includes/class-taxonomy.php:18
|
23 |
+
#: includes/widgets/class-widget-region-list.php:14
|
24 |
+
#: wp-job-manager-locations.php:90
|
25 |
+
msgid "Job Regions"
|
26 |
+
msgstr "Regiones disponibles"
|
27 |
+
|
28 |
+
#: includes/class-taxonomy.php:22
|
29 |
+
msgctxt "Job region slug - resave permalinks after changing this"
|
30 |
+
msgid "job-region"
|
31 |
+
msgstr "region-voluntariado"
|
32 |
+
|
33 |
+
#: includes/class-taxonomy.php:39
|
34 |
+
msgid "Search %s"
|
35 |
+
msgstr "Buscar %s"
|
36 |
+
|
37 |
+
#: includes/class-taxonomy.php:40
|
38 |
+
msgid "All %s"
|
39 |
+
msgstr "Todos %s"
|
40 |
+
|
41 |
+
#: includes/class-taxonomy.php:41
|
42 |
+
msgid "Parent %s"
|
43 |
+
msgstr "Padre %s"
|
44 |
+
|
45 |
+
#: includes/class-taxonomy.php:42
|
46 |
+
msgid "Parent %s:"
|
47 |
+
msgstr "Padres% s:"
|
48 |
+
|
49 |
+
#: includes/class-taxonomy.php:43
|
50 |
+
msgid "Edit %s"
|
51 |
+
msgstr "Editar %s"
|
52 |
+
|
53 |
+
#: includes/class-taxonomy.php:44
|
54 |
+
msgid "Update %s"
|
55 |
+
msgstr "Actualizar %s"
|
56 |
+
|
57 |
+
#: includes/class-taxonomy.php:45
|
58 |
+
msgid "Add New %s"
|
59 |
+
msgstr "Añadir nuevo/a %s"
|
60 |
+
|
61 |
+
#: includes/class-taxonomy.php:46
|
62 |
+
msgid "New %s Name"
|
63 |
+
msgstr "Nuevo nombre para %s"
|
64 |
+
|
65 |
+
#: includes/class-template.php:50
|
66 |
+
msgid "All Regions"
|
67 |
+
msgstr "Todas las regiones"
|
68 |
+
|
69 |
+
#: includes/widgets/class-widget-region-list.php:12
|
70 |
+
msgid "Display a list of job regions."
|
71 |
+
msgstr "Muestra una lista de regiones."
|
72 |
+
|
73 |
+
#: includes/widgets/class-widget-region-list.php:19
|
74 |
+
msgid "Title:"
|
75 |
+
msgstr "Título:"
|
76 |
+
|
77 |
+
#: wp-job-manager-locations.php:91
|
78 |
+
msgid "Filter by Region"
|
79 |
+
msgstr "Filtrar por región"
|
80 |
+
|
81 |
+
#: wp-job-manager-locations.php:92
|
82 |
+
msgid "Use a dropdown instead of a text input."
|
83 |
+
msgstr "Usa una lista desplegable en vez de un campo de texto."
|
84 |
+
|
85 |
+
#: wp-job-manager-locations.php:197
|
86 |
+
msgid "in %s"
|
87 |
+
msgstr "en %s"
|
88 |
+
|
languages/wp-job-manager-locations-ru_RU.mo
CHANGED
File without changes
|
languages/wp-job-manager-locations-ru_RU.po
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
# Copyright (C) 2015
|
2 |
-
# This file is distributed under the same license as the package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: WP Job manager Locations RU\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-job-manager-regions\n"
|
7 |
-
"POT-Creation-Date: 2015-01-06 15:06:36+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2015-03-16 04:32+0300\n"
|
12 |
-
"Last-Translator: Denis <denis@idsn.ru>\n"
|
13 |
-
"Language-Team: Denis Klyuev <denis@idsn.ru>\n"
|
14 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
-
"Language: ru_RU\n"
|
16 |
-
"X-Generator: Poedit 1.6.6\n"
|
17 |
-
|
18 |
-
#: includes/class-taxonomy.php:17 includes/class-template.php:30
|
19 |
-
msgid "Job Region"
|
20 |
-
msgstr "Регион"
|
21 |
-
|
22 |
-
#: includes/class-taxonomy.php:18
|
23 |
-
#: includes/widgets/class-widget-region-list.php:14
|
24 |
-
#: wp-job-manager-locations.php:90
|
25 |
-
msgid "Job Regions"
|
26 |
-
msgstr "Регионы"
|
27 |
-
|
28 |
-
#: includes/class-taxonomy.php:22
|
29 |
-
msgctxt "Job region slug - resave permalinks after changing this"
|
30 |
-
msgid "job-region"
|
31 |
-
msgstr "region"
|
32 |
-
|
33 |
-
#: includes/class-taxonomy.php:39
|
34 |
-
msgid "Search %s"
|
35 |
-
msgstr "Поиск %s"
|
36 |
-
|
37 |
-
#: includes/class-taxonomy.php:40
|
38 |
-
msgid "All %s"
|
39 |
-
msgstr "Все %s"
|
40 |
-
|
41 |
-
#: includes/class-taxonomy.php:41
|
42 |
-
msgid "Parent %s"
|
43 |
-
msgstr "Родитель %s"
|
44 |
-
|
45 |
-
#: includes/class-taxonomy.php:42
|
46 |
-
msgid "Parent %s:"
|
47 |
-
msgstr "Родитель %s"
|
48 |
-
|
49 |
-
#: includes/class-taxonomy.php:43
|
50 |
-
msgid "Edit %s"
|
51 |
-
msgstr "Редактировать %"
|
52 |
-
|
53 |
-
#: includes/class-taxonomy.php:44
|
54 |
-
msgid "Update %s"
|
55 |
-
msgstr "Обновить %"
|
56 |
-
|
57 |
-
#: includes/class-taxonomy.php:45
|
58 |
-
msgid "Add New %s"
|
59 |
-
msgstr "Добавить Новое %"
|
60 |
-
|
61 |
-
#: includes/class-taxonomy.php:46
|
62 |
-
msgid "New %s Name"
|
63 |
-
msgstr "Новое %s Имя"
|
64 |
-
|
65 |
-
#: includes/class-template.php:50
|
66 |
-
msgid "All Regions"
|
67 |
-
msgstr "Во всех регионах"
|
68 |
-
|
69 |
-
#: includes/widgets/class-widget-region-list.php:12
|
70 |
-
msgid "Display a list of job regions."
|
71 |
-
msgstr "Отображать список по регионам."
|
72 |
-
|
73 |
-
#: includes/widgets/class-widget-region-list.php:19
|
74 |
-
msgid "Title:"
|
75 |
-
msgstr "Название:"
|
76 |
-
|
77 |
-
#: wp-job-manager-locations.php:91
|
78 |
-
msgid "Filter by Region"
|
79 |
-
msgstr "Фильтр по Регионам"
|
80 |
-
|
81 |
-
#: wp-job-manager-locations.php:92
|
82 |
-
msgid "Use a dropdown instead of a text input."
|
83 |
-
msgstr "Выпадающее меню вместо ввода."
|
84 |
-
|
85 |
-
#: wp-job-manager-locations.php:197
|
86 |
-
msgid "in %s"
|
87 |
-
msgstr "в %"
|
1 |
+
# Copyright (C) 2015
|
2 |
+
# This file is distributed under the same license as the package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: WP Job manager Locations RU\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-job-manager-regions\n"
|
7 |
+
"POT-Creation-Date: 2015-01-06 15:06:36+00:00\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2015-03-16 04:32+0300\n"
|
12 |
+
"Last-Translator: Denis <denis@idsn.ru>\n"
|
13 |
+
"Language-Team: Denis Klyuev <denis@idsn.ru>\n"
|
14 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
+
"Language: ru_RU\n"
|
16 |
+
"X-Generator: Poedit 1.6.6\n"
|
17 |
+
|
18 |
+
#: includes/class-taxonomy.php:17 includes/class-template.php:30
|
19 |
+
msgid "Job Region"
|
20 |
+
msgstr "Регион"
|
21 |
+
|
22 |
+
#: includes/class-taxonomy.php:18
|
23 |
+
#: includes/widgets/class-widget-region-list.php:14
|
24 |
+
#: wp-job-manager-locations.php:90
|
25 |
+
msgid "Job Regions"
|
26 |
+
msgstr "Регионы"
|
27 |
+
|
28 |
+
#: includes/class-taxonomy.php:22
|
29 |
+
msgctxt "Job region slug - resave permalinks after changing this"
|
30 |
+
msgid "job-region"
|
31 |
+
msgstr "region"
|
32 |
+
|
33 |
+
#: includes/class-taxonomy.php:39
|
34 |
+
msgid "Search %s"
|
35 |
+
msgstr "Поиск %s"
|
36 |
+
|
37 |
+
#: includes/class-taxonomy.php:40
|
38 |
+
msgid "All %s"
|
39 |
+
msgstr "Все %s"
|
40 |
+
|
41 |
+
#: includes/class-taxonomy.php:41
|
42 |
+
msgid "Parent %s"
|
43 |
+
msgstr "Родитель %s"
|
44 |
+
|
45 |
+
#: includes/class-taxonomy.php:42
|
46 |
+
msgid "Parent %s:"
|
47 |
+
msgstr "Родитель %s"
|
48 |
+
|
49 |
+
#: includes/class-taxonomy.php:43
|
50 |
+
msgid "Edit %s"
|
51 |
+
msgstr "Редактировать %"
|
52 |
+
|
53 |
+
#: includes/class-taxonomy.php:44
|
54 |
+
msgid "Update %s"
|
55 |
+
msgstr "Обновить %"
|
56 |
+
|
57 |
+
#: includes/class-taxonomy.php:45
|
58 |
+
msgid "Add New %s"
|
59 |
+
msgstr "Добавить Новое %"
|
60 |
+
|
61 |
+
#: includes/class-taxonomy.php:46
|
62 |
+
msgid "New %s Name"
|
63 |
+
msgstr "Новое %s Имя"
|
64 |
+
|
65 |
+
#: includes/class-template.php:50
|
66 |
+
msgid "All Regions"
|
67 |
+
msgstr "Во всех регионах"
|
68 |
+
|
69 |
+
#: includes/widgets/class-widget-region-list.php:12
|
70 |
+
msgid "Display a list of job regions."
|
71 |
+
msgstr "Отображать список по регионам."
|
72 |
+
|
73 |
+
#: includes/widgets/class-widget-region-list.php:19
|
74 |
+
msgid "Title:"
|
75 |
+
msgstr "Название:"
|
76 |
+
|
77 |
+
#: wp-job-manager-locations.php:91
|
78 |
+
msgid "Filter by Region"
|
79 |
+
msgstr "Фильтр по Регионам"
|
80 |
+
|
81 |
+
#: wp-job-manager-locations.php:92
|
82 |
+
msgid "Use a dropdown instead of a text input."
|
83 |
+
msgstr "Выпадающее меню вместо ввода."
|
84 |
+
|
85 |
+
#: wp-job-manager-locations.php:197
|
86 |
+
msgid "in %s"
|
87 |
+
msgstr "в %"
|
languages/wp-job-manager-locations.pot
CHANGED
@@ -1,142 +1,142 @@
|
|
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.17.4\n"
|
6 |
-
"Report-Msgid-Bugs-To: "
|
7 |
-
"https://wordpress.org/support/plugin/wp-job-manager-regions\n"
|
8 |
-
"POT-Creation-Date: 2019-02-14 13:04:25+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-i18n 1.0.3\n"
|
16 |
-
|
17 |
-
#: includes/class-taxonomy.php:17 includes/class-template.php:94
|
18 |
-
msgid "Job Region"
|
19 |
-
msgstr ""
|
20 |
-
|
21 |
-
#: includes/class-taxonomy.php:18
|
22 |
-
#: includes/widgets/class-widget-region-list.php:14
|
23 |
-
msgid "Job Regions"
|
24 |
-
msgstr ""
|
25 |
-
|
26 |
-
#: includes/class-taxonomy.php:45 includes/class-taxonomy.php:79
|
27 |
-
msgid "Search %s"
|
28 |
-
msgstr ""
|
29 |
-
|
30 |
-
#: includes/class-taxonomy.php:46 includes/class-taxonomy.php:80
|
31 |
-
msgid "All %s"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#: includes/class-taxonomy.php:47 includes/class-taxonomy.php:81
|
35 |
-
msgid "Parent %s"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: includes/class-taxonomy.php:48 includes/class-taxonomy.php:82
|
39 |
-
msgid "Parent %s:"
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
#: includes/class-taxonomy.php:49 includes/class-taxonomy.php:83
|
43 |
-
msgid "Edit %s"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#: includes/class-taxonomy.php:50 includes/class-taxonomy.php:84
|
47 |
-
msgid "Update %s"
|
48 |
-
msgstr ""
|
49 |
-
|
50 |
-
#: includes/class-taxonomy.php:51 includes/class-taxonomy.php:85
|
51 |
-
msgid "Add New %s"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: includes/class-taxonomy.php:52 includes/class-taxonomy.php:86
|
55 |
-
msgid "New %s Name"
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: includes/class-taxonomy.php:67
|
59 |
-
msgid "Resume Region"
|
60 |
-
msgstr ""
|
61 |
-
|
62 |
-
#: includes/class-taxonomy.php:68
|
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 |
-
|
78 |
-
#: includes/widgets/class-widget-region-list.php:12
|
79 |
-
msgid "Display a list of job regions."
|
80 |
-
msgstr ""
|
81 |
-
|
82 |
-
#: includes/widgets/class-widget-region-list.php:19
|
83 |
-
msgid "Title:"
|
84 |
-
msgstr ""
|
85 |
-
|
86 |
-
#: wp-job-manager-locations.php:101 wp-job-manager-locations.php:122
|
87 |
-
msgid "Filter Location Display"
|
88 |
-
msgstr ""
|
89 |
-
|
90 |
-
#: wp-job-manager-locations.php:102 wp-job-manager-locations.php:123
|
91 |
-
msgid "Display Region"
|
92 |
-
msgstr ""
|
93 |
-
|
94 |
-
#: wp-job-manager-locations.php:103 wp-job-manager-locations.php:124
|
95 |
-
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 |
-
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."
|
106 |
-
msgstr ""
|
107 |
-
|
108 |
-
#: wp-job-manager-locations.php:328 wp-job-manager-locations.php:340
|
109 |
-
msgid "in %s"
|
110 |
-
msgstr ""
|
111 |
-
|
112 |
-
#. Plugin Name of the plugin/theme
|
113 |
-
msgid "Regions for WP Job Manager"
|
114 |
-
msgstr ""
|
115 |
-
|
116 |
-
#. Plugin URI of the plugin/theme
|
117 |
-
msgid "https://wordpress.org/plugins/wp-job-manager-locations/"
|
118 |
-
msgstr ""
|
119 |
-
|
120 |
-
#. Description of the plugin/theme
|
121 |
-
msgid ""
|
122 |
-
"Create predefined regions/locations that job submissions can associate "
|
123 |
-
"themselves with."
|
124 |
-
msgstr ""
|
125 |
-
|
126 |
-
#. Author of the plugin/theme
|
127 |
-
msgid "Astoundify"
|
128 |
-
msgstr ""
|
129 |
-
|
130 |
-
#. Author URI of the plugin/theme
|
131 |
-
msgid "http://astoundify.com"
|
132 |
-
msgstr ""
|
133 |
-
|
134 |
-
#: includes/class-taxonomy.php:22
|
135 |
-
msgctxt "Job region slug - resave permalinks after changing this"
|
136 |
-
msgid "job-region"
|
137 |
-
msgstr ""
|
138 |
-
|
139 |
-
#: includes/class-taxonomy.php:27
|
140 |
-
msgctxt "Resume region slug - resave permalinks after changing this"
|
141 |
-
msgid "resume-region"
|
142 |
msgstr ""
|
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.17.4\n"
|
6 |
+
"Report-Msgid-Bugs-To: "
|
7 |
+
"https://wordpress.org/support/plugin/wp-job-manager-regions\n"
|
8 |
+
"POT-Creation-Date: 2019-02-14 13:04:25+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-i18n 1.0.3\n"
|
16 |
+
|
17 |
+
#: includes/class-taxonomy.php:17 includes/class-template.php:94
|
18 |
+
msgid "Job Region"
|
19 |
+
msgstr ""
|
20 |
+
|
21 |
+
#: includes/class-taxonomy.php:18
|
22 |
+
#: includes/widgets/class-widget-region-list.php:14
|
23 |
+
msgid "Job Regions"
|
24 |
+
msgstr ""
|
25 |
+
|
26 |
+
#: includes/class-taxonomy.php:45 includes/class-taxonomy.php:79
|
27 |
+
msgid "Search %s"
|
28 |
+
msgstr ""
|
29 |
+
|
30 |
+
#: includes/class-taxonomy.php:46 includes/class-taxonomy.php:80
|
31 |
+
msgid "All %s"
|
32 |
+
msgstr ""
|
33 |
+
|
34 |
+
#: includes/class-taxonomy.php:47 includes/class-taxonomy.php:81
|
35 |
+
msgid "Parent %s"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: includes/class-taxonomy.php:48 includes/class-taxonomy.php:82
|
39 |
+
msgid "Parent %s:"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: includes/class-taxonomy.php:49 includes/class-taxonomy.php:83
|
43 |
+
msgid "Edit %s"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: includes/class-taxonomy.php:50 includes/class-taxonomy.php:84
|
47 |
+
msgid "Update %s"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: includes/class-taxonomy.php:51 includes/class-taxonomy.php:85
|
51 |
+
msgid "Add New %s"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: includes/class-taxonomy.php:52 includes/class-taxonomy.php:86
|
55 |
+
msgid "New %s Name"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: includes/class-taxonomy.php:67
|
59 |
+
msgid "Resume Region"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: includes/class-taxonomy.php:68
|
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 |
+
|
78 |
+
#: includes/widgets/class-widget-region-list.php:12
|
79 |
+
msgid "Display a list of job regions."
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: includes/widgets/class-widget-region-list.php:19
|
83 |
+
msgid "Title:"
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: wp-job-manager-locations.php:101 wp-job-manager-locations.php:122
|
87 |
+
msgid "Filter Location Display"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: wp-job-manager-locations.php:102 wp-job-manager-locations.php:123
|
91 |
+
msgid "Display Region"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: wp-job-manager-locations.php:103 wp-job-manager-locations.php:124
|
95 |
+
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 |
+
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."
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
#: wp-job-manager-locations.php:328 wp-job-manager-locations.php:340
|
109 |
+
msgid "in %s"
|
110 |
+
msgstr ""
|
111 |
+
|
112 |
+
#. Plugin Name of the plugin/theme
|
113 |
+
msgid "Regions for WP Job Manager"
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#. Plugin URI of the plugin/theme
|
117 |
+
msgid "https://wordpress.org/plugins/wp-job-manager-locations/"
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#. Description of the plugin/theme
|
121 |
+
msgid ""
|
122 |
+
"Create predefined regions/locations that job submissions can associate "
|
123 |
+
"themselves with."
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#. Author of the plugin/theme
|
127 |
+
msgid "Astoundify"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#. Author URI of the plugin/theme
|
131 |
+
msgid "http://astoundify.com"
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: includes/class-taxonomy.php:22
|
135 |
+
msgctxt "Job region slug - resave permalinks after changing this"
|
136 |
+
msgid "job-region"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: includes/class-taxonomy.php:27
|
140 |
+
msgctxt "Resume region slug - resave permalinks after changing this"
|
141 |
+
msgid "resume-region"
|
142 |
msgstr ""
|
readme.txt
CHANGED
@@ -1,184 +1,192 @@
|
|
1 |
-
=== Regions for WP Job Manager ===
|
2 |
-
Author URI: http://astoundify.com
|
3 |
-
Plugin URI: https://astoundify.com/products/wp-job-manager-regions/
|
4 |
-
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: 5.
|
9 |
-
Stable Tag: 1.17.
|
10 |
-
License: GPLv3
|
11 |
-
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
12 |
-
|
13 |
-
Add predefined regions to WP Job Manager submission form.
|
14 |
-
|
15 |
-
== Description ==
|
16 |
-
|
17 |
-
Adds a "Job Region" taxonomy so the site administrator can control a set of predefined regions listings can be assigned to.
|
18 |
-
|
19 |
-
**Note:** Listings are not filtered by regions. They are simply used as an organization tool.
|
20 |
-
|
21 |
-
= Where can I use this? =
|
22 |
-
|
23 |
-
Astoundify has released two themes that are fully integrated with the WP Job Manager plugin. Check out ["Jobify"](http://themeforest.net/item/jobify-job-board-wordpress-theme/5247604?ref=Astoundify) and our WordPress Directory theme ["Listify"](http://themeforest.net/item/listify-wordpress-directory-theme/9602611?ref=Astoundify)
|
24 |
-
|
25 |
-
== Installation ==
|
26 |
-
|
27 |
-
1. Install and Activate
|
28 |
-
2. Go to "Job Listings > Job Regions" and add regions.
|
29 |
-
|
30 |
-
== Frequently Asked Questions ==
|
31 |
-
|
32 |
-
== Changelog ==
|
33 |
-
|
34 |
-
= 1.17.
|
35 |
-
|
36 |
-
* Fix:
|
37 |
-
*
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
*
|
51 |
-
|
52 |
-
= 1.
|
53 |
-
|
54 |
-
*
|
55 |
-
|
56 |
-
= 1.
|
57 |
-
|
58 |
-
*
|
59 |
-
|
60 |
-
= 1.
|
61 |
-
|
62 |
-
* New:
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
* New:
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
* New:
|
90 |
-
* Fix:
|
91 |
-
* Fix:
|
92 |
-
|
93 |
-
= 1.
|
94 |
-
|
95 |
-
* New:
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
* Fix:
|
100 |
-
|
101 |
-
= 1.
|
102 |
-
|
103 |
-
*
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
* Fix:
|
115 |
-
|
116 |
-
= 1.
|
117 |
-
|
118 |
-
* Fix:
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
*
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
* Fix:
|
132 |
-
|
133 |
-
= 1.7.
|
134 |
-
|
135 |
-
* New: Add
|
136 |
-
*
|
137 |
-
*
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
*
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
* Fix:
|
156 |
-
|
157 |
-
= 1.5.
|
158 |
-
|
159 |
-
*
|
160 |
-
|
161 |
-
= 1.
|
162 |
-
|
163 |
-
*
|
164 |
-
|
165 |
-
= 1.
|
166 |
-
|
167 |
-
*
|
168 |
-
|
169 |
-
= 1.
|
170 |
-
|
171 |
-
*
|
172 |
-
|
173 |
-
= 1.
|
174 |
-
|
175 |
-
* Fix:
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Regions for WP Job Manager ===
|
2 |
+
Author URI: http://astoundify.com
|
3 |
+
Plugin URI: https://astoundify.com/products/wp-job-manager-regions/
|
4 |
+
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: 5.5.1
|
9 |
+
Stable Tag: 1.17.5
|
10 |
+
License: GPLv3
|
11 |
+
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
12 |
+
|
13 |
+
Add predefined regions to WP Job Manager submission form.
|
14 |
+
|
15 |
+
== Description ==
|
16 |
+
|
17 |
+
Adds a "Job Region" taxonomy so the site administrator can control a set of predefined regions listings can be assigned to.
|
18 |
+
|
19 |
+
**Note:** Listings are not filtered by regions. They are simply used as an organization tool.
|
20 |
+
|
21 |
+
= Where can I use this? =
|
22 |
+
|
23 |
+
Astoundify has released two themes that are fully integrated with the WP Job Manager plugin. Check out ["Jobify"](http://themeforest.net/item/jobify-job-board-wordpress-theme/5247604?ref=Astoundify) and our WordPress Directory theme ["Listify"](http://themeforest.net/item/listify-wordpress-directory-theme/9602611?ref=Astoundify)
|
24 |
+
|
25 |
+
== Installation ==
|
26 |
+
|
27 |
+
1. Install and Activate
|
28 |
+
2. Go to "Job Listings > Job Regions" and add regions.
|
29 |
+
|
30 |
+
== Frequently Asked Questions ==
|
31 |
+
|
32 |
+
== Changelog ==
|
33 |
+
|
34 |
+
= 1.17.5: Nov 25, 2020 =
|
35 |
+
|
36 |
+
* Fix: Minify JS file.
|
37 |
+
* New: Regions settings implementation for resumes.
|
38 |
+
* Update: Compatibility check with latest WordPress v5.5.3.
|
39 |
+
* Update: Compatibility check with Latest WP Job Manager v1.34.3.
|
40 |
+
* Update: Compatibility check with the latest PHP v7.4.10.
|
41 |
+
|
42 |
+
= 1.17.4: February 14, 2019 =
|
43 |
+
|
44 |
+
* Fix: Improve type checks for the Select2 library.
|
45 |
+
* Fix: Make the taxonomy available to REST Api, and now it's available in the new editor.
|
46 |
+
|
47 |
+
= 1.17.3: January 30, 2019 =
|
48 |
+
|
49 |
+
* Fix: Output region instead of candidate location if setting is enabled.
|
50 |
+
* Fix: Further WP Job Manager compatibility.
|
51 |
+
|
52 |
+
= 1.17.1/2: January 26, 2019 =
|
53 |
+
|
54 |
+
* Fix: Ensure select2 arguments are always defined.
|
55 |
+
|
56 |
+
= 1.17.0: January 24, 2019 =
|
57 |
+
|
58 |
+
* New: WP Job Manager 1.32.0 support.
|
59 |
+
|
60 |
+
= 1.16.0: January 14, 2019 =
|
61 |
+
|
62 |
+
* New: WP Job Manager 1.32.0 support.
|
63 |
+
|
64 |
+
= 1.15.1: May 16, 2018 =
|
65 |
+
|
66 |
+
* Fix: Revert use `job_manager_dropdown_categories()` function instead of `wp_dropdown_categories()`.
|
67 |
+
|
68 |
+
= 1.15.0: May 12, 2018 =
|
69 |
+
|
70 |
+
* New: Use `job_manager_dropdown_categories()` function instead of `wp_dropdown_categories()`.
|
71 |
+
* New: Add `job_manager_locations_get_terms` and `job_manager_locations_get_term_list_separator` filters for modifying output.
|
72 |
+
|
73 |
+
= 1.14.0: July 11, 2017 =
|
74 |
+
|
75 |
+
* New: Listify 2.0+ support.
|
76 |
+
|
77 |
+
= 1.13.0: April 12, 2017 =
|
78 |
+
|
79 |
+
* New: Update README.
|
80 |
+
* Fix: Update plugin strings.
|
81 |
+
|
82 |
+
= 1.12.1: February 1, 2017 =
|
83 |
+
|
84 |
+
* Fix: Tested up to: WordPress 4.7.2
|
85 |
+
* Fix: Move .pot translation file to /languages directory
|
86 |
+
|
87 |
+
= 1.12.0: January 10, 2017 =
|
88 |
+
|
89 |
+
* New: Tested up to: WordPress 4.7
|
90 |
+
* Fix: String updates.
|
91 |
+
* Fix: Only adjust placeholder on our current field.
|
92 |
+
|
93 |
+
= 1.11.0: September 1, 2016 =
|
94 |
+
|
95 |
+
* New: Tested up to: WordPress 4.6
|
96 |
+
* New: add in option to disable filtering location
|
97 |
+
* New: add in new taxonomy for resumes
|
98 |
+
* Fix: Remove trailing slash and account for https
|
99 |
+
* Fix: Update settings strings
|
100 |
+
|
101 |
+
= 1.10.0: February 5, 2016 =
|
102 |
+
|
103 |
+
* New: Use `search_contains` to search less strictly.
|
104 |
+
|
105 |
+
= 1.9.1: October 30, 2015 =
|
106 |
+
|
107 |
+
* Fix: Verify the region exists for alerts.
|
108 |
+
|
109 |
+
= 1.9.0: September 1, 2015 =
|
110 |
+
|
111 |
+
* Fix: WP Job Manager - Alerts support
|
112 |
+
* Fix: Reset
|
113 |
+
* Fix: uninstall.php
|
114 |
+
* Fix: RSS Feeds
|
115 |
+
|
116 |
+
= 1.8.1: August 31, 2015 =
|
117 |
+
|
118 |
+
* Fix: Taxonomy registration priority to be used with widgets.
|
119 |
+
|
120 |
+
= 1.8.0: August 12, 2015 =
|
121 |
+
|
122 |
+
* Fix: Listify 1.0.6 compatibility.
|
123 |
+
|
124 |
+
= 1.7.3: April 1, 2015 =
|
125 |
+
|
126 |
+
* Fix: Make sure the regions dropdown can always replace the location input.
|
127 |
+
* Fix: Compatibility with WP Job Manager - Alerts.
|
128 |
+
|
129 |
+
= 1.7.2: March 17, 2015 =
|
130 |
+
|
131 |
+
* Fix: Properly place the standard <select> dropdown for mobile devices.
|
132 |
+
|
133 |
+
= 1.7.1: March 15, 2015 =
|
134 |
+
|
135 |
+
* New: Add Chosen dropdown support.
|
136 |
+
* New: Add WP Job Manager Alerts support.
|
137 |
+
* New: Add Danish tranlsation.
|
138 |
+
* Tweak: Use $_REQUEST to add support for 1.21.0 of WP Job Manager.
|
139 |
+
* Fix: Remove extra whitespace.
|
140 |
+
|
141 |
+
= 1.7.0: January 8, 2015 =
|
142 |
+
|
143 |
+
* New: Add es_ES translation.
|
144 |
+
* Fix: Make sure translations can always properly be loaded.
|
145 |
+
* Fix: Always use the dropdown when on a region archive to help with sorting.
|
146 |
+
|
147 |
+
= 1.6.1: December 19, 2014 =
|
148 |
+
|
149 |
+
Fix: Outputting extra links in the job list.
|
150 |
+
|
151 |
+
= 1.6.0: December 17, 2014 =
|
152 |
+
|
153 |
+
* New: Add a class to the theme's body tag so the location field can be hidden on term archive pages when filters are off.
|
154 |
+
* New: Add a filter to allow dropdown arguments to be modified.
|
155 |
+
* Fix: General code cleanup.
|
156 |
+
|
157 |
+
= 1.5.2: November 25, 2014 =
|
158 |
+
|
159 |
+
* Tweak: Turn off region dropdown for new installs.
|
160 |
+
|
161 |
+
= 1.5.1: October 13, 2014 =
|
162 |
+
|
163 |
+
* Fix: Properly unset location input to avoid polluted query.
|
164 |
+
|
165 |
+
= 1.5.0: September 9, 2014 =
|
166 |
+
|
167 |
+
* New: Regions can now be used to filter listings instead of the standard location text field.
|
168 |
+
|
169 |
+
= 1.4.0: May 22, 2014 =
|
170 |
+
|
171 |
+
* New: Use a custom template so the select box can have hierarchy.
|
172 |
+
|
173 |
+
= 1.3.1: January 20, 2014 =
|
174 |
+
|
175 |
+
* Fix: Avoid priority conflict with existing fields.
|
176 |
+
|
177 |
+
= 1.3: August 13, 2013 =
|
178 |
+
|
179 |
+
* Fix: Update wp-job-manager-locations.php
|
180 |
+
|
181 |
+
= 1.2: July 28, 2013 =
|
182 |
+
|
183 |
+
* Fix: Make sure the taxononmy is properly added.
|
184 |
+
* Fix: Don't error if the plugin is activated, but no term is added via the backend
|
185 |
+
|
186 |
+
= 1.1: July 27, 2013 =
|
187 |
+
|
188 |
+
* New: Simple regions list output.
|
189 |
+
|
190 |
+
= 1.0: July 26, 2013 =
|
191 |
+
|
192 |
+
* First official release!
|
uninstall.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
3 |
-
exit();
|
4 |
-
}
|
5 |
-
|
6 |
-
$options = array(
|
7 |
-
'job_manager_regions_filter'
|
8 |
-
);
|
9 |
-
|
10 |
-
foreach ( $options as $option ) {
|
11 |
-
delete_option( $option );
|
12 |
-
}
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
3 |
+
exit();
|
4 |
+
}
|
5 |
+
|
6 |
+
$options = array(
|
7 |
+
'job_manager_regions_filter'
|
8 |
+
);
|
9 |
+
|
10 |
+
foreach ( $options as $option ) {
|
11 |
+
delete_option( $option );
|
12 |
+
}
|
wp-job-manager-locations.php
CHANGED
@@ -1,404 +1,404 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Regions for WP Job Manager
|
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.17.
|
9 |
-
* Text Domain: wp-job-manager-locations
|
10 |
-
* Domain Path: /languages
|
11 |
-
*/
|
12 |
-
|
13 |
-
// Exit if accessed directly
|
14 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
-
|
16 |
-
class Astoundify_Job_Manager_Regions {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @var $instance
|
20 |
-
*/
|
21 |
-
private static $instance;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Make sure only one instance is only running.
|
25 |
-
*/
|
26 |
-
public static function instance() {
|
27 |
-
if ( ! isset ( self::$instance ) ) {
|
28 |
-
self::$instance = new self;
|
29 |
-
}
|
30 |
-
|
31 |
-
return self::$instance;
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Start things up.
|
36 |
-
*
|
37 |
-
* @since 1.0.0
|
38 |
-
*/
|
39 |
-
public function __construct() {
|
40 |
-
$this->file = __FILE__;
|
41 |
-
$this->basename = plugin_basename( $this->file );
|
42 |
-
$this->plugin_dir = plugin_dir_path( $this->file );
|
43 |
-
$this->plugin_url = set_url_scheme( plugin_dir_url ( $this->file ), is_ssl() ? 'https' : 'http' );
|
44 |
-
$this->lang_dir = trailingslashit( $this->plugin_dir . 'languages' );
|
45 |
-
$this->domain = 'wp-job-manager-locations';
|
46 |
-
|
47 |
-
$files = array(
|
48 |
-
'includes/class-taxonomy.php',
|
49 |
-
'includes/class-template.php',
|
50 |
-
'includes/class-widgets.php'
|
51 |
-
);
|
52 |
-
|
53 |
-
foreach ( $files as $file ) {
|
54 |
-
include_once( $this->plugin_dir . '/' . $file );
|
55 |
-
}
|
56 |
-
|
57 |
-
$this->taxonomy = new Astoundify_Job_Manager_Regions_Taxonomy;
|
58 |
-
$this->template = new Astoundify_Job_Manager_Regions_Template;
|
59 |
-
|
60 |
-
$this->setup_actions();
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Setup the default hooks and actions
|
65 |
-
*
|
66 |
-
* @since 1.0.0
|
67 |
-
*
|
68 |
-
* @return void
|
69 |
-
*/
|
70 |
-
private function setup_actions() {
|
71 |
-
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
72 |
-
|
73 |
-
/* Job Manager */
|
74 |
-
add_filter( 'job_manager_settings', array( $this, 'job_manager_settings' ) );
|
75 |
-
|
76 |
-
add_filter( 'job_manager_output_jobs_defaults', array( $this, 'job_manager_output_jobs_defaults' ) );
|
77 |
-
add_filter( 'job_manager_get_listings', array( $this, 'job_manager_get_listings' ), 10, 2 );
|
78 |
-
add_filter( 'job_manager_get_listings_args', array( $this, 'job_manager_get_listings_args' ) );
|
79 |
-
|
80 |
-
add_filter( 'job_feed_args', array( $this, 'job_feed_args' ) );
|
81 |
-
|
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 |
-
/**
|
91 |
-
* Add settings fields to select the appropriate form for each listing type.
|
92 |
-
*
|
93 |
-
* @since WP Job Manager - Predefiend Regions 1.4.1
|
94 |
-
*
|
95 |
-
* @return void
|
96 |
-
*/
|
97 |
-
public function job_manager_settings( $settings ) {
|
98 |
-
$settings[ 'job_listings' ][1][] = array(
|
99 |
-
'name' => 'job_manager_enable_regions_filter',
|
100 |
-
'std' => '1',
|
101 |
-
'label' => __( 'Filter Location Display', 'wp-job-manager-locations' ),
|
102 |
-
'cb_label' => __( 'Display Region', 'wp-job-manager-locations' ),
|
103 |
-
'desc' => __( 'Replace the entered address with the selected region on output.', 'wp-job-manager-locations' ),
|
104 |
-
'type' => 'checkbox'
|
105 |
-
);
|
106 |
-
$settings[ 'job_listings' ][1][] = array(
|
107 |
-
'name' => 'job_manager_regions_filter',
|
108 |
-
'std' => '0',
|
109 |
-
'label' => __( 'Search by Region', 'wp-job-manager-locations' ),
|
110 |
-
'cb_label' => __( 'Search by Region', 'wp-job-manager-locations' ),
|
111 |
-
'desc' => __( 'Use a dropdown of defined regions instead of a text input. Disables radius search.', 'wp-job-manager-locations' ),
|
112 |
-
'type' => 'checkbox'
|
113 |
-
);
|
114 |
-
|
115 |
-
return $settings;
|
116 |
-
}
|
117 |
-
|
118 |
-
public function resume_manager_settings( $settings ) {
|
119 |
-
$settings[ 'resume_listings' ][1][] = array(
|
120 |
-
'name' => 'resume_manager_enable_regions_filter',
|
121 |
-
'std' => '1',
|
122 |
-
'label' => __( 'Filter Location Display', 'wp-job-manager-locations' ),
|
123 |
-
'cb_label' => __( 'Display Region', 'wp-job-manager-locations' ),
|
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 |
-
}
|
138 |
-
|
139 |
-
/**
|
140 |
-
* Modify the default shortcode attributes for displaying listings.
|
141 |
-
*
|
142 |
-
* If we are on a listing region term archive set the selected_region so
|
143 |
-
* we can preselect the dropdown value. This is needed when filtering by region.
|
144 |
-
*/
|
145 |
-
public function job_manager_output_jobs_defaults( $defaults ) {
|
146 |
-
$defaults[ 'selected_region' ] = '';
|
147 |
-
|
148 |
-
if ( is_tax( 'job_listing_region' ) ) {
|
149 |
-
$type = get_queried_object();
|
150 |
-
|
151 |
-
if ( ! $type ) {
|
152 |
-
return $defaults;
|
153 |
-
}
|
154 |
-
|
155 |
-
$defaults[ 'show_categories' ] = true;
|
156 |
-
$defaults[ 'selected_region' ] = $type->term_id;
|
157 |
-
}
|
158 |
-
|
159 |
-
return $defaults;
|
160 |
-
}
|
161 |
-
|
162 |
-
public function resume_manager_output_resumes_defaults( $defaults ) {
|
163 |
-
$defaults[ 'selected_region' ] = '';
|
164 |
-
|
165 |
-
if ( is_tax( 'resume_region' ) ) {
|
166 |
-
$type = get_queried_object();
|
167 |
-
|
168 |
-
if ( ! $type ) {
|
169 |
-
return $defaults;
|
170 |
-
}
|
171 |
-
|
172 |
-
$defaults[ 'show_categories' ] = true;
|
173 |
-
$defaults[ 'selected_region' ] = $type->term_id;
|
174 |
-
}
|
175 |
-
|
176 |
-
return $defaults;
|
177 |
-
}
|
178 |
-
|
179 |
-
public function job_manager_get_listings( $query_args, $args ) {
|
180 |
-
$params = array();
|
181 |
-
|
182 |
-
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
183 |
-
|
184 |
-
parse_str( $_REQUEST[ 'form_data' ], $params );
|
185 |
-
|
186 |
-
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
187 |
-
$region = $params[ 'search_region' ];
|
188 |
-
|
189 |
-
if ( is_int( $region ) ) {
|
190 |
-
$region = array( $region );
|
191 |
-
}
|
192 |
-
|
193 |
-
$query_args[ 'tax_query' ][] = array(
|
194 |
-
'taxonomy' => 'job_listing_region',
|
195 |
-
'field' => 'id',
|
196 |
-
'terms' => $region,
|
197 |
-
'operator' => 'IN'
|
198 |
-
);
|
199 |
-
|
200 |
-
add_filter( 'job_manager_get_listings_custom_filter', '__return_true' );
|
201 |
-
add_filter( 'job_manager_get_listings_custom_filter_text', array( $this, 'custom_filter_text' ) );
|
202 |
-
add_filter( 'job_manager_get_listings_custom_filter_rss_args', array( $this, 'custom_filter_rss' ) );
|
203 |
-
}
|
204 |
-
|
205 |
-
} elseif ( isset( $_GET[ 'selected_region' ] ) ) {
|
206 |
-
|
207 |
-
$region = $_GET[ 'selected_region' ];
|
208 |
-
|
209 |
-
if ( is_int( $region ) ) {
|
210 |
-
$region = array( $region );
|
211 |
-
}
|
212 |
-
|
213 |
-
$query_args[ 'tax_query' ][] = array(
|
214 |
-
'taxonomy' => 'job_listing_region',
|
215 |
-
'field' => 'id',
|
216 |
-
'terms' => $region,
|
217 |
-
'operator' => 'IN'
|
218 |
-
);
|
219 |
-
|
220 |
-
} elseif( isset( $args['search_region'] ) ) { // WPJM Alerts support
|
221 |
-
$region = $args[ 'search_region' ];
|
222 |
-
|
223 |
-
if ( is_array( $region ) && empty( $region ) ) {
|
224 |
-
return $query_args;
|
225 |
-
}
|
226 |
-
|
227 |
-
$query_args[ 'tax_query' ][] = array(
|
228 |
-
'taxonomy' => 'job_listing_region',
|
229 |
-
'field' => 'id',
|
230 |
-
'terms' => $region,
|
231 |
-
'operator' => 'IN'
|
232 |
-
);
|
233 |
-
|
234 |
-
}
|
235 |
-
|
236 |
-
return $query_args;
|
237 |
-
}
|
238 |
-
|
239 |
-
public function resume_manager_get_resumes( $query_args, $args ) {
|
240 |
-
$params = array();
|
241 |
-
|
242 |
-
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
243 |
-
|
244 |
-
parse_str( $_REQUEST[ 'form_data' ], $params );
|
245 |
-
|
246 |
-
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
247 |
-
$region = $params[ 'search_region' ];
|
248 |
-
|
249 |
-
if ( is_int( $region ) ) {
|
250 |
-
$region = array( $region );
|
251 |
-
}
|
252 |
-
|
253 |
-
$query_args[ 'tax_query' ][] = array(
|
254 |
-
'taxonomy' => 'resume_region',
|
255 |
-
'field' => 'id',
|
256 |
-
'terms' => $region,
|
257 |
-
'operator' => 'IN'
|
258 |
-
);
|
259 |
-
|
260 |
-
add_filter( 'resume_manager_get_resumes_custom_filter', '__return_true' );
|
261 |
-
add_filter( 'resume_manager_get_resumes_custom_filter_text', array( $this, 'resume_custom_filter_text' ) );
|
262 |
-
}
|
263 |
-
|
264 |
-
} elseif ( isset( $_GET[ 'selected_region' ] ) ) {
|
265 |
-
|
266 |
-
$region = $_GET[ 'selected_region' ];
|
267 |
-
|
268 |
-
if ( is_int( $region ) ) {
|
269 |
-
$region = array( $region );
|
270 |
-
}
|
271 |
-
|
272 |
-
$query_args[ 'tax_query' ][] = array(
|
273 |
-
'taxonomy' => 'resume_region',
|
274 |
-
'field' => 'id',
|
275 |
-
'terms' => $region,
|
276 |
-
'operator' => 'IN'
|
277 |
-
);
|
278 |
-
|
279 |
-
} elseif( isset( $args['search_region'] ) ) { // WPJM Alerts support
|
280 |
-
$region = $args[ 'search_region' ];
|
281 |
-
|
282 |
-
if ( is_array( $region ) && empty( $region ) ) {
|
283 |
-
return $query_args;
|
284 |
-
}
|
285 |
-
|
286 |
-
$query_args[ 'tax_query' ][] = array(
|
287 |
-
'taxonomy' => 'resume_region',
|
288 |
-
'field' => 'id',
|
289 |
-
'terms' => $region,
|
290 |
-
'operator' => 'IN'
|
291 |
-
);
|
292 |
-
|
293 |
-
}
|
294 |
-
|
295 |
-
return $query_args;
|
296 |
-
}
|
297 |
-
|
298 |
-
/**
|
299 |
-
* Filter the AJAX request to set the search location to null if a region
|
300 |
-
* is being passed as well.
|
301 |
-
*/
|
302 |
-
public function job_manager_get_listings_args( $args ) {
|
303 |
-
$params = array();
|
304 |
-
|
305 |
-
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
306 |
-
|
307 |
-
parse_str( $_REQUEST[ 'form_data' ], $params );
|
308 |
-
|
309 |
-
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
310 |
-
$args[ 'search_location' ] = null;
|
311 |
-
}
|
312 |
-
|
313 |
-
}
|
314 |
-
|
315 |
-
return $args;
|
316 |
-
}
|
317 |
-
|
318 |
-
/**
|
319 |
-
* Filter the AJAX to update the "showing" text.
|
320 |
-
*/
|
321 |
-
public function custom_filter_text( $text ) {
|
322 |
-
$params = array();
|
323 |
-
|
324 |
-
parse_str( $_REQUEST[ 'form_data' ], $params );
|
325 |
-
|
326 |
-
$term = get_term( $params[ 'search_region' ], 'job_listing_region' );
|
327 |
-
|
328 |
-
$text .= sprintf( ' ' . __( 'in %s', 'wp-job-manager-locations' ) . ' ', $term->name );
|
329 |
-
|
330 |
-
return $text;
|
331 |
-
}
|
332 |
-
|
333 |
-
public function resume_custom_filter_text( $text ) {
|
334 |
-
$params = array();
|
335 |
-
|
336 |
-
parse_str( $_REQUEST[ 'form_data' ], $params );
|
337 |
-
|
338 |
-
$term = get_term( $params[ 'search_region' ], 'resume_region' );
|
339 |
-
|
340 |
-
$text .= sprintf( ' ' . __( 'in %s', 'wp-job-manager-locations' ) . ' ', $term->name );
|
341 |
-
|
342 |
-
return $text;
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
* Filter the AJAX request to update the RSS feed URL.
|
347 |
-
*/
|
348 |
-
public function custom_filter_rss( $args ) {
|
349 |
-
$params = array();
|
350 |
-
|
351 |
-
parse_str( $_REQUEST[ 'form_data' ], $params );
|
352 |
-
|
353 |
-
$args[ 'job_region' ] = $params[ 'search_region' ];
|
354 |
-
|
355 |
-
return $args;
|
356 |
-
}
|
357 |
-
|
358 |
-
public function job_feed_args( $query_args ) {
|
359 |
-
$region = isset( $_GET[ 'job_region' ] ) ? $_GET[ 'job_region' ] : false;
|
360 |
-
|
361 |
-
if ( ! $region ) {
|
362 |
-
return $query_args;
|
363 |
-
}
|
364 |
-
|
365 |
-
$region = esc_attr( $region );
|
366 |
-
|
367 |
-
if ( is_int( $region ) ) {
|
368 |
-
$region = array( absint( $region ) );
|
369 |
-
}
|
370 |
-
|
371 |
-
$query_args[ 'tax_query' ][] = array(
|
372 |
-
'taxonomy' => 'job_listing_region',
|
373 |
-
'field' => 'id',
|
374 |
-
'terms' => $region,
|
375 |
-
'operator' => 'IN'
|
376 |
-
);
|
377 |
-
|
378 |
-
return $query_args;
|
379 |
-
}
|
380 |
-
|
381 |
-
/**
|
382 |
-
* Loads the plugin language files
|
383 |
-
*/
|
384 |
-
public function load_textdomain() {
|
385 |
-
$locale = apply_filters( 'plugin_locale', get_locale(), 'wp-job-manager-locations' );
|
386 |
-
load_textdomain( 'wp-job-manager-locations', WP_LANG_DIR . "/wp-job-manager-locations/wp-job-manager-locations-$locale.mo" );
|
387 |
-
load_plugin_textdomain( 'wp-job-manager-locations', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
388 |
-
}
|
389 |
-
}
|
390 |
-
|
391 |
-
/**
|
392 |
-
* Start things up.
|
393 |
-
*
|
394 |
-
* Use this function instead of a global.
|
395 |
-
*
|
396 |
-
* $ajmr = ajmr();
|
397 |
-
*
|
398 |
-
* @since 1.0.0
|
399 |
-
*/
|
400 |
-
function wp_job_manager_regions() {
|
401 |
-
return Astoundify_Job_Manager_Regions::instance();
|
402 |
-
}
|
403 |
-
|
404 |
-
wp_job_manager_regions();
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Regions for WP Job Manager
|
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.17.5
|
9 |
+
* Text Domain: wp-job-manager-locations
|
10 |
+
* Domain Path: /languages
|
11 |
+
*/
|
12 |
+
|
13 |
+
// Exit if accessed directly
|
14 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
+
|
16 |
+
class Astoundify_Job_Manager_Regions {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var $instance
|
20 |
+
*/
|
21 |
+
private static $instance;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Make sure only one instance is only running.
|
25 |
+
*/
|
26 |
+
public static function instance() {
|
27 |
+
if ( ! isset ( self::$instance ) ) {
|
28 |
+
self::$instance = new self;
|
29 |
+
}
|
30 |
+
|
31 |
+
return self::$instance;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Start things up.
|
36 |
+
*
|
37 |
+
* @since 1.0.0
|
38 |
+
*/
|
39 |
+
public function __construct() {
|
40 |
+
$this->file = __FILE__;
|
41 |
+
$this->basename = plugin_basename( $this->file );
|
42 |
+
$this->plugin_dir = plugin_dir_path( $this->file );
|
43 |
+
$this->plugin_url = set_url_scheme( plugin_dir_url ( $this->file ), is_ssl() ? 'https' : 'http' );
|
44 |
+
$this->lang_dir = trailingslashit( $this->plugin_dir . 'languages' );
|
45 |
+
$this->domain = 'wp-job-manager-locations';
|
46 |
+
|
47 |
+
$files = array(
|
48 |
+
'includes/class-taxonomy.php',
|
49 |
+
'includes/class-template.php',
|
50 |
+
'includes/class-widgets.php'
|
51 |
+
);
|
52 |
+
|
53 |
+
foreach ( $files as $file ) {
|
54 |
+
include_once( $this->plugin_dir . '/' . $file );
|
55 |
+
}
|
56 |
+
|
57 |
+
$this->taxonomy = new Astoundify_Job_Manager_Regions_Taxonomy;
|
58 |
+
$this->template = new Astoundify_Job_Manager_Regions_Template;
|
59 |
+
|
60 |
+
$this->setup_actions();
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Setup the default hooks and actions
|
65 |
+
*
|
66 |
+
* @since 1.0.0
|
67 |
+
*
|
68 |
+
* @return void
|
69 |
+
*/
|
70 |
+
private function setup_actions() {
|
71 |
+
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
72 |
+
|
73 |
+
/* Job Manager */
|
74 |
+
add_filter( 'job_manager_settings', array( $this, 'job_manager_settings' ) );
|
75 |
+
|
76 |
+
add_filter( 'job_manager_output_jobs_defaults', array( $this, 'job_manager_output_jobs_defaults' ) );
|
77 |
+
add_filter( 'job_manager_get_listings', array( $this, 'job_manager_get_listings' ), 10, 2 );
|
78 |
+
add_filter( 'job_manager_get_listings_args', array( $this, 'job_manager_get_listings_args' ) );
|
79 |
+
|
80 |
+
add_filter( 'job_feed_args', array( $this, 'job_feed_args' ) );
|
81 |
+
|
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 |
+
/**
|
91 |
+
* Add settings fields to select the appropriate form for each listing type.
|
92 |
+
*
|
93 |
+
* @since WP Job Manager - Predefiend Regions 1.4.1
|
94 |
+
*
|
95 |
+
* @return void
|
96 |
+
*/
|
97 |
+
public function job_manager_settings( $settings ) {
|
98 |
+
$settings[ 'job_listings' ][1][] = array(
|
99 |
+
'name' => 'job_manager_enable_regions_filter',
|
100 |
+
'std' => '1',
|
101 |
+
'label' => __( 'Filter Location Display', 'wp-job-manager-locations' ),
|
102 |
+
'cb_label' => __( 'Display Region', 'wp-job-manager-locations' ),
|
103 |
+
'desc' => __( 'Replace the entered address with the selected region on output.', 'wp-job-manager-locations' ),
|
104 |
+
'type' => 'checkbox'
|
105 |
+
);
|
106 |
+
$settings[ 'job_listings' ][1][] = array(
|
107 |
+
'name' => 'job_manager_regions_filter',
|
108 |
+
'std' => '0',
|
109 |
+
'label' => __( 'Search by Region', 'wp-job-manager-locations' ),
|
110 |
+
'cb_label' => __( 'Search by Region', 'wp-job-manager-locations' ),
|
111 |
+
'desc' => __( 'Use a dropdown of defined regions instead of a text input. Disables radius search.', 'wp-job-manager-locations' ),
|
112 |
+
'type' => 'checkbox'
|
113 |
+
);
|
114 |
+
|
115 |
+
return $settings;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function resume_manager_settings( $settings ) {
|
119 |
+
$settings[ 'resume_listings' ][1][] = array(
|
120 |
+
'name' => 'resume_manager_enable_regions_filter',
|
121 |
+
'std' => '1',
|
122 |
+
'label' => __( 'Filter Location Display', 'wp-job-manager-locations' ),
|
123 |
+
'cb_label' => __( 'Display Region', 'wp-job-manager-locations' ),
|
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 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Modify the default shortcode attributes for displaying listings.
|
141 |
+
*
|
142 |
+
* If we are on a listing region term archive set the selected_region so
|
143 |
+
* we can preselect the dropdown value. This is needed when filtering by region.
|
144 |
+
*/
|
145 |
+
public function job_manager_output_jobs_defaults( $defaults ) {
|
146 |
+
$defaults[ 'selected_region' ] = '';
|
147 |
+
|
148 |
+
if ( is_tax( 'job_listing_region' ) ) {
|
149 |
+
$type = get_queried_object();
|
150 |
+
|
151 |
+
if ( ! $type ) {
|
152 |
+
return $defaults;
|
153 |
+
}
|
154 |
+
|
155 |
+
$defaults[ 'show_categories' ] = true;
|
156 |
+
$defaults[ 'selected_region' ] = $type->term_id;
|
157 |
+
}
|
158 |
+
|
159 |
+
return $defaults;
|
160 |
+
}
|
161 |
+
|
162 |
+
public function resume_manager_output_resumes_defaults( $defaults ) {
|
163 |
+
$defaults[ 'selected_region' ] = '';
|
164 |
+
|
165 |
+
if ( is_tax( 'resume_region' ) ) {
|
166 |
+
$type = get_queried_object();
|
167 |
+
|
168 |
+
if ( ! $type ) {
|
169 |
+
return $defaults;
|
170 |
+
}
|
171 |
+
|
172 |
+
$defaults[ 'show_categories' ] = true;
|
173 |
+
$defaults[ 'selected_region' ] = $type->term_id;
|
174 |
+
}
|
175 |
+
|
176 |
+
return $defaults;
|
177 |
+
}
|
178 |
+
|
179 |
+
public function job_manager_get_listings( $query_args, $args ) {
|
180 |
+
$params = array();
|
181 |
+
|
182 |
+
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
183 |
+
|
184 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
185 |
+
|
186 |
+
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
187 |
+
$region = $params[ 'search_region' ];
|
188 |
+
|
189 |
+
if ( is_int( $region ) ) {
|
190 |
+
$region = array( $region );
|
191 |
+
}
|
192 |
+
|
193 |
+
$query_args[ 'tax_query' ][] = array(
|
194 |
+
'taxonomy' => 'job_listing_region',
|
195 |
+
'field' => 'id',
|
196 |
+
'terms' => $region,
|
197 |
+
'operator' => 'IN'
|
198 |
+
);
|
199 |
+
|
200 |
+
add_filter( 'job_manager_get_listings_custom_filter', '__return_true' );
|
201 |
+
add_filter( 'job_manager_get_listings_custom_filter_text', array( $this, 'custom_filter_text' ) );
|
202 |
+
add_filter( 'job_manager_get_listings_custom_filter_rss_args', array( $this, 'custom_filter_rss' ) );
|
203 |
+
}
|
204 |
+
|
205 |
+
} elseif ( isset( $_GET[ 'selected_region' ] ) ) {
|
206 |
+
|
207 |
+
$region = $_GET[ 'selected_region' ];
|
208 |
+
|
209 |
+
if ( is_int( $region ) ) {
|
210 |
+
$region = array( $region );
|
211 |
+
}
|
212 |
+
|
213 |
+
$query_args[ 'tax_query' ][] = array(
|
214 |
+
'taxonomy' => 'job_listing_region',
|
215 |
+
'field' => 'id',
|
216 |
+
'terms' => $region,
|
217 |
+
'operator' => 'IN'
|
218 |
+
);
|
219 |
+
|
220 |
+
} elseif( isset( $args['search_region'] ) ) { // WPJM Alerts support
|
221 |
+
$region = $args[ 'search_region' ];
|
222 |
+
|
223 |
+
if ( is_array( $region ) && empty( $region ) ) {
|
224 |
+
return $query_args;
|
225 |
+
}
|
226 |
+
|
227 |
+
$query_args[ 'tax_query' ][] = array(
|
228 |
+
'taxonomy' => 'job_listing_region',
|
229 |
+
'field' => 'id',
|
230 |
+
'terms' => $region,
|
231 |
+
'operator' => 'IN'
|
232 |
+
);
|
233 |
+
|
234 |
+
}
|
235 |
+
|
236 |
+
return $query_args;
|
237 |
+
}
|
238 |
+
|
239 |
+
public function resume_manager_get_resumes( $query_args, $args ) {
|
240 |
+
$params = array();
|
241 |
+
|
242 |
+
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
243 |
+
|
244 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
245 |
+
|
246 |
+
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
247 |
+
$region = $params[ 'search_region' ];
|
248 |
+
|
249 |
+
if ( is_int( $region ) ) {
|
250 |
+
$region = array( $region );
|
251 |
+
}
|
252 |
+
|
253 |
+
$query_args[ 'tax_query' ][] = array(
|
254 |
+
'taxonomy' => 'resume_region',
|
255 |
+
'field' => 'id',
|
256 |
+
'terms' => $region,
|
257 |
+
'operator' => 'IN'
|
258 |
+
);
|
259 |
+
|
260 |
+
add_filter( 'resume_manager_get_resumes_custom_filter', '__return_true' );
|
261 |
+
add_filter( 'resume_manager_get_resumes_custom_filter_text', array( $this, 'resume_custom_filter_text' ) );
|
262 |
+
}
|
263 |
+
|
264 |
+
} elseif ( isset( $_GET[ 'selected_region' ] ) ) {
|
265 |
+
|
266 |
+
$region = $_GET[ 'selected_region' ];
|
267 |
+
|
268 |
+
if ( is_int( $region ) ) {
|
269 |
+
$region = array( $region );
|
270 |
+
}
|
271 |
+
|
272 |
+
$query_args[ 'tax_query' ][] = array(
|
273 |
+
'taxonomy' => 'resume_region',
|
274 |
+
'field' => 'id',
|
275 |
+
'terms' => $region,
|
276 |
+
'operator' => 'IN'
|
277 |
+
);
|
278 |
+
|
279 |
+
} elseif( isset( $args['search_region'] ) ) { // WPJM Alerts support
|
280 |
+
$region = $args[ 'search_region' ];
|
281 |
+
|
282 |
+
if ( is_array( $region ) && empty( $region ) ) {
|
283 |
+
return $query_args;
|
284 |
+
}
|
285 |
+
|
286 |
+
$query_args[ 'tax_query' ][] = array(
|
287 |
+
'taxonomy' => 'resume_region',
|
288 |
+
'field' => 'id',
|
289 |
+
'terms' => $region,
|
290 |
+
'operator' => 'IN'
|
291 |
+
);
|
292 |
+
|
293 |
+
}
|
294 |
+
|
295 |
+
return $query_args;
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Filter the AJAX request to set the search location to null if a region
|
300 |
+
* is being passed as well.
|
301 |
+
*/
|
302 |
+
public function job_manager_get_listings_args( $args ) {
|
303 |
+
$params = array();
|
304 |
+
|
305 |
+
if ( isset( $_REQUEST[ 'form_data' ] ) ) {
|
306 |
+
|
307 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
308 |
+
|
309 |
+
if ( isset( $params[ 'search_region' ] ) && 0 != $params[ 'search_region' ] ) {
|
310 |
+
$args[ 'search_location' ] = null;
|
311 |
+
}
|
312 |
+
|
313 |
+
}
|
314 |
+
|
315 |
+
return $args;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Filter the AJAX to update the "showing" text.
|
320 |
+
*/
|
321 |
+
public function custom_filter_text( $text ) {
|
322 |
+
$params = array();
|
323 |
+
|
324 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
325 |
+
|
326 |
+
$term = get_term( $params[ 'search_region' ], 'job_listing_region' );
|
327 |
+
|
328 |
+
$text .= sprintf( ' ' . __( 'in %s', 'wp-job-manager-locations' ) . ' ', $term->name );
|
329 |
+
|
330 |
+
return $text;
|
331 |
+
}
|
332 |
+
|
333 |
+
public function resume_custom_filter_text( $text ) {
|
334 |
+
$params = array();
|
335 |
+
|
336 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
337 |
+
|
338 |
+
$term = get_term( $params[ 'search_region' ], 'resume_region' );
|
339 |
+
|
340 |
+
$text .= sprintf( ' ' . __( 'in %s', 'wp-job-manager-locations' ) . ' ', $term->name );
|
341 |
+
|
342 |
+
return $text;
|
343 |
+
}
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Filter the AJAX request to update the RSS feed URL.
|
347 |
+
*/
|
348 |
+
public function custom_filter_rss( $args ) {
|
349 |
+
$params = array();
|
350 |
+
|
351 |
+
parse_str( $_REQUEST[ 'form_data' ], $params );
|
352 |
+
|
353 |
+
$args[ 'job_region' ] = $params[ 'search_region' ];
|
354 |
+
|
355 |
+
return $args;
|
356 |
+
}
|
357 |
+
|
358 |
+
public function job_feed_args( $query_args ) {
|
359 |
+
$region = isset( $_GET[ 'job_region' ] ) ? $_GET[ 'job_region' ] : false;
|
360 |
+
|
361 |
+
if ( ! $region ) {
|
362 |
+
return $query_args;
|
363 |
+
}
|
364 |
+
|
365 |
+
$region = esc_attr( $region );
|
366 |
+
|
367 |
+
if ( is_int( $region ) ) {
|
368 |
+
$region = array( absint( $region ) );
|
369 |
+
}
|
370 |
+
|
371 |
+
$query_args[ 'tax_query' ][] = array(
|
372 |
+
'taxonomy' => 'job_listing_region',
|
373 |
+
'field' => 'id',
|
374 |
+
'terms' => $region,
|
375 |
+
'operator' => 'IN'
|
376 |
+
);
|
377 |
+
|
378 |
+
return $query_args;
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Loads the plugin language files
|
383 |
+
*/
|
384 |
+
public function load_textdomain() {
|
385 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), 'wp-job-manager-locations' );
|
386 |
+
load_textdomain( 'wp-job-manager-locations', WP_LANG_DIR . "/wp-job-manager-locations/wp-job-manager-locations-$locale.mo" );
|
387 |
+
load_plugin_textdomain( 'wp-job-manager-locations', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
388 |
+
}
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Start things up.
|
393 |
+
*
|
394 |
+
* Use this function instead of a global.
|
395 |
+
*
|
396 |
+
* $ajmr = ajmr();
|
397 |
+
*
|
398 |
+
* @since 1.0.0
|
399 |
+
*/
|
400 |
+
function wp_job_manager_regions() {
|
401 |
+
return Astoundify_Job_Manager_Regions::instance();
|
402 |
+
}
|
403 |
+
|
404 |
+
wp_job_manager_regions();
|