Version Description
- Fix - WPML integration with lang.
- Tweak - Improved plugin activation code.
- Tweak - Improved theme switch code.
- Tweak - Search the entire meta field, not just from the start.
- Tweak - Added some debugging code to ajax-filters to display in console.
Download this release
Release Info
Developer | mikejolley |
Plugin | WP Job Manager |
Version | 1.23.3 |
Comparing to | |
See all releases |
Code changes from version 1.23.2 to 1.23.3
- assets/js/ajax-filters.js +17 -2
- assets/js/ajax-filters.min.js +1 -1
- readme.txt +13 -6
- wp-job-manager-functions.php +1 -1
- wp-job-manager.php +17 -14
assets/js/ajax-filters.js
CHANGED
@@ -63,7 +63,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
63 |
}
|
64 |
|
65 |
data = {
|
66 |
-
|
67 |
search_keywords: keywords,
|
68 |
search_location: location,
|
69 |
search_categories: categories,
|
@@ -89,6 +89,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
89 |
}
|
90 |
|
91 |
data = {
|
|
|
92 |
search_categories: categories,
|
93 |
search_keywords: keywords,
|
94 |
search_location: location,
|
@@ -153,7 +154,21 @@ jQuery( document ).ready( function ( $ ) {
|
|
153 |
target.triggerHandler( 'updated_results', result );
|
154 |
|
155 |
} catch ( err ) {
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
}
|
159 |
}
|
63 |
}
|
64 |
|
65 |
data = {
|
66 |
+
lang: job_manager_ajax_filters.lang,
|
67 |
search_keywords: keywords,
|
68 |
search_location: location,
|
69 |
search_categories: categories,
|
89 |
}
|
90 |
|
91 |
data = {
|
92 |
+
lang: job_manager_ajax_filters.lang,
|
93 |
search_categories: categories,
|
94 |
search_keywords: keywords,
|
95 |
search_location: location,
|
154 |
target.triggerHandler( 'updated_results', result );
|
155 |
|
156 |
} catch ( err ) {
|
157 |
+
if ( window.console ) {
|
158 |
+
console.log( err );
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
},
|
163 |
+
error: function ( jqXHR, textStatus, error ) {
|
164 |
+
if ( window.console && 'abort' !== textStatus ) {
|
165 |
+
console.log( textStatus + ': ' + error );
|
166 |
+
}
|
167 |
+
},
|
168 |
+
statusCode: {
|
169 |
+
404: function() {
|
170 |
+
if ( window.console ) {
|
171 |
+
console.log( "Error 404: Ajax Endpoint cannot be reached. Go to Settings > Permalinks and save to resolve." );
|
172 |
}
|
173 |
}
|
174 |
}
|
assets/js/ajax-filters.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(a){function b(b,c){if($supports_html5_history){var e=b.find(".job_filters"),f=a(e).serialize(),g=a("div.job_listings").index(b);window.history.replaceState({id:"job_manager_state",page:c,data:f,index:g},"",d+"#s=1")}}var c=[];a(".job_listings").on("update_results",function(b,d,e,f){var g="",h=a(this),i=h.find(".job_filters"),j=h.find(".showing_jobs"),k=h.find(".job_listings"),l=h.data("per_page"),m=h.data("orderby"),n=h.data("order"),o=h.data("featured"),p=h.data("filled"),q=a("div.job_listings").index(this);if(!(0>q)){if(c[q]&&c[q].abort(),e||(a(k).addClass("loading"),a("li.job_listing, li.no_job_listings_found",k).css("visibility","hidden"),d>1&&1!=h.data("show_pagination")?a(k).before('<a class="load_more_jobs load_previous" href="#"><strong>'+job_manager_ajax_filters.i18n_load_prev_listings+"</strong></a>"):h.find(".load_previous").remove(),h.find(".load_more_jobs").data("page",d)),1==h.data("show_filters")){var r=[];a(':input[name="filter_job_type[]"]:checked, :input[name="filter_job_type[]"][type="hidden"], :input[name="filter_job_type"]',i).each(function(){r.push(a(this).val())});var s=i.find(':input[name^="search_categories"]').map(function(){return a(this).val()}).get(),t="",u="",v=i.find(':input[name="search_keywords"]'),w=i.find(':input[name="search_location"]');v.val()!==v.attr("placeholder")&&(t=v.val()),w.val()!==w.attr("placeholder")&&(u=w.val()),g={
|
1 |
+
jQuery(document).ready(function(a){function b(b,c){if($supports_html5_history){var e=b.find(".job_filters"),f=a(e).serialize(),g=a("div.job_listings").index(b);window.history.replaceState({id:"job_manager_state",page:c,data:f,index:g},"",d+"#s=1")}}var c=[];a(".job_listings").on("update_results",function(b,d,e,f){var g="",h=a(this),i=h.find(".job_filters"),j=h.find(".showing_jobs"),k=h.find(".job_listings"),l=h.data("per_page"),m=h.data("orderby"),n=h.data("order"),o=h.data("featured"),p=h.data("filled"),q=a("div.job_listings").index(this);if(!(0>q)){if(c[q]&&c[q].abort(),e||(a(k).addClass("loading"),a("li.job_listing, li.no_job_listings_found",k).css("visibility","hidden"),d>1&&1!=h.data("show_pagination")?a(k).before('<a class="load_more_jobs load_previous" href="#"><strong>'+job_manager_ajax_filters.i18n_load_prev_listings+"</strong></a>"):h.find(".load_previous").remove(),h.find(".load_more_jobs").data("page",d)),1==h.data("show_filters")){var r=[];a(':input[name="filter_job_type[]"]:checked, :input[name="filter_job_type[]"][type="hidden"], :input[name="filter_job_type"]',i).each(function(){r.push(a(this).val())});var s=i.find(':input[name^="search_categories"]').map(function(){return a(this).val()}).get(),t="",u="",v=i.find(':input[name="search_keywords"]'),w=i.find(':input[name="search_location"]');v.val()!==v.attr("placeholder")&&(t=v.val()),w.val()!==w.attr("placeholder")&&(u=w.val()),g={lang:job_manager_ajax_filters.lang,search_keywords:t,search_location:u,search_categories:s,filter_job_type:r,per_page:l,orderby:m,order:n,page:d,featured:o,filled:p,show_pagination:h.data("show_pagination"),form_data:i.serialize()}}else{var s=h.data("categories"),t=h.data("keywords"),u=h.data("location");s&&(s=s.split(",")),g={lang:job_manager_ajax_filters.lang,search_categories:s,search_keywords:t,search_location:u,per_page:l,orderby:m,order:n,page:d,featured:o,filled:p,show_pagination:h.data("show_pagination")}}c[q]=a.ajax({type:"GET",url:job_manager_ajax_filters.ajax_url+"get_listings",data:g,success:function(b){if(b)try{b.showing?a(j).show().html("<span>"+b.showing+"</span>"+b.showing_links):a(j).hide(),b.showing_all?a(j).addClass("wp-job-manager-showing-all"):a(j).removeClass("wp-job-manager-showing-all"),b.html&&(e&&f?a(k).prepend(b.html):e?a(k).append(b.html):a(k).html(b.html)),1==h.data("show_pagination")?(h.find(".job-manager-pagination").remove(),b.pagination&&h.append(b.pagination)):(!b.found_jobs||b.max_num_pages<=d?a(".load_more_jobs:not(.load_previous)",h).hide():f||a(".load_more_jobs",h).show(),a(".load_more_jobs",h).removeClass("loading"),a("li.job_listing",k).css("visibility","visible")),a(k).removeClass("loading"),h.triggerHandler("updated_results",b)}catch(c){window.console&&console.log(c)}},error:function(a,b,c){window.console&&"abort"!==b&&console.log(b+": "+c)},statusCode:{404:function(){window.console&&console.log("Error 404: Ajax Endpoint cannot be reached. Go to Settings > Permalinks and save to resolve.")}}})}}),a("#search_keywords, #search_location, .job_types :input, #search_categories").change(function(){var c=a(this).closest("div.job_listings");c.triggerHandler("update_results",[1,!1]),b(c,1)}).on("keyup",function(b){13===b.which&&a(this).trigger("change")}),a(".job_filters").on("click",".reset",function(){var c=a(this).closest("div.job_listings"),d=a(this).closest("form");return d.find(':input[name="search_keywords"]').not(':input[type="hidden"]').val(""),d.find(':input[name="search_location"]').not(':input[type="hidden"]').val(""),d.find(':input[name^="search_categories"]').not(':input[type="hidden"]').val(0).trigger("chosen:updated"),a(':input[name="filter_job_type[]"]',d).not(':input[type="hidden"]').attr("checked","checked"),c.triggerHandler("reset"),c.triggerHandler("update_results",[1,!1]),b(c,1),!1}),a(document.body).on("click",".load_more_jobs",function(){var c=a(this).closest("div.job_listings"),d=parseInt(a(this).data("page")||1),e=!1;return a(this).addClass("loading"),a(this).is(".load_previous")?(d-=1,e=!0,1===d?a(this).remove():a(this).data("page",d)):(d+=1,a(this).data("page",d),b(c,d)),c.triggerHandler("update_results",[d,!0,e]),!1}),a("div.job_listings").on("click",".job-manager-pagination a",function(){var c=a(this).closest("div.job_listings"),d=a(this).data("page");return b(c,d),c.triggerHandler("update_results",[d,!1]),a("body, html").animate({scrollTop:c.offset().top},600),!1}),a.isFunction(a.fn.chosen)&&(1==job_manager_ajax_filters.is_rtl&&a('select[name^="search_categories"]').addClass("chosen-rtl"),a('select[name^="search_categories"]').chosen({search_contains:!0})),$supports_html5_history=window.history&&window.history.pushState?!0:!1;var d=document.location.href.split("#")[0];a(window).on("load",function(){a(".job_filters").each(function(){var b=a(this).closest("div.job_listings"),c=b.find(".job_filters"),d=1,e=a("div.job_listings").index(b);if(window.history.state&&window.location.hash){var f=window.history.state;f.id&&"job_manager_state"===f.id&&e==f.index&&(d=f.page,c.deserialize(f.data),c.find(':input[name^="search_categories"]').not(':input[type="hidden"]').trigger("chosen:updated"))}b.triggerHandler("update_results",[d,!1])})})});
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mike.jol
|
|
4 |
Tags: job manager, job listing, job board, job management, job lists, job list, job, jobs, company, hiring, employment, employer, employees, candidate, freelance, internship, job listings, positions, board, application, hiring, listing, manager, recruiting, recruitment, talent
|
5 |
Requires at least: 4.1
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 1.23.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -142,14 +142,21 @@ You can view (and contribute) translations via the [Transifex project here](http
|
|
142 |
|
143 |
== Changelog ==
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
= 1.23.2 =
|
146 |
-
* Send entire form data (listify workaround).
|
147 |
-
* Set is_home false on ajax endpoint (listify workaround).
|
148 |
|
149 |
= 1.23.1 =
|
150 |
-
* Orderby featured should be "menu order, date", not "manu order, title".
|
151 |
-
* Remove duplicate data from form_data in filters JS.
|
152 |
-
* If index is -1 in filters JS, abort.
|
153 |
|
154 |
= 1.23.0 =
|
155 |
* Feature - Custom AJAX endpoints to reduce overhead of loading admin.
|
4 |
Tags: job manager, job listing, job board, job management, job lists, job list, job, jobs, company, hiring, employment, employer, employees, candidate, freelance, internship, job listings, positions, board, application, hiring, listing, manager, recruiting, recruitment, talent
|
5 |
Requires at least: 4.1
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 1.23.3
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
142 |
|
143 |
== Changelog ==
|
144 |
|
145 |
+
= 1.23.3 =
|
146 |
+
* Fix - WPML integration with lang.
|
147 |
+
* Tweak - Improved plugin activation code.
|
148 |
+
* Tweak - Improved theme switch code.
|
149 |
+
* Tweak - Search the entire meta field, not just from the start.
|
150 |
+
* Tweak - Added some debugging code to ajax-filters to display in console.
|
151 |
+
|
152 |
= 1.23.2 =
|
153 |
+
* Fix - Send entire form data (listify workaround).
|
154 |
+
* Fix - Set is_home false on ajax endpoint (listify workaround).
|
155 |
|
156 |
= 1.23.1 =
|
157 |
+
* Fix - Orderby featured should be "menu order, date", not "manu order, title".
|
158 |
+
* Tweak - Remove duplicate data from form_data in filters JS.
|
159 |
+
* Tweak - If index is -1 in filters JS, abort.
|
160 |
|
161 |
= 1.23.0 =
|
162 |
* Feature - Custom AJAX endpoints to reduce overhead of loading admin.
|
wp-job-manager-functions.php
CHANGED
@@ -147,7 +147,7 @@ if ( ! function_exists( 'get_job_listings_keyword_search' ) ) :
|
|
147 |
global $wpdb, $job_manager_keyword;
|
148 |
|
149 |
// Query matching ids to avoid more joins
|
150 |
-
$post_ids = $wpdb->get_col( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value LIKE '" .
|
151 |
$conditions = array();
|
152 |
|
153 |
$conditions[] = "{$wpdb->posts}.post_title LIKE '%" . esc_sql( $job_manager_keyword ) . "%'";
|
147 |
global $wpdb, $job_manager_keyword;
|
148 |
|
149 |
// Query matching ids to avoid more joins
|
150 |
+
$post_ids = $wpdb->get_col( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value LIKE '%" .esc_sql( $job_manager_keyword ) . "%'" );
|
151 |
$conditions = array();
|
152 |
|
153 |
$conditions[] = "{$wpdb->posts}.post_title LIKE '%" . esc_sql( $job_manager_keyword ) . "%'";
|
wp-job-manager.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Job Manager
|
4 |
Plugin URI: https://wpjobmanager.com/
|
5 |
Description: Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
|
6 |
-
Version: 1.23.
|
7 |
Author: Mike Jolley
|
8 |
Author URI: http://mikejolley.com
|
9 |
Requires at least: 4.1
|
@@ -31,7 +31,7 @@ class WP_Job_Manager {
|
|
31 |
*/
|
32 |
public function __construct() {
|
33 |
// Define constants
|
34 |
-
define( 'JOB_MANAGER_VERSION', '1.23.
|
35 |
define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
|
36 |
define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
|
37 |
|
@@ -54,15 +54,12 @@ class WP_Job_Manager {
|
|
54 |
$this->post_types = new WP_Job_Manager_Post_Types();
|
55 |
|
56 |
// Activation - works with symlinks
|
57 |
-
register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), array(
|
58 |
-
register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), array( $this->post_types, 'register_post_types' ), 10 );
|
59 |
-
register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), array( 'WP_Job_Manager_Install', 'install' ), 10 );
|
60 |
-
register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), 'flush_rewrite_rules', 15 );
|
61 |
|
62 |
// Switch theme
|
63 |
-
add_action( '
|
64 |
-
add_action( '
|
65 |
-
add_action( '
|
66 |
|
67 |
// Actions
|
68 |
add_action( 'after_setup_theme', array( $this, 'load_plugin_textdomain' ) );
|
@@ -72,6 +69,16 @@ class WP_Job_Manager {
|
|
72 |
add_action( 'admin_init', array( $this, 'updater' ) );
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
/**
|
76 |
* Handle Updates
|
77 |
*/
|
@@ -111,11 +118,6 @@ class WP_Job_Manager {
|
|
111 |
$ajax_url = WP_Job_Manager_Ajax::get_endpoint();
|
112 |
$ajax_filter_deps = array( 'jquery', 'jquery-deserialize' );
|
113 |
|
114 |
-
// WPML workaround until this is standardized
|
115 |
-
if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
|
116 |
-
$ajax_url = add_query_arg( 'lang', ICL_LANGUAGE_CODE, $ajax_url );
|
117 |
-
}
|
118 |
-
|
119 |
if ( apply_filters( 'job_manager_chosen_enabled', true ) ) {
|
120 |
wp_register_script( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/js/jquery-chosen/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
|
121 |
wp_register_script( 'wp-job-manager-term-multiselect', JOB_MANAGER_PLUGIN_URL . '/assets/js/term-multiselect.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
|
@@ -153,6 +155,7 @@ class WP_Job_Manager {
|
|
153 |
wp_localize_script( 'wp-job-manager-ajax-filters', 'job_manager_ajax_filters', array(
|
154 |
'ajax_url' => $ajax_url,
|
155 |
'is_rtl' => is_rtl() ? 1 : 0,
|
|
|
156 |
'i18n_load_prev_listings' => __( 'Load previous listings', 'wp-job-manager' )
|
157 |
) );
|
158 |
wp_localize_script( 'wp-job-manager-job-dashboard', 'job_manager_job_dashboard', array(
|
3 |
Plugin Name: WP Job Manager
|
4 |
Plugin URI: https://wpjobmanager.com/
|
5 |
Description: Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
|
6 |
+
Version: 1.23.3
|
7 |
Author: Mike Jolley
|
8 |
Author URI: http://mikejolley.com
|
9 |
Requires at least: 4.1
|
31 |
*/
|
32 |
public function __construct() {
|
33 |
// Define constants
|
34 |
+
define( 'JOB_MANAGER_VERSION', '1.23.3' );
|
35 |
define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
|
36 |
define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
|
37 |
|
54 |
$this->post_types = new WP_Job_Manager_Post_Types();
|
55 |
|
56 |
// Activation - works with symlinks
|
57 |
+
register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), array( $this, 'activate' ) );
|
|
|
|
|
|
|
58 |
|
59 |
// Switch theme
|
60 |
+
add_action( 'after_switch_theme', array( 'WP_Job_Manager_Ajax', 'add_endpoint' ), 10 );
|
61 |
+
add_action( 'after_switch_theme', array( $this->post_types, 'register_post_types' ), 11 );
|
62 |
+
add_action( 'after_switch_theme', 'flush_rewrite_rules', 15 );
|
63 |
|
64 |
// Actions
|
65 |
add_action( 'after_setup_theme', array( $this, 'load_plugin_textdomain' ) );
|
69 |
add_action( 'admin_init', array( $this, 'updater' ) );
|
70 |
}
|
71 |
|
72 |
+
/**
|
73 |
+
* Called on plugin activation
|
74 |
+
*/
|
75 |
+
public function activate() {
|
76 |
+
WP_Job_Manager_Ajax::add_endpoint();
|
77 |
+
$this->post_types->register_post_types();
|
78 |
+
WP_Job_Manager_Install::install();
|
79 |
+
flush_rewrite_rules();
|
80 |
+
}
|
81 |
+
|
82 |
/**
|
83 |
* Handle Updates
|
84 |
*/
|
118 |
$ajax_url = WP_Job_Manager_Ajax::get_endpoint();
|
119 |
$ajax_filter_deps = array( 'jquery', 'jquery-deserialize' );
|
120 |
|
|
|
|
|
|
|
|
|
|
|
121 |
if ( apply_filters( 'job_manager_chosen_enabled', true ) ) {
|
122 |
wp_register_script( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/js/jquery-chosen/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
|
123 |
wp_register_script( 'wp-job-manager-term-multiselect', JOB_MANAGER_PLUGIN_URL . '/assets/js/term-multiselect.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
|
155 |
wp_localize_script( 'wp-job-manager-ajax-filters', 'job_manager_ajax_filters', array(
|
156 |
'ajax_url' => $ajax_url,
|
157 |
'is_rtl' => is_rtl() ? 1 : 0,
|
158 |
+
'lang' => defined( 'ICL_LANGUAGE_CODE' ) ? ICL_LANGUAGE_CODE : '', // WPML workaround until this is standardized
|
159 |
'i18n_load_prev_listings' => __( 'Load previous listings', 'wp-job-manager' )
|
160 |
) );
|
161 |
wp_localize_script( 'wp-job-manager-job-dashboard', 'job_manager_job_dashboard', array(
|