diff --git a/includes/contact-form-functions.php b/includes/contact-form-functions.php index ab27017e..b1ffabf7 100644 --- a/includes/contact-form-functions.php +++ b/includes/contact-form-functions.php @@ -284,8 +284,8 @@ function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) { /** * Saves the contact form data. */ -function wpcf7_save_contact_form( $args = '', $context = 'save' ) { - $args = wp_parse_args( $args, array( +function wpcf7_save_contact_form( $data = '', $context = 'save' ) { + $data = wp_parse_args( $data, array( 'id' => -1, 'title' => null, 'locale' => null, @@ -296,56 +296,56 @@ function wpcf7_save_contact_form( $args = '', $context = 'save' ) { 'additional_settings' => null, ) ); - $args = wp_unslash( $args ); + $data = wp_unslash( $data ); - $args['id'] = (int) $args['id']; + $data['id'] = (int) $data['id']; - if ( -1 == $args['id'] ) { + if ( -1 == $data['id'] ) { $contact_form = WPCF7_ContactForm::get_template(); } else { - $contact_form = wpcf7_contact_form( $args['id'] ); + $contact_form = wpcf7_contact_form( $data['id'] ); } if ( empty( $contact_form ) ) { return false; } - if ( null !== $args['title'] ) { - $contact_form->set_title( $args['title'] ); + if ( null !== $data['title'] ) { + $contact_form->set_title( $data['title'] ); } - if ( null !== $args['locale'] ) { - $contact_form->set_locale( $args['locale'] ); + if ( null !== $data['locale'] ) { + $contact_form->set_locale( $data['locale'] ); } $properties = array(); - if ( null !== $args['form'] ) { - $properties['form'] = wpcf7_sanitize_form( $args['form'] ); + if ( null !== $data['form'] ) { + $properties['form'] = wpcf7_sanitize_form( $data['form'] ); } - if ( null !== $args['mail'] ) { - $properties['mail'] = wpcf7_sanitize_mail( $args['mail'] ); + if ( null !== $data['mail'] ) { + $properties['mail'] = wpcf7_sanitize_mail( $data['mail'] ); $properties['mail']['active'] = true; } - if ( null !== $args['mail_2'] ) { - $properties['mail_2'] = wpcf7_sanitize_mail( $args['mail_2'] ); + if ( null !== $data['mail_2'] ) { + $properties['mail_2'] = wpcf7_sanitize_mail( $data['mail_2'] ); } - if ( null !== $args['messages'] ) { - $properties['messages'] = wpcf7_sanitize_messages( $args['messages'] ); + if ( null !== $data['messages'] ) { + $properties['messages'] = wpcf7_sanitize_messages( $data['messages'] ); } - if ( null !== $args['additional_settings'] ) { + if ( null !== $data['additional_settings'] ) { $properties['additional_settings'] = wpcf7_sanitize_additional_settings( - $args['additional_settings'] + $data['additional_settings'] ); } $contact_form->set_properties( $properties ); - do_action( 'wpcf7_save_contact_form', $contact_form, $args, $context ); + do_action( 'wpcf7_save_contact_form', $contact_form, $data, $context ); if ( 'save' == $context ) { $contact_form->save();