enqueuing custom light wysiwyg

This commit is contained in:
Antoine M 2023-11-28 12:37:53 +01:00
parent f55f7dd92a
commit 212a422484
2 changed files with 24 additions and 0 deletions

View File

@ -14,3 +14,4 @@ require_once(__DIR__ . '/includes/navwalker.php');
require_once(__DIR__ . '/includes/templates.php');
require_once(__DIR__ . '/includes/ajax.php');
require_once(__DIR__ . '/includes/api.php');
require_once(__DIR__ . '/includes/wysiwyg.php');

23
includes/wysiwyg.php Normal file
View File

@ -0,0 +1,23 @@
<?php
function enqueue_light_toolbar($toolbars)
{
$toolbars['Very Simple'] = array();
$toolbars['Very Simple'][1] = array('bold', 'link');
// Edit the "Full" toolbar and remove 'code'
// - delet from array code from http://stackoverflow.com/questions/7225070/php-array-delete-by-value-not-key
if (($key = array_search('code', $toolbars['Full'][2])) !== false) {
unset($toolbars['Full'][2][$key]);
}
// remove the 'Basic' toolbar completely
unset($toolbars['Basic']);
// return $toolbars - IMPORTANT!
return $toolbars;
}
add_filter('acf/fields/wysiwyg/toolbars', 'enqueue_light_toolbar');