ACF_Field_User::get_result()publicACF 5.0.0

Returns the result text for a fiven WP_User object.

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

Хуки из метода

Возвращает

Строку.

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

$ACF_Field_User = new ACF_Field_User();
$ACF_Field_User->get_result( $user, $field, $post_id );
$user(WP_User) (обязательный)
The WP_User object.
$field(массив) (обязательный)
The ACF field related to this query.
$post_id((int|string))
The post_id being edited.

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

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

Код ACF_Field_User::get_result() ACF 5.10.2

function get_result( $user, $field, $post_id = 0 ) {

	// Get user result item.
	$item = acf_get_user_result( $user );

	// Default $post_id to current post being edited.
	$post_id = $post_id ? $post_id : acf_get_form_data( 'post_id' );

	/**
	 * Filters the result text.
	 *
	 * @date    21/5/19
	 * @since   5.8.1
	 *
	 * @param   array $args The query args.
	 * @param   array $field The ACF field related to this query.
	 * @param   (int|string) $post_id The post_id being edited.
	 */
	return apply_filters( 'acf/fields/user/result', $item['text'], $user, $field, $post_id );
}