Home › Forums › General Issues › Add options to wysiwyg toolbar › Reply To: Add options to wysiwyg toolbar
This is an OLD question, but I stumbled upon it when trying to answer how to add items to the pre-defined Basic menu. Here is the code I’ve used, which was written using the information found at ACF.
/********************************
ADD ADDITIONAL TOOLBAR SET TO ACF WYSIWYG
********************************/
if ( function_exists( 'get_field' ) ) {
add_filter( 'acf/fields/wysiwyg/toolbars' , 'qd_toolbars' );
function qd_toolbars( $toolbars )
{
//INJECT/ADD AN OPTION INTO THE BASIC TOOLBAR
$toolbars['Basic' ][1] = array_merge( array_slice( $toolbars['Basic' ][1], 0, 3, true ), array( 'subscript','superscript' ), array_slice( $toolbars['Basic' ][1], 3, null, true ) );
//FIND MORE INFO ABOUT THIS OPERATION AT http://www.advancedcustomfields.com/resources/customize-the-wysiwyg-toolbars/
// Add a new toolbar called "Very Simple"
// - this toolbar has only 1 row of buttons
$toolbars['Very Simple' ] = array();
$toolbars['Very Simple' ][1] = array('bold' , 'italic' , 'underline', 'link', 'unlink' );
// return $toolbars - IMPORTANT!
return $toolbars;
}
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.