WordPress at a glance
функция не описана

wpdb::process_fields() protected WP 4.2.0

Processes arrays of field/value pairs and field formats.

This is a helper method for wpdb's CRUD methods, which take field/value pairs for inserts, updates, and where clauses. This method first pairs each value with a format. Then it determines the charset of that field, using that to determine if any invalid text would be stripped. If text is stripped, then field processing is rejected and the query fails.

It's a method of the class: wpdb{}

Хуков нет.

Возвращает

Array/false. An array of fields that contain paired value and formats. False for invalid values.

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

// protected - for code of main (parent) or child class
$result = $this->process_fields( $table, $data, $format );
$table(string) (required)
Table name.
$data(array) (required)
Field/value pair.
$format(mixed) (required)
Format for each field.

Changelog

Since 4.2.0 Introduced.

Код wpdb::process_fields() WP 5.5.1

<?php
protected function process_fields( $table, $data, $format ) {
	$data = $this->process_field_formats( $data, $format );
	if ( false === $data ) {
		return false;
	}

	$data = $this->process_field_charsets( $data, $table );
	if ( false === $data ) {
		return false;
	}

	$data = $this->process_field_lengths( $data, $table );
	if ( false === $data ) {
		return false;
	}

	$converted_data = $this->strip_invalid_text( $data );

	if ( $data !== $converted_data ) {
		return false;
	}

	return $data;
}