acf_field_wysiwyg::acf_enqueue_uploader
Registers toolbars data for the WYSIWYG field.
Method of the class: acf_field_wysiwyg{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_field_wysiwyg = new acf_field_wysiwyg(); $acf_field_wysiwyg->acf_enqueue_uploader();
Changelog
| Since 5.3.2 | Introduced. |
acf_field_wysiwyg::acf_enqueue_uploader() acf field wysiwyg::acf enqueue uploader code ACF 6.8.8
function acf_enqueue_uploader() {
// vars
$data = array();
$toolbars = $this->get_toolbars();
// loop
if ( $toolbars ) {
foreach ( $toolbars as $label => $rows ) {
// vars
$key = $label;
$key = sanitize_title( $key );
$key = str_replace( '-', '_', $key );
// append
$data[ $key ] = array();
if ( $rows ) {
foreach ( $rows as $i => $row ) {
$data[ $key ][ $i ] = implode( ',', $row );
}
}
}
}
// localize
acf_localize_data(
array(
'toolbars' => $data,
)
);
}