classes/fields/pick.php
public function build_dfv_autocomplete_ajax_data( $options, $args, $ajax = false ) {

		if ( is_object( $args->pod ) ) {
			$pod_id = (int) $args->pod->pod_id;
		} else {
			$pod_id = 0;
		}

		$field_id = (int) $options['id'];

		$id = (int) $args->id;

		if ( is_user_logged_in() ) {
			$uid = 'user_' . get_current_user_id();
		} else {
			$uid = @session_id();
		}

		$uri_hash = wp_create_nonce( 'pods_uri_' . $_SERVER['REQUEST_URI'] );

		$field_nonce = wp_create_nonce( 'pods_relationship_' . $pod_id . '_' . $uid . '_' . $uri_hash . '_' . $field_id );

		// Values can be overridden via the `pods_field_dfv_data` filter in $data['fieldConfig']['ajax_data'].
		return array(
			'ajax'                 => $ajax,
			'delay'                => 300,
			'minimum_input_length' => 1,
			'pod'                  => $pod_id,
			'field'                => $field_id,
			'id'                   => $id,
			'uri'                  => $uri_hash,
			'_wpnonce'             => $field_nonce,
		);

	}
public function build_dfv_autocomplete_ajax_data( $options, $args, $ajax = false ) {

		if ( is_object( $args->pod ) ) {
			$pod_id = (int) $args->pod->pod_id;
		} else {
			$pod_id = 0;
		}

		$field_id = (int) $options['id'];

		$id = (int) $args->id;

		if ( is_user_logged_in() ) {
			$uid = 'user_' . get_current_user_id();
		} else {
			$uid = @session_id();
		}

		$uri_hash = wp_create_nonce( 'pods_uri_' . $_SERVER['REQUEST_URI'] );

		$field_nonce = wp_create_nonce( 'pods_relationship_' . $pod_id . '_' . $uid . '_' . $uri_hash . '_' . $field_id );

		// Values can be overridden via the `pods_field_dfv_data` filter in $data['fieldConfig']['ajax_data'].
		return array(
			'ajax'                 => $ajax,
			'delay'                => 300,
			'minimum_input_length' => 1,
			'pod'                  => $pod_id,
			'field'                => $field_id,
			'id'                   => $id,
			'uri'                  => $uri_hash,
			'_wpnonce'             => $field_nonce,
		);

	}
public function build_dfv_autocomplete_ajax_data ( $ options , $ args , $ ajax = false ) { if ( is_object ( $ args -> pod ) ) { $ pod_id = ( int ) $ args -> pod -> pod_id ; } else { $ pod_id = 0 ; } $ field_id = ( int ) $ options [ 'id' ] ; $ id = ( int ) $ args -> id ; if ( is_user_logged_in ( ) ) { $ uid = 'user_' . get_current_user_id ( ) ; } else { $ uid = @ session_id ( ) ; } $ uri_hash = wp_create_nonce ( 'pods_uri_' . $ _SERVER [ 'REQUEST_URI' ] ) ; $ field_nonce = wp_create_nonce ( 'pods_relationship_' . $ pod_id . '_' . $ uid . '_' . $ uri_hash . '_' . $ field_id ) ; // Values can be overridden via the `pods_field_dfv_data` filter in $data['fieldConfig']['ajax_data']. return array ( 'ajax' => $ ajax , 'delay' => 300 , 'minimum_input_length' => 1 , 'pod' => $ pod_id , 'field' => $ field_id , 'id' => $ id , 'uri' => $ uri_hash , '_wpnonce' => $ field_nonce , ) ; }
Build DFV autocomplete AJAX data.

@param array  $options DFV options.
@param object $args    {
Field information arguments.

@type string     $name    Field name.
@type string     $type    Field type.
@type array      $options Field options.
@type mixed      $value   Current value.
@type array      $pod     Pod information.
@type int|string $id      Current item ID.
}
@param bool   $ajax    True if ajax mode should be used.

@return array
Build DFV autocomplete AJAX data .