acf_render_field_instructions()
Renders the field's instructions.
No Hooks.
Returns
null. Nothing (null).
Usage
acf_render_field_instructions( $field, $tooltip );
- $field(array) (required)
- The field array.
- $tooltip(true|false)
- If the instructions are being rendered as a tooltip.
Default:false
Changelog
| Since 5.6.3 | Introduced. |
acf_render_field_instructions() acf render field instructions code 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 );
}
}