ACF\Pro\Fields\FlexibleContent

Render::actionsprivateACF 6.5

Renders top-level actions for the Flexible Content field.

Метод класса: Render{}

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->actions( $which );
$which(строка)
The location of the actions, either 'top' or 'bottom'.
По умолчанию: ''

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

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

Код Render::actions() ACF 6.8.8

<?php
private function actions( string $which = '' ) {
	if ( 'top' === $which ) {
		?>
		<div class="acf-actions acf-fc-top-actions">
			<button class="acf-btn acf-btn-clear acf-fc-expand-all">
				<?php esc_html_e( 'Expand All', 'acf' ); ?>
			</button>
			<button class="acf-btn acf-btn-clear acf-fc-collapse-all">
				<?php esc_html_e( 'Collapse All', 'acf' ); ?>
			</button>
			<span class="acf-separator"></span>
			<a class="acf-button button button-primary" href="#" data-name="add-layout" data-context="top-actions">
				<i class="acf-icon -plus small"></i>
				<?php echo acf_esc_html( $this->field['button_label'] ); ?>
			</a>
		</div>
		<?php
	} else {
		?>
		<div class="acf-actions">
			<a class="acf-button button button-primary" href="#" data-name="add-layout" data-context="bottom-actions">
				<i class="acf-icon -plus small"></i>
				<?php echo acf_esc_html( $this->field['button_label'] ); ?>
			</a>
		</div>
		<?php
	}
}