WordPress.org

Forums

TinyMCE Advanced
[resolved] Disable Heading 1 (6 posts)

  1. Marypop
    Member
    Posted 1 year ago #

    Hi

    Old functions won't work anymore.

    So how to disable heading 1 from format dropdown menu?

    Mary

    https://wordpress.org/plugins/tinymce-advanced/

  2. Marypop
    Member
    Posted 12 months ago #

    Earlier I have used this in functions.php:

    // Customize the format dropdown items
    if( !function_exists('base_custom_mce_format') ){
    	function base_custom_mce_format($init) {
    		// Add block format elements you want to show in dropdown
    		$init['theme_advanced_blockformats'] = 'p,h2,h3';
    		// Add elements not included in standard tinyMCE dropdown p,h1,h2,h3,h4,h5,h6
    		//$init['extended_valid_elements'] = 'code[*]';
    		return $init;
    	}
    	add_filter('tiny_mce_before_init', 'base_custom_mce_format' );
    }

    What can I do now to disable heading 1?

  3. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 11 months ago #

    Right, the options in the TinyMCE config have changed: http://www.tinymce.com/wiki.php/Configuration. I believe you're looking for this: http://www.tinymce.com/wiki.php/Configuration:block_formats.

  4. Marypop
    Member
    Posted 11 months ago #

    Thank for an answet.

    Can you give me a hint were to place this piece of code?
    I tried this in functions.php, but it's not working at all:

    function myformatTinyMCE($in)
    {
     $in['entity_encoding']= 'block_formats: "Paragraph=p;Header 2=h2;Header 3=h3"'; // numeric/raw
     return $in;
    }
    add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
  5. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 11 months ago #

    That's not the right code (copy/paste error?). Perhaps try:

    function myformatTinyMCE($in) {
      $in['block_formats'] = "Paragraph=p;Header 2=h2;Header 3=h3";
      return $in;
    }
    add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
  6. Marypop
    Member
    Posted 6 months ago #

    Thanks Andrew, it worked perfectly! :)) Wow!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • TinyMCE Advanced
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags