WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
функция не описана

WPCF7_Submission::setup_posted_data() private CF7 1.0

{} Это метод класса: WPCF7_Submission{}

Хуки из метода
Возвращает

null. Ничего.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->setup_posted_data();

Код WPCF7_Submission::setup_posted_data() CF7 5.4.1

<?php
private function setup_posted_data() {
	$posted_data = array_filter( (array) $_POST, function( $key ) {
		return '_' !== substr( $key, 0, 1 );
	}, ARRAY_FILTER_USE_KEY );

	$posted_data = wp_unslash( $posted_data );
	$posted_data = $this->sanitize_posted_data( $posted_data );

	$tags = $this->contact_form->scan_form_tags();

	foreach ( (array) $tags as $tag ) {
		if ( empty( $tag->name ) ) {
			continue;
		}

		$type = $tag->type;
		$name = $tag->name;
		$pipes = $tag->pipes;

		if ( wpcf7_form_tag_supports( $type, 'do-not-store' ) ) {
			unset( $posted_data[$name] );
			continue;
		}

		$value_orig = $value = '';

		if ( isset( $posted_data[$name] ) ) {
			$value_orig = $value = $posted_data[$name];
		}

		if ( WPCF7_USE_PIPE
		and $pipes instanceof WPCF7_Pipes
		and ! $pipes->zero() ) {
			if ( is_array( $value_orig ) ) {
				$value = array();

				foreach ( $value_orig as $v ) {
					$value[] = $pipes->do_pipe( $v );
				}
			} else {
				$value = $pipes->do_pipe( $value_orig );
			}
		}

		if ( wpcf7_form_tag_supports( $type, 'selectable-values' ) ) {
			$value = (array) $value;

			if ( $tag->has_option( 'free_text' )
			and isset( $posted_data[$name . '_free_text'] ) ) {
				$last_val = array_pop( $value );

				list( $tied_item ) = array_slice(
					WPCF7_USE_PIPE ? $tag->pipes->collect_afters() : $tag->values,
					-1, 1
				);

				$tied_item = html_entity_decode( $tied_item, ENT_QUOTES, 'UTF-8' );

				if ( $last_val === $tied_item ) {
					$value[] = sprintf( '%s %s',
						$last_val,
						$posted_data[$name . '_free_text']
					);
				} else {
					$value[] = $last_val;
				}

				unset( $posted_data[$name . '_free_text'] );
			}
		}

		$value = apply_filters( "wpcf7_posted_data_{$type}", $value,
			$value_orig, $tag );

		$posted_data[$name] = $value;

		if ( $tag->has_option( 'consent_for:storage' )
		and empty( $posted_data[$name] ) ) {
			$this->meta['do_not_store'] = true;
		}
	}

	$this->posted_data = apply_filters( 'wpcf7_posted_data', $posted_data );

	$this->posted_data_hash = wp_hash(
		wpcf7_flat_join( array_merge(
			array(
				$this->get_meta( 'remote_ip' ),
				$this->get_meta( 'remote_port' ),
				$this->get_meta( 'unit_tag' ),
			),
			$this->posted_data
		) ),
		'wpcf7_submission'
	);

	return $this->posted_data;
}