WP Job Manager - Version 1.0.3

Version Description

  • Some extra hooks in job-filters.php
  • Added a workaround for scripts which bork placeholders inside the job filters.
Download this release

Release Info

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

Code changes from version 1.0.2 to 1.0.3

assets/js/ajax-filters.js CHANGED
@@ -25,10 +25,22 @@ jQuery(document).ready(function($) {
25
 
26
  var categories = form.find('select[name^=search_categories], input[name^=search_categories]').map(function () { return $(this).val(); }).get();
27
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  var data = {
29
  action: 'job_manager_get_listings',
30
- search_keywords: form.find('input[name=search_keywords]').val(),
31
- search_location: form.find('input[name=search_location]').val(),
32
  search_categories: categories,
33
  filter_job_type: filter_job_type,
34
  per_page: form.find('input[name=per_page]').val(),
25
 
26
  var categories = form.find('select[name^=search_categories], input[name^=search_categories]').map(function () { return $(this).val(); }).get();
27
 
28
+ var keywords = '';
29
+ var location = '';
30
+ var $keywords = form.find('input[name=search_keywords]');
31
+ var $location = form.find('input[name=search_location]');
32
+
33
+ // Workaround placeholder scripts
34
+ if ( $keywords.val() != $keywords.attr( 'placeholder' ) )
35
+ keywords = $keywords.val();
36
+
37
+ if ( $location.val() != $location.attr( 'placeholder' ) )
38
+ location = $location.val();
39
+
40
  var data = {
41
  action: 'job_manager_get_listings',
42
+ search_keywords: keywords,
43
+ search_location: location,
44
  search_categories: categories,
45
  filter_job_type: filter_job_type,
46
  per_page: form.find('input[name=per_page]').val(),
assets/js/ajax-filters.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){function n(n,r,i){var s=i.find(".job_filters"),o=i.find(".showing_jobs"),u=i.find(".job_listings");t&&t.abort();if(r)e(".load_more_jobs",i).addClass("loading");else{e(u).addClass("loading");e("li.job_listing",u).css("visibility","hidden")}var a=new Array;e('input[name="filter_job_type[]"]:checked',s).each(function(){a.push(e(this).val())});var f=s.find("select[name^=search_categories], input[name^=search_categories]").map(function(){return e(this).val()}).get(),l={action:"job_manager_get_listings",search_keywords:s.find("input[name=search_keywords]").val(),search_location:s.find("input[name=search_location]").val(),search_categories:f,filter_job_type:a,per_page:s.find("input[name=per_page]").val(),orderby:s.find("input[name=orderby]").val(),order:s.find("input[name=order]").val(),page:n};t=e.ajax({type:"POST",url:job_manager_ajax_filters.ajax_url,data:l,success:function(t){if(t)try{t.indexOf("<!--WPJM-->")>=0&&(t=t.split("<!--WPJM-->")[1]);t.indexOf("<!--WPJM_END-->")>=0&&(t=t.split("<!--WPJM_END-->")[0]);var s=e.parseJSON(t);s.showing?e(o).show().find("span").html(s.showing):e(o).hide();s.rss?e(o).find(".rss_link").attr("href",s.rss).show():e(o).find(".rss_link").hide();s.html&&(r?e(u).append(s.html):e(u).html(s.html));!s.found_jobs||s.max_num_pages==n?e(".load_more_jobs",i).hide():e(".load_more_jobs",i).show().data("page",n);e(u).removeClass("loading");e(".load_more_jobs",i).removeClass("loading");e("li.job_listing",u).css("visibility","visible")}catch(a){console.log(a)}}})}var t;e("#search_keywords, #search_location, .job_types input, #search_categories").change(function(){var t=e(this).closest("div.job_listings");n(1,!1,t)}).change();e(".showing_jobs .reset").click(function(){var t=e(this).closest("div.job_listings"),r=e(this).closest("form");r.find("input[name=search_keywords]").val("");r.find("input[name=search_location]").val("");r.find("select[name^=search_categories]").val("");e('input[name="filter_job_type[]"]',r).attr("checked","checked");n(1,!1,t);return!1});e(".load_more_jobs").click(function(){var t=e(this).closest("div.job_listings");page=e(this).data("page");page?page=parseInt(page):page=1;e(this).data("page",page+1);n(page+1,!0,t);return!1})});
1
+ jQuery(document).ready(function(e){function n(n,r,i){var s=i.find(".job_filters"),o=i.find(".showing_jobs"),u=i.find(".job_listings");t&&t.abort();if(r)e(".load_more_jobs",i).addClass("loading");else{e(u).addClass("loading");e("li.job_listing",u).css("visibility","hidden")}var a=new Array;e('input[name="filter_job_type[]"]:checked',s).each(function(){a.push(e(this).val())});var f=s.find("select[name^=search_categories], input[name^=search_categories]").map(function(){return e(this).val()}).get(),l="",c="",h=s.find("input[name=search_keywords]"),p=s.find("input[name=search_location]");h.val()!=h.attr("placeholder")&&(l=h.val());p.val()!=p.attr("placeholder")&&(c=p.val());var d={action:"job_manager_get_listings",search_keywords:l,search_location:c,search_categories:f,filter_job_type:a,per_page:s.find("input[name=per_page]").val(),orderby:s.find("input[name=orderby]").val(),order:s.find("input[name=order]").val(),page:n};t=e.ajax({type:"POST",url:job_manager_ajax_filters.ajax_url,data:d,success:function(t){if(t)try{t.indexOf("<!--WPJM-->")>=0&&(t=t.split("<!--WPJM-->")[1]);t.indexOf("<!--WPJM_END-->")>=0&&(t=t.split("<!--WPJM_END-->")[0]);var s=e.parseJSON(t);s.showing?e(o).show().find("span").html(s.showing):e(o).hide();s.rss?e(o).find(".rss_link").attr("href",s.rss).show():e(o).find(".rss_link").hide();s.html&&(r?e(u).append(s.html):e(u).html(s.html));!s.found_jobs||s.max_num_pages==n?e(".load_more_jobs",i).hide():e(".load_more_jobs",i).show().data("page",n);e(u).removeClass("loading");e(".load_more_jobs",i).removeClass("loading");e("li.job_listing",u).css("visibility","visible")}catch(a){console.log(a)}}})}var t;e("#search_keywords, #search_location, .job_types input, #search_categories").change(function(){var t=e(this).closest("div.job_listings");n(1,!1,t)}).change();e(".showing_jobs .reset").click(function(){var t=e(this).closest("div.job_listings"),r=e(this).closest("form");r.find("input[name=search_keywords]").val("");r.find("input[name=search_location]").val("");r.find("select[name^=search_categories]").val("");e('input[name="filter_job_type[]"]',r).attr("checked","checked");n(1,!1,t);return!1});e(".load_more_jobs").click(function(){var t=e(this).closest("div.job_listings");page=e(this).data("page");page?page=parseInt(page):page=1;e(this).data("page",page+1);n(page+1,!0,t);return!1})});
includes/abstracts/abstract-wp-job-manager-form.php CHANGED
@@ -41,11 +41,11 @@ abstract class WP_Job_Manager_Form {
41
  *
42
  * @access public
43
  * @param mixed $key
44
- * @return void
45
  */
46
  public static function get_fields( $key ) {
47
  if ( empty( self::$fields[ $key ] ) )
48
- return;
49
 
50
  $fields = self::$fields[ $key ];
51
 
41
  *
42
  * @access public
43
  * @param mixed $key
44
+ * @return array
45
  */
46
  public static function get_fields( $key ) {
47
  if ( empty( self::$fields[ $key ] ) )
48
+ return array();
49
 
50
  $fields = self::$fields[ $key ];
51
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mike.jol
4
  Tags: job listing, job board, job, jobs, company
5
  Requires at least: 3.5
6
  Tested up to: 3.5
7
- Stable tag: 1.0.2
8
 
9
  Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
10
 
@@ -72,6 +72,10 @@ The manual installation method involves downloading the plugin and uploading it
72
 
73
  == Changelog ==
74
 
 
 
 
 
75
  = 1.0.2 =
76
  * Action in update_job_data() to allow saving of extra fields.
77
  * Added German translation by Chris Penning
4
  Tags: job listing, job board, job, jobs, company
5
  Requires at least: 3.5
6
  Tested up to: 3.5
7
+ Stable tag: 1.0.3
8
 
9
  Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
10
 
72
 
73
  == Changelog ==
74
 
75
+ = 1.0.3 =
76
+ * Some extra hooks in job-filters.php
77
+ * Added a workaround for scripts which bork placeholders inside the job filters.
78
+
79
  = 1.0.2 =
80
  * Action in update_job_data() to allow saving of extra fields.
81
  * Added German translation by Chris Penning
templates/job-filters.php CHANGED
@@ -2,6 +2,8 @@
2
  <form class="job_filters">
3
 
4
  <div class="search_jobs">
 
 
5
  <div class="search_keywords">
6
  <label for="search_keywords"><?php _e( 'Keywords', 'job_manager' ); ?></label>
7
  <input type="text" name="search_keywords" id="search_keywords" placeholder="<?php _e( 'All Jobs', 'job_manager' ); ?>" />
@@ -31,6 +33,8 @@
31
  <input type="hidden" name="per_page" value="<?php echo esc_attr( $per_page ) ; ?>" />
32
  <input type="hidden" name="orderby" value="<?php echo esc_attr( $orderby ) ; ?>" />
33
  <input type="hidden" name="order" value="<?php echo esc_attr( $order ) ; ?>" />
 
 
34
  </div>
35
 
36
  <?php if ( ! is_tax( 'job_listing_type' ) ) : ?>
2
  <form class="job_filters">
3
 
4
  <div class="search_jobs">
5
+ <?php do_action( 'job_manager_job_filters_search_jobs_start' ); ?>
6
+
7
  <div class="search_keywords">
8
  <label for="search_keywords"><?php _e( 'Keywords', 'job_manager' ); ?></label>
9
  <input type="text" name="search_keywords" id="search_keywords" placeholder="<?php _e( 'All Jobs', 'job_manager' ); ?>" />
33
  <input type="hidden" name="per_page" value="<?php echo esc_attr( $per_page ) ; ?>" />
34
  <input type="hidden" name="orderby" value="<?php echo esc_attr( $orderby ) ; ?>" />
35
  <input type="hidden" name="order" value="<?php echo esc_attr( $order ) ; ?>" />
36
+
37
+ <?php do_action( 'job_manager_job_filters_search_jobs_end' ); ?>
38
  </div>
39
 
40
  <?php if ( ! is_tax( 'job_listing_type' ) ) : ?>
wp-job-manager.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Job Manager
4
  Plugin URI: http://mikejolley.com/projects/wp-job-manager/
5
  Description: Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
6
- Version: 1.0.2
7
  Author: Mike Jolley
8
  Author URI: http://mikejolley.com
9
  Requires at least: 3.5
@@ -28,7 +28,7 @@ class WP_Job_Manager {
28
  */
29
  public function __construct() {
30
  // Define constants
31
- define( 'JOB_MANAGER_VERSION', '1.0.2' );
32
  define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
33
  define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
34
 
3
  Plugin Name: WP Job Manager
4
  Plugin URI: http://mikejolley.com/projects/wp-job-manager/
5
  Description: Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
6
+ Version: 1.0.3
7
  Author: Mike Jolley
8
  Author URI: http://mikejolley.com
9
  Requires at least: 3.5
28
  */
29
  public function __construct() {
30
  // Define constants
31
+ define( 'JOB_MANAGER_VERSION', '1.0.3' );
32
  define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
33
  define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
34