get_sub_field()ACF 1.0.3

This function is used inside a 'has_sub_field' while loop to return a sub field value

Хуков нет.

Возвращает

Разное.

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

get_sub_field( $selector, $format_value, $escape_html );
$selector(строка)
The field name or key.
По умолчанию: ''
$format_value(true|false)
Whether or not to format the value as described above.
По умолчанию: true
$escape_html(true|false)
If we're formatting the value, make sure it's also HTML safe.
По умолчанию: false

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

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

Код get_sub_field() ACF 6.4.2

function get_sub_field( $selector = '', $format_value = true, $escape_html = false ) {

	// get sub field
	$sub_field = get_sub_field_object( $selector, $format_value, true, $escape_html );

	// bail early if no sub field
	if ( ! $sub_field ) {
		return false;
	}

	// return
	return $sub_field['value'];
}