Custom Contact Forms - Version 6.2.2

Version Description

  • Properly conditionally enqueue JS/CSS with SCRIPT_DEBUG
  • Make email message and subject filterable
  • Make tinymce preview inclusion filterable
Download this release

Release Info

Developer tlovett1
Plugin Icon 128x128 Custom Contact Forms
Version 6.2.2
Comparing to
See all releases

Code changes from version 6.2.1 to 6.2.2

classes/class-ccf-form-cpt.php CHANGED
@@ -257,7 +257,7 @@ class CCF_Form_CPT {
257
  }
258
 
259
  public function action_admin_enqueue_scripts() {
260
- if ( ! defined( SCRIPT_DEBUG ) || ! SCRIPT_DEBUG ) {
261
  $admin_css_path = '/build/css/admin.css';
262
  $form_cpt_css_path = '/build/css/form-cpt.css';
263
  $form_table_css_path = '/build/css/form-table.css';
257
  }
258
 
259
  public function action_admin_enqueue_scripts() {
260
+ if ( defined( SCRIPT_DEBUG ) && SCRIPT_DEBUG ) {
261
  $admin_css_path = '/build/css/admin.css';
262
  $form_cpt_css_path = '/build/css/form-cpt.css';
263
  $form_table_css_path = '/build/css/form-table.css';
classes/class-ccf-form-handler.php CHANGED
@@ -542,6 +542,7 @@ class CCF_Form_Handler {
542
  $email_addresses_field = get_post_meta( $form_id, 'ccf_form_email_notification_addresses', true );
543
 
544
  if ( ! empty( $send_email_notifications ) && ! empty( $email_addresses_field ) ) {
 
545
  $email_addresses = explode( ',', $email_addresses_field );
546
  $email_addresses = array_map( 'trim', $email_addresses );
547
 
@@ -592,7 +593,9 @@ class CCF_Form_Handler {
592
  <?php
593
  }
594
 
 
595
  if ( ! empty( $_POST['form_page'] ) ) {
 
596
  ?>
597
  <div>
598
  <?php esc_html_e( 'Form submitted from', 'custom-contact-forms' ); ?>:
@@ -606,7 +609,9 @@ class CCF_Form_Handler {
606
  $headers = array( 'MIME-Version: 1.0', 'Content-type: text/html; charset=iso-8859-1' );
607
 
608
  foreach ( $email_addresses as $email ) {
609
- wp_mail( $email, sprintf( __( '%s: Form Submission to "%s"', 'custom-contact-forms' ), esc_html( get_bloginfo( 'name' ) ), esc_html( get_the_title( $form_id ) ) ), $message, $headers );
 
 
610
  }
611
  }
612
  }
542
  $email_addresses_field = get_post_meta( $form_id, 'ccf_form_email_notification_addresses', true );
543
 
544
  if ( ! empty( $send_email_notifications ) && ! empty( $email_addresses_field ) ) {
545
+ $email_addresses_field = str_replace( ';', ',', $email_addresses_field );
546
  $email_addresses = explode( ',', $email_addresses_field );
547
  $email_addresses = array_map( 'trim', $email_addresses );
548
 
593
  <?php
594
  }
595
 
596
+ $form_page = null;
597
  if ( ! empty( $_POST['form_page'] ) ) {
598
+ $form_page = $_POST['form_page'];
599
  ?>
600
  <div>
601
  <?php esc_html_e( 'Form submitted from', 'custom-contact-forms' ); ?>:
609
  $headers = array( 'MIME-Version: 1.0', 'Content-type: text/html; charset=iso-8859-1' );
610
 
611
  foreach ( $email_addresses as $email ) {
612
+ $subject = sprintf( __( '%s: Form Submission to "%s"', 'custom-contact-forms' ), esc_html( get_bloginfo( 'name' ) ), esc_html( get_the_title( $form_id ) ) );
613
+ $subject = apply_filters( 'ccf_email_subject', $subject, $form_id, $email, $form_page );
614
+ wp_mail( $email, $subject, apply_filters( 'ccf_email_content', $message, $form_id, $email, $form_page ), $headers );
615
  }
616
  }
617
  }
classes/class-ccf-form-manager.php CHANGED
@@ -28,7 +28,11 @@ class CCF_Form_Manager {
28
  * @return string
29
  */
30
  public function filter_mce_css( $css ) {
31
- if ( ! defined( WP_DEBUG ) || ! WP_DEBUG ) {
 
 
 
 
32
  $css_path = '/build/css/form-mce.css';
33
  } else {
34
  $css_path = '/build/css/form-mce.min.css';
@@ -1214,7 +1218,7 @@ class CCF_Form_Manager {
1214
 
1215
  if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
1216
 
1217
- if ( ! defined( WP_DEBUG ) || ! WP_DEBUG ) {
1218
  $js_manager_path = '/build/js/form-manager.js';
1219
  $js_mce_path = '/js/form-mce.js';
1220
  $css_path = '/build/css/form-manager.css';
@@ -1269,7 +1273,7 @@ class CCF_Form_Manager {
1269
 
1270
  wp_enqueue_style( 'ccf-form-manager', plugins_url( $css_path, dirname( __FILE__ ) ) );
1271
 
1272
- if ( 'ccf_form' != get_post_type() ) {
1273
  wp_enqueue_script( 'ccf-form-mce', plugins_url( $js_mce_path, dirname( __FILE__ ) ), array( 'mce-view', 'jquery', 'ccf-form-manager' ), '1.0', true );
1274
  }
1275
  }
28
  * @return string
29
  */
30
  public function filter_mce_css( $css ) {
31
+ if ( ! apply_filters( 'ccf_enable_tinymce_previews', true ) ) {
32
+ return $css;
33
+ }
34
+
35
+ if ( defined( SCRIPT_DEBUG ) && SCRIPT_DEBUG ) {
36
  $css_path = '/build/css/form-mce.css';
37
  } else {
38
  $css_path = '/build/css/form-mce.min.css';
1218
 
1219
  if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
1220
 
1221
+ if ( defined( SCRIPT_DEBUG ) && SCRIPT_DEBUG ) {
1222
  $js_manager_path = '/build/js/form-manager.js';
1223
  $js_mce_path = '/js/form-mce.js';
1224
  $css_path = '/build/css/form-manager.css';
1273
 
1274
  wp_enqueue_style( 'ccf-form-manager', plugins_url( $css_path, dirname( __FILE__ ) ) );
1275
 
1276
+ if ( apply_filters( 'ccf_enable_tinymce_previews', true ) && 'ccf_form' !== get_post_type() ) {
1277
  wp_enqueue_script( 'ccf-form-mce', plugins_url( $js_mce_path, dirname( __FILE__ ) ), array( 'mce-view', 'jquery', 'ccf-form-manager' ), '1.0', true );
1278
  }
1279
  }
classes/class-ccf-form-renderer.php CHANGED
@@ -34,7 +34,7 @@ class CCF_Form_Renderer {
34
  }
35
  }
36
 
37
- if ( ! defined( WP_DEBUG ) || ! WP_DEBUG ) {
38
  $css_form_path = '/build/css/form.css';
39
  $js_path = '/js/form.js';
40
  } else {
@@ -66,7 +66,7 @@ class CCF_Form_Renderer {
66
  'minute' => esc_html__( 'This is not a valid minute.', 'custom-contact-forms' ),
67
  'website' => esc_html__( "This is not a valid URL. URL's must start with http(s)://", 'custom-contact-forms' ),
68
  );
69
- wp_localize_script( 'ccf-form', 'ccfSettings', $localized );
70
  }
71
 
72
  /**
34
  }
35
  }
36
 
37
+ if ( defined( SCRIPT_DEBUG ) && SCRIPT_DEBUG ) {
38
  $css_form_path = '/build/css/form.css';
39
  $js_path = '/js/form.js';
40
  } else {
66
  'minute' => esc_html__( 'This is not a valid minute.', 'custom-contact-forms' ),
67
  'website' => esc_html__( "This is not a valid URL. URL's must start with http(s)://", 'custom-contact-forms' ),
68
  );
69
+ wp_localize_script( 'ccf-form', 'ccfSettings', apply_filters( 'ccf_localized_form_messages', $localized ) );
70
  }
71
 
72
  /**
custom-contact-forms.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://www.taylorlovett.com
5
  * Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
6
  * Author: Taylor Lovett
7
- * Version: 6.2.1
8
  * Author URI: http://www.taylorlovett.com
9
  */
10
 
4
  * Plugin URI: http://www.taylorlovett.com
5
  * Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
6
  * Author: Taylor Lovett
7
+ * Version: 6.2.2
8
  * Author URI: http://www.taylorlovett.com
9
  */
10
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Custom Contact Forms ===
2
  Contributors: tlovett1
3
- Donate link: http://www.taylorlovett.com
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
5
  Requires at least: 3.9
6
  Tested up to: 4.1
7
- Stable tag: 6.2.1
8
 
9
  Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
10
 
@@ -31,7 +31,12 @@ Please refer to [Github](http://github.com/tlovett1/custom-contact-forms) for de
31
 
32
  For questions, feature requests, and support concerning the Custom Contact Forms plugin, please refer to [Github](http://github.com/tlovett1/custom-contact-forms).
33
 
34
- == Changelog ==
 
 
 
 
 
35
 
36
  = 6.2.1 =
37
  * Effectively calculate unique field slug
1
  === Custom Contact Forms ===
2
  Contributors: tlovett1
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HR34W94MM53RQ
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
5
  Requires at least: 3.9
6
  Tested up to: 4.1
7
+ Stable tag: 6.2.2
8
 
9
  Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
10
 
31
 
32
  For questions, feature requests, and support concerning the Custom Contact Forms plugin, please refer to [Github](http://github.com/tlovett1/custom-contact-forms).
33
 
34
+ = Changelog ==
35
+
36
+ = 6.2.2 =
37
+ * Properly conditionally enqueue JS/CSS with SCRIPT_DEBUG
38
+ * Make email message and subject filterable
39
+ * Make tinymce preview inclusion filterable
40
 
41
  = 6.2.1 =
42
  * Effectively calculate unique field slug