acf_form_front::check_submit_form()publicACF 5.5.10

check_submit_form

This function will maybe submit form data

@type    function

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

Хуков нет.

Возвращает

null. Ничего.

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

$acf_form_front = new acf_form_front();
$acf_form_front->check_submit_form();

Список изменений

С версии 5.5.10 Введена.

Код acf_form_front::check_submit_form() ACF 5.10.2

function check_submit_form() {

	// Verify nonce.
	if ( ! acf_verify_nonce( 'acf_form' ) ) {
		return false;
	}

	// Confirm form was submit.
	if ( ! isset( $_POST['_acf_form'] ) ) {
		return false;
	}

	// Load registered form using id.
	$form = $this->get_form( $_POST['_acf_form'] );

	// Fallback to encrypted JSON.
	if ( ! $form ) {
		$form = json_decode( acf_decrypt( $_POST['_acf_form'] ), true );
		if ( ! $form ) {
			return false;
		}
	}

	// Run kses on all $_POST data.
	if ( $form['kses'] && isset( $_POST['acf'] ) ) {
		$_POST['acf'] = wp_kses_post_deep( $_POST['acf'] );
	}

	// Validate data and show errors.
	// Todo: Return WP_Error and show above form, keeping input values.
	acf_validate_save_post( true );

	// Submit form.
	$this->submit_form( $form );
}