diff --git a/includes/contact-form.php b/includes/contact-form.php index 445f6702..7a0ca77e 100644 --- a/includes/contact-form.php +++ b/includes/contact-form.php @@ -517,11 +517,11 @@ public function is_posted() { /** * Generates HTML that represents a form. * - * @param string|array $args Optional. Form options. + * @param string|array $options Optional. Form options. * @return string HTML output. */ - public function form_html( $args = '' ) { - $args = wp_parse_args( $args, array( + public function form_html( $options = '' ) { + $options = wp_parse_args( $options, array( 'html_id' => '', 'html_name' => '', 'html_title' => '', @@ -529,9 +529,9 @@ public function form_html( $args = '' ) { 'output' => 'form', ) ); - $this->shortcode_atts = $args; + $this->shortcode_atts = $options; - if ( 'raw_form' == $args['output'] ) { + if ( 'raw_form' == $options['output'] ) { return sprintf( '
%s
', esc_html( $this->prop( 'form' ) ) @@ -596,14 +596,14 @@ public function form_html( $args = '' ) { $html .= "\n" . $this->screen_reader_response() . "\n"; $id_attr = apply_filters( 'wpcf7_form_id_attr', - preg_replace( '/[^A-Za-z0-9:._-]/', '', $args['html_id'] ) + preg_replace( '/[^A-Za-z0-9:._-]/', '', $options['html_id'] ) ); $name_attr = apply_filters( 'wpcf7_form_name_attr', - preg_replace( '/[^A-Za-z0-9:._-]/', '', $args['html_name'] ) + preg_replace( '/[^A-Za-z0-9:._-]/', '', $options['html_name'] ) ); - $title_attr = apply_filters( 'wpcf7_form_title_attr', $args['html_title'] ); + $title_attr = apply_filters( 'wpcf7_form_title_attr', $options['html_title'] ); $class = 'wpcf7-form'; @@ -620,8 +620,8 @@ public function form_html( $args = '' ) { $class .= ' init'; } - if ( $args['html_class'] ) { - $class .= ' ' . $args['html_class']; + if ( $options['html_class'] ) { + $class .= ' ' . $options['html_class']; } if ( $this->in_demo_mode() ) { @@ -964,13 +964,13 @@ public function form_elements() { /** * Collects mail-tags available for this contact form. * - * @param string|array $args Optional. Search options. + * @param string|array $options Optional. Search options. * @return array Mail-tag names. */ - public function collect_mail_tags( $args = '' ) { + public function collect_mail_tags( $options = '' ) { $manager = WPCF7_FormTagsManager::get_instance(); - $args = wp_parse_args( $args, array( + $options = wp_parse_args( $options, array( 'include' => array(), 'exclude' => $manager->collect_tag_types( 'not-for-mail' ), ) ); @@ -983,12 +983,12 @@ public function collect_mail_tags( $args = '' ) { if ( empty( $type ) ) { continue; - } elseif ( ! empty( $args['include'] ) ) { - if ( ! in_array( $type, $args['include'] ) ) { + } elseif ( ! empty( $options['include'] ) ) { + if ( ! in_array( $type, $options['include'] ) ) { continue; } - } elseif ( ! empty( $args['exclude'] ) ) { - if ( in_array( $type, $args['exclude'] ) ) { + } elseif ( ! empty( $options['exclude'] ) ) { + if ( in_array( $type, $options['exclude'] ) ) { continue; } } @@ -1000,7 +1000,7 @@ public function collect_mail_tags( $args = '' ) { $mailtags = array_filter( $mailtags ); $mailtags = array_values( $mailtags ); - return apply_filters( 'wpcf7_collect_mail_tags', $mailtags, $args, $this ); + return apply_filters( 'wpcf7_collect_mail_tags', $mailtags, $options, $this ); } @@ -1046,11 +1046,11 @@ public function suggest_mail_tags( $template_name = 'mail' ) { /** * Submits this contact form. * - * @param string|array $args Optional. Submission options. Default empty. + * @param string|array $options Optional. Submission options. Default empty. * @return array Result of submission. */ - public function submit( $args = '' ) { - $args = wp_parse_args( $args, array( + public function submit( $options = '' ) { + $options = wp_parse_args( $options, array( 'skip_mail' => ( $this->in_demo_mode() || $this->is_true( 'skip_mail' ) @@ -1072,7 +1072,7 @@ public function submit( $args = '' ) { } $submission = WPCF7_Submission::get_instance( $this, array( - 'skip_mail' => $args['skip_mail'], + 'skip_mail' => $options['skip_mail'], ) ); $result = array( @@ -1343,14 +1343,14 @@ public function delete() { /** * Returns a WordPress shortcode for this contact form. */ - public function shortcode( $args = '' ) { - $args = wp_parse_args( $args, array( + public function shortcode( $options = '' ) { + $options = wp_parse_args( $options, array( 'use_old_format' => false ) ); $title = str_replace( array( '"', '[', ']' ), '', $this->title ); - if ( $args['use_old_format'] ) { + if ( $options['use_old_format'] ) { $old_unit_id = (int) get_post_meta( $this->id, '_old_cf7_unit_id', true ); if ( $old_unit_id ) { @@ -1371,7 +1371,7 @@ public function shortcode( $args = '' ) { } return apply_filters( 'wpcf7_contact_form_shortcode', - $shortcode, $args, $this + $shortcode, $options, $this ); } }