Insert when pressing b in TinyMCE editor

enter image description here

Is it possibile to modify the TinyMCE editor in such a way that:

  • clicking the (Bold) button would generate a tag, rather than a tag
  • clicking the (italic) button would generate a tag, rather than a tag

I tried placing this code inside functions.php file but it didn’t work

add_filter('tiny_mce_before_init', 'modify_formats');

function modify_formats($settings){
   $formats = array(
     'bold' => array('inline' => 'b'),
     'italic' => array('inline' => 'i')
    );
    $settings['formats'] = json_encode( $formats );
    return $settings;
}

Read more here:: <a href=https://wordpress.stackexchange.com/questions/348875/insert-b-when-pressing-b-in-tinymce-editor target="_blank" title="Insert when pressing b in TinyMCE editor” rel=nofollow>Insert when pressing b in TinyMCE editor

Leave a Reply

Your email address will not be published. Required fields are marked *