WP Job Manager - Version 1.23.1

Version Description

  • Orderby featured should be "menu order, date", not "manu order, title".
  • Remove duplicate data from form_data in filters JS.
  • If index is -1 in filters JS, abort.
Download this release

Release Info

Developer mikejolley
Plugin Icon 128x128 WP Job Manager
Version 1.23.1
Comparing to
See all releases

Code changes from version 1.23.0 to 1.23.1

assets/js/ajax-filters.js CHANGED
@@ -15,6 +15,10 @@ jQuery( document ).ready( function ( $ ) {
15
  var filled = target.data( 'filled' );
16
  var index = $( 'div.job_listings' ).index(this);
17
 
 
 
 
 
18
  if ( xhr[index] ) {
19
  xhr[index].abort();
20
  }
@@ -41,13 +45,13 @@ jQuery( document ).ready( function ( $ ) {
41
  filter_job_type.push( $( this ).val() );
42
  } );
43
 
44
- var categories = form.find( ':input[name^=search_categories], :input[name^=search_categories]' ).map( function () {
45
  return $( this ).val();
46
  } ).get();
47
  var keywords = '';
48
  var location = '';
49
- var $keywords = form.find( ':input[name=search_keywords]' );
50
- var $location = form.find( ':input[name=search_location]' );
51
 
52
  // Workaround placeholder scripts
53
  if ( $keywords.val() !== $keywords.attr( 'placeholder' ) ) {
@@ -71,7 +75,7 @@ jQuery( document ).ready( function ( $ ) {
71
  featured: featured,
72
  filled: filled,
73
  show_pagination: target.data( 'show_pagination' ),
74
- form_data: form.serialize()
75
  };
76
 
77
  } else {
15
  var filled = target.data( 'filled' );
16
  var index = $( 'div.job_listings' ).index(this);
17
 
18
+ if ( index < 0 ) {
19
+ return;
20
+ }
21
+
22
  if ( xhr[index] ) {
23
  xhr[index].abort();
24
  }
45
  filter_job_type.push( $( this ).val() );
46
  } );
47
 
48
+ var categories = form.find( ':input[name^="search_categories"]' ).map( function () {
49
  return $( this ).val();
50
  } ).get();
51
  var keywords = '';
52
  var location = '';
53
+ var $keywords = form.find( ':input[name="search_keywords"]' );
54
+ var $location = form.find( ':input[name="search_location"]' );
55
 
56
  // Workaround placeholder scripts
57
  if ( $keywords.val() !== $keywords.attr( 'placeholder' ) ) {
75
  featured: featured,
76
  filled: filled,
77
  show_pagination: target.data( 'show_pagination' ),
78
+ form_data: form.find(':input').not(':input[name="search_keywords"], :input[name="search_location"], :input[name^="search_categories"], :input[name^="filter_job_type"]').serialize()
79
  };
80
 
81
  } else {
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(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], :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={action:"job_manager_get_listings",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={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){}}})}),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])})})});
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={action:"job_manager_get_listings",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.find(":input").not(':input[name="search_keywords"], :input[name="search_location"], :input[name^="search_categories"], :input[name^="filter_job_type"]').serialize()}}else{var s=h.data("categories"),t=h.data("keywords"),u=h.data("location");s&&(s=s.split(",")),g={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){}}})}}),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.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -142,6 +142,11 @@ You can view (and contribute) translations via the [Transifex project here](http
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
145
  = 1.23.0 =
146
  * Feature - Custom AJAX endpoints to reduce overhead of loading admin.
147
  * Feature - Support radio fields.
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.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
142
 
143
  == Changelog ==
144
 
145
+ = 1.23.1 =
146
+ * Orderby featured should be "menu order, date", not "manu order, title".
147
+ * Remove duplicate data from form_data in filters JS.
148
+ * If index is -1 in filters JS, abort.
149
+
150
  = 1.23.0 =
151
  * Feature - Custom AJAX endpoints to reduce overhead of loading admin.
152
  * Feature - Support radio fields.
wp-job-manager-functions.php CHANGED
@@ -95,7 +95,7 @@ function get_job_listings( $args = array() ) {
95
  if ( 'featured' === $args['orderby'] ) {
96
  $query_args['orderby'] = array(
97
  'menu_order' => 'ASC',
98
- 'title' => 'DESC'
99
  );
100
  }
101
 
95
  if ( 'featured' === $args['orderby'] ) {
96
  $query_args['orderby'] = array(
97
  'menu_order' => 'ASC',
98
+ 'date' => 'DESC'
99
  );
100
  }
101
 
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.0
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.0' );
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
 
@@ -60,6 +60,7 @@ class WP_Job_Manager {
60
  register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), 'flush_rewrite_rules', 15 );
61
 
62
  // Switch theme
 
63
  add_action( 'switch_theme', array( $this->post_types, 'register_post_types' ), 10 );
64
  add_action( 'switch_theme', 'flush_rewrite_rules', 15 );
65
 
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.1
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.1' );
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
 
60
  register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), 'flush_rewrite_rules', 15 );
61
 
62
  // Switch theme
63
+ add_action( 'switch_theme', array( 'WP_Job_Manager_Ajax', 'add_endpoint' ), 10 );
64
  add_action( 'switch_theme', array( $this->post_types, 'register_post_types' ), 10 );
65
  add_action( 'switch_theme', 'flush_rewrite_rules', 15 );
66