Define custom formats for your theme’s tinyMCE text fields.
"tiny-mce-additions" is a list of objects, each with the options below.
|The name of the style, which will appear in the tinyMCE style selection dropdown menu.|
|Name of the inline element to produce, e.g |
|Name of the block element to produce for example |
|CSS 3 selector pattern to find elements within the selection by. This can be used to apply classes to specific elements or complex things like odd rows in a table.|
|Space separated list of classes to apply to the selected elements or the new inline/block element.|
|Name/value object with CSS style items to apply such as color etc.|
|Name/value object with attributes to apply to the selected elements or the new inline/block element.|
|Disables the merge similar styles feature when used. This is needed for some CSS inheritance issues such as text-decoration for underline/strikethough.|
|State that tells that the current format is a container format for block elements. For example a div wrapper or blockquote.|
This custom format will apply the
custom-checkbox-list class to all
<ul> elements within the selected HTML.
return ["enable" => ["styleselect"],"tiny-mce-additions" => [["title" => "Checkbox List","selector" => "ul","classes" => "custom-checkbox-list",]]]
Now in the editor we see our newly defined format:
Note that the extended toolbar (farthest right button) must be enabled to see this option.