Support » Developing with WordPress » Insert b tag when pressing b button instead of strong tag

  • Resolved giannit

    (@giannit)


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

    • clicking the b (Bold) button would generate a <b> tag, rather than a <strong> tag
    • clicking the i (italic) button would generate a <i> tag, rather than a <em> tag
    • I tried placing this code inside functions.php 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;
      }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter giannit

    (@giannit)

    the thread can be deleted
    i added the button bold using the function QTags.addButton

    Moderator bcworkz

    (@bcworkz)

    Your topic will remain none the less. It might help someone else wanting to do the same thing. We actually never delete any topic (except for spam). We might close it if it attracts spam, and very old topics are closed automatically. But nothing is ever deleted 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Insert b tag when pressing b button instead of strong tag’ is closed to new replies.