Skip to content

Commit

Permalink
version 1.4, fix no conflict mode in Gravity Forms
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Wood committed Apr 18, 2014
1 parent 2afc84e commit dac8152
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ An active form with notifications must be available to In order to add attachme

Note: When WP_DEBUG is active the script will use the unminified version of the script.

### Credits:

Thanks to the following users for making the plugin better!

* @saxonycreative
* @mathijsbok

### Changelog:
#### = 1.4 =

* fixed Gravity Forms from being greedy to remove the js script for plugin no conflict mode (thanks to @saxonycreative)
* tested compatible to WordPress v3.9

#### = 1.3 =

* fixed filter handling for no attachment emails (thanks to @mathijsbok)
Expand Down
20 changes: 18 additions & 2 deletions gf-notification-attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Gravity Forms: Notification Attachments
Plugin URI: http://codearachnid.github.io/gf-notification-attachment/
Description: An addon for Gravity Forms to add attachments to notification emails
Version: 1.3
Version: 1.4
Author: Timothy Wood (@codearachnid)
Author URI: http://codearachnid.com
Text Domain: gf_notification_attachment
Expand All @@ -14,11 +14,13 @@
global $gf_notification_attachment;

add_action( 'init', 'gf_notification_attachment_init' );
add_action( 'wp_ajax_gf_notification_attachment', 'gf_notification_attachment_ajax' );
add_filter('gform_noconflict_scripts', 'gf_notification_attachment_gform_noconflict' );
add_filter( 'gform_notification', 'gf_notification_attachment_send', 20, 3 );
add_filter( 'gform_pre_notification_save', 'gf_notification_attachment_save', 20, 2 );
add_filter( 'gform_notification_ui_settings', 'gf_notification_attachment_editor', 20, 3 );
add_action( 'admin_enqueue_scripts', 'gf_notification_attachment_attach_script');
add_action( 'wp_ajax_gf_notification_attachment', 'gf_notification_attachment_ajax' );


/**
* [gf_notification_attachment_init description]
Expand Down Expand Up @@ -162,3 +164,17 @@ function gf_notification_attachment_attach_script(){
wp_enqueue_style( $plugin->text_domain, $plugin->plugin_url . 'style.css', array(), $plugin->version );
}
}

/**
* [gf_notification_attachment_gform_noconflict description]
* prevent Gravity Forms from being greedy to remove our scripts in no conflict mode
*
* @return array
*/
function gf_notification_attachment_gform_noconflict($allowed_script_keys){
global $gf_notification_attachment;
$plugin = $gf_notification_attachment;
$allowed_script_keys[] = $plugin->text_domain;
return $allowed_script_keys;
}

13 changes: 11 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: codearachnid
Tags: gravityforms, forms, attachment, email, notification
Donate link: http://example.com/
Requires at least: 3.7
Tested up to: 3.8
Stable tag: 1.3
Tested up to: 3.9
Stable tag: 1.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -17,6 +17,11 @@ An active form with notifications must be available to In order to add attachme

This plugin is [actively maintained on GitHub](http://codearachnid.github.io/gf-notification-attachment/). I welcome your pull requests, comments and suggestions for improvement

Thanks to the following users for making the plugin better!

* @saxonycreative
* @mathijsbok

== Installation ==
Installing the plugin is easy. Just follow these steps:

Expand All @@ -36,6 +41,10 @@ When WP_DEBUG is active the script will use the unminified version of the script
1. The plugin adds logic to the notification edit screen.

== Changelog ==
= 1.4 =
* fixed Gravity Forms from being greedy to remove the js script for plugin in no conflict mode (thanks to @saxonycreative)
* tested compatible to WordPress v3.9

= 1.3 =
* fixed filter handling for no attachment emails (thanks to @mathijsbok)

Expand Down

0 comments on commit dac8152

Please sign in to comment.