Contact Listing for WP Job Manager - Version 1.0.4

Version Description

Download this release

Release Info

Developer adampickering
Plugin Icon wp plugin Contact Listing for WP Job Manager
Version 1.0.4
Comparing to
See all releases

Code changes from version 1.0.3.1 to 1.0.4

includes/class-wp-job-manager-contact-listing-form.php CHANGED
@@ -7,21 +7,13 @@
7
  *
8
  * @return void
9
  */
10
- abstract class Astoundify_Job_Manager_Contact_Listing_Form extends Astoundify_Job_Manager_Contact_Listing {
11
 
12
  /**
13
  * @var $jobs_form_id
14
  */
15
  public $forms;
16
 
17
- /**
18
- * Form-specific methods
19
- */
20
- abstract protected function setup_actions();
21
- abstract protected function get_forms();
22
- abstract protected function output_form($form);
23
- abstract protected function notification_email($arg1, $arg2, $arg3);
24
-
25
  /**
26
  * Set the form values, remove the default application template
27
  * and attach our own. Call and of the children's special actions.
@@ -53,7 +45,10 @@ abstract class Astoundify_Job_Manager_Contact_Listing_Form extends Astoundify_Jo
53
 
54
  // Output the shortcode
55
  remove_action( 'job_manager_application_details_email', array( $job_manager->post_types, 'application_details_email' ) );
56
- add_action( 'job_manager_application_details_email', array( $this, 'job_manager_application_details_email' ) );
 
 
 
57
 
58
  if ( class_exists( 'WP_Resume_Manager' ) ) {
59
  global $resume_manager;
7
  *
8
  * @return void
9
  */
10
+ class Astoundify_Job_Manager_Contact_Listing_Form extends Astoundify_Job_Manager_Contact_Listing {
11
 
12
  /**
13
  * @var $jobs_form_id
14
  */
15
  public $forms;
16
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Set the form values, remove the default application template
19
  * and attach our own. Call and of the children's special actions.
45
 
46
  // Output the shortcode
47
  remove_action( 'job_manager_application_details_email', array( $job_manager->post_types, 'application_details_email' ) );
48
+
49
+ if ( ! get_option( 'resume_manager_force_application' ) ) {
50
+ add_action( 'job_manager_application_details_email', array( $this, 'job_manager_application_details_email' ) );
51
+ }
52
 
53
  if ( class_exists( 'WP_Resume_Manager' ) ) {
54
  global $resume_manager;
includes/forms/ninjaforms.php CHANGED
@@ -28,7 +28,7 @@ class Astoundify_Job_Manager_Contact_Listing_Form_NinjaForms extends Astoundify_
28
  */
29
  public function setup_actions() {
30
  add_action( 'job_manager_contact_listing_form_ninjaforms', array( $this, 'output_form' ) );
31
- add_action( 'ninja_forms_email_admin', array( $this, 'notification_email' ), 10, 3 );
32
  }
33
 
34
  /**
@@ -51,7 +51,17 @@ class Astoundify_Job_Manager_Contact_Listing_Form_NinjaForms extends Astoundify_
51
  *
52
  * @return string The email to notify.
53
  */
54
- public function notification_email($one = null, $two = null, $three = null) {
 
 
 
 
 
 
 
 
 
 
55
  global $ninja_forms_processing;
56
 
57
  $form_id = $ninja_forms_processing->get_form_ID();
@@ -69,30 +79,17 @@ class Astoundify_Job_Manager_Contact_Listing_Form_NinjaForms extends Astoundify_
69
 
70
  $object = get_post( $ninja_forms_processing->get_field_value( $field_id ) );
71
 
72
- if ( ! array_search( $form_id, $this->forms[ $object->post_type ] ) ) {
73
- return;
74
  }
75
 
76
- $this->_proper_ninja_email = $object->_application ? $object->_application : $object->_candidate_email;
77
-
78
- add_filter( 'wp_mail', array( $this, 'proper_email' ) );
79
- }
80
-
81
- /**
82
- * @missing
83
- *
84
- * @since WP Job Manager - Contact Listing 1.0.0
85
- *
86
- * @return $mail
87
- */
88
- public function proper_email( $mail ) {
89
- if ( filter_var( $this->_proper_ninja_email, FILTER_VALIDATE_EMAIL ) ) {
90
- $mail[ 'to' ] = $this->_proper_ninja_email;
91
  }
92
 
93
- remove_filter( 'wp_mail', array( $this, 'proper_email' ) );
94
 
95
- return $mail;
96
  }
97
 
98
  /**
28
  */
29
  public function setup_actions() {
30
  add_action( 'job_manager_contact_listing_form_ninjaforms', array( $this, 'output_form' ) );
31
+ add_filter( 'nf_email_notification_process_setting', array( $this, 'notification_email' ), 10, 3 );
32
  }
33
 
34
  /**
51
  *
52
  * @return string The email to notify.
53
  */
54
+ public function notification_email( $setting, $setting_name, $id ) {
55
+ if ( 'to' != $setting_name ) {
56
+ return $setting;
57
+ }
58
+
59
+ $fake = array_search( 'no-reply@listingowner.com', $setting );
60
+
61
+ if ( false === $fake ) {
62
+ return $setting;
63
+ }
64
+
65
  global $ninja_forms_processing;
66
 
67
  $form_id = $ninja_forms_processing->get_form_ID();
79
 
80
  $object = get_post( $ninja_forms_processing->get_field_value( $field_id ) );
81
 
82
+ if ( ! is_a( $object, 'WP_Post' ) ) {
83
+ return $setting;
84
  }
85
 
86
+ if ( ! array_search( $form_id, $this->forms[ $object->post_type ] ) ) {
87
+ return $setting;
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
89
 
90
+ $setting[ $fake ] = $object->_application ? $object->_application : $object->_candidate_email;
91
 
92
+ return $setting;
93
  }
94
 
95
  /**
readme.txt CHANGED
@@ -3,11 +3,11 @@
3
  Author URI: http://astoundify.com
4
  Plugin URI: https://wordpress.org/plugins/wp-job-manager-contact-listing/
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=contact@appthemer.com&item_name=Donation+for+Astoundify WP Job Manager Contact Listing
6
- Contributors: spencerfinnell
7
  Tags: job, job listing, job apply, gravity forms, wp job manager, gravity forms, gravityforms, ninja forms, ninjaforms, contact form 7, cf7
8
- Requires at least: 3.5
9
- Tested up to: 3.9.1
10
- Stable Tag: 1.0.3.1
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -25,7 +25,7 @@ Sites using the [WP Job Manager](http://wordpress.org/plugins/wp-job-manager/) p
25
 
26
  = Where can I use this? =
27
 
28
- Astoundify has released the first fully integrated WP Job Manager theme. Check out ["Jobify"](http://themeforest.net/item/jobify-job-board-wordpress-theme/5247604?ref=Astoundify)
29
 
30
  The plugin can also be used on any theme but no extra styling (outside the CSS that comes with the form plugins) is used.
31
 
@@ -42,7 +42,7 @@ You **must** create a *hidden* field with the following specific settings:
42
 
43
  The Job/Resume listing must also have an email address associated with it, not a URL to a website.
44
 
45
- **Next**, create a new form notification with the "Send To" field set to "Email" and "no-reply@listingowner.com" as the value.
46
 
47
  = What settings do I need for Ninja Forms? =
48
 
@@ -55,7 +55,7 @@ You **must** create a *hidden* field with the following specific settings:
55
 
56
  The Job/Resume listing must also have an email address associated with it, not a URL to a website.
57
 
58
- In "Administrator Email Settings" add a *dummy* email address as the first email to send a notification to. You can add real email addresses under this if you do need an actual admin confirmation.
59
 
60
  = What settings do I need for Contact Form 7? =
61
 
@@ -75,6 +75,10 @@ If you have purchased Jobify and still have questions, please post on our dedica
75
 
76
  == Changelog ==
77
 
 
 
 
 
78
  = 1.0.3.1: August 12, 2014 =
79
 
80
  * Fix: Make sure Ninja Forms add_action() abstract doesn't fail.
3
  Author URI: http://astoundify.com
4
  Plugin URI: https://wordpress.org/plugins/wp-job-manager-contact-listing/
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=contact@appthemer.com&item_name=Donation+for+Astoundify WP Job Manager Contact Listing
6
+ Contributors: Astoundify, SpencerFinnell
7
  Tags: job, job listing, job apply, gravity forms, wp job manager, gravity forms, gravityforms, ninja forms, ninjaforms, contact form 7, cf7
8
+ Requires at least: 3.6
9
+ Tested up to: 4.1
10
+ Stable Tag: 1.0.4
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
13
 
25
 
26
  = Where can I use this? =
27
 
28
+ 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)
29
 
30
  The plugin can also be used on any theme but no extra styling (outside the CSS that comes with the form plugins) is used.
31
 
42
 
43
  The Job/Resume listing must also have an email address associated with it, not a URL to a website.
44
 
45
+ **Next**, create a new form notification with the "Send To" field set to "Email" and "no-reply@listingowner.com" as the value. Fill the body with the information you want to send to the listing owner.
46
 
47
  = What settings do I need for Ninja Forms? =
48
 
55
 
56
  The Job/Resume listing must also have an email address associated with it, not a URL to a website.
57
 
58
+ **Next**, create a new form *email* notification with the "To" field set to "no-reply@listingowner.com". Fill the body with the information you want to send to the listing owner.
59
 
60
  = What settings do I need for Contact Form 7? =
61
 
75
 
76
  == Changelog ==
77
 
78
+ = 1.0.4: September 16, 2014 =
79
+
80
+ * Fix: Compatibility with Ninja Forms 2.8.0+ notification system. Please review the README and documentation for changes needed.
81
+
82
  = 1.0.3.1: August 12, 2014 =
83
 
84
  * Fix: Make sure Ninja Forms add_action() abstract doesn't fail.
wp-job-manager-contact-listing.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Contact job listings or resume listings with your choice of Gravity Forms, Ninja Forms, or Contact Form 7
6
  * Author: Astoundify
7
  * Author URI: http://astoundify.com
8
- * Version: 1.0.3.1
9
  * Text Domain: wp-job-manager-contact-listing
10
  */
11
 
5
  * Description: Contact job listings or resume listings with your choice of Gravity Forms, Ninja Forms, or Contact Form 7
6
  * Author: Astoundify
7
  * Author URI: http://astoundify.com
8
+ * Version: 1.0.4
9
  * Text Domain: wp-job-manager-contact-listing
10
  */
11