acf_render_field_instructions()ACF 5.6.3

Renders the field's instructions.

Хуков нет.

Возвращает

null. Ничего (null).

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

acf_render_field_instructions( $field, $tooltip );
$field(массив) (обязательный)
The field array.
$tooltip(true|false)
If the instructions are being rendered as a tooltip.
По умолчанию: false

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

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

Код acf_render_field_instructions() ACF 6.0.4

function acf_render_field_instructions( $field, $tooltip = false ) {
	if ( $field['instructions'] ) {
		$instructions = acf_esc_html( $field['instructions'] );

		if ( $tooltip ) {
			printf( '<div class="acf-tip"><i tabindex="0" class="acf-icon acf-icon-help acf-js-tooltip" title="%s">?</i></div>', $instructions );
		} else {
			printf( '<p class="description">%s</p>', $instructions );
		}
	} elseif ( ! empty( $field['hint'] ) ) {
		$instructions = acf_esc_html( $field['hint'] );
		printf( '<p class="description">%s</p>', $instructions );
	}
}