acf_field_select::ajax_querypublicACF 5.0.0

AJAX handler for getting Select field choices.

Method of the class: acf_field_select{}

No Hooks.

Returns

null. Nothing (null).

Usage

$acf_field_select = new acf_field_select();
$acf_field_select->ajax_query();

Changelog

Since 5.0.0 Introduced.

acf_field_select::ajax_query() code ACF 6.8.8

public function ajax_query() {
	$nonce = acf_request_arg( 'nonce', '' );
	$key   = acf_request_arg( 'field_key', '' );

	$is_field_key = acf_is_field_key( $key );

	// Back-compat for field settings.
	if ( ! $is_field_key ) {
		if ( ! acf_current_user_can_admin() ) {
			die();
		}

		$nonce = '';
		$key   = '';
	}

	if ( ! acf_verify_ajax( $nonce, $key, $is_field_key, 'select' ) ) {
		die();
	}

	acf_send_ajax_results( $this->get_ajax_query( $_POST ) );
}