enqueuing custom light wysiwyg
This commit is contained in:
parent
f55f7dd92a
commit
212a422484
|
|
@ -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
23
includes/wysiwyg.php
Normal 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');
|
||||
Loading…
Reference in New Issue
Block a user