In order to add style_formats to TinyMCE you should register them for tinyMCEStyleFormats property. Example of code:
 

function extendTinyMCEStyleFormats($motopressCELibrary) {
    // add Text highlight
    $motopressCELibrary->tinyMCEStyleFormats[] = array(
        'title' =>'Text highlight',
        'inline' => 'span',
        'classes' => 'text-highlight'
    );
    // add Dropcap
    $motopressCELibrary->tinyMCEStyleFormats[] = array(
        'title' =>'Dropcap',
        'inline' => 'span',
        'classes' => 'dropcap'
    );
}
add_action('mp_library', 'extendTinyMCEStyleFormats', 11, 1);

You’ll get a dropdown ‘Formats’ on tinyMCE panel with your custom formats.

tinymce-add.jpg

Responses

We want to make our product better, so will be glad to receive your feedback and improve MotoPress specially for you! Leave a message below, make your voice heard!