Skip to content

Instantly share code, notes, and snippets.

@tomedme
Created May 19, 2010 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomedme/406757 to your computer and use it in GitHub Desktop.
Save tomedme/406757 to your computer and use it in GitHub Desktop.
Wordpress contact-form-7 jQuery 1.4.2 fix
Index: includes/functions.php
===================================================================
--- includes/functions.php (revision 243251)
+++ includes/functions.php (working copy)
@@ -125,6 +125,10 @@
}
function wpcf7_json( $items ) {
+
+ if (function_exists('json_encode'))
+ return json_encode( $items );
+
if ( is_array( $items ) ) {
if ( empty( $items ) )
return 'null';
Index: admin/admin.php
===================================================================
--- admin/admin.php (revision 243251)
+++ admin/admin.php (working copy)
@@ -53,6 +53,9 @@
}
$additional_settings = trim( $_POST['wpcf7-additional-settings'] );
+
+ if (function_exists('json_encode'))
+ $additional_settings = stripslashes($additional_settings);
$query = array();
$query['message'] = ( $contact_form->initial ) ? 'created' : 'saved';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment