ACF\Pro\Fields\FlexibleContent
Render::actions
Renders top-level actions for the Flexible Content field.
Method of the class: Render{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->actions( $which );
- $which(string)
- The location of the actions, either
'top'or'bottom'.
Default:''
Changelog
| Since 6.5 | Introduced. |
Render::actions() Render::actions code 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
}
}