• Sorry for cross-posting, I accidentally posted in the wrong forum originally.

    Hi guys,

    I wish to use the tinyMCE editor within a Meta Box, and it is working brilliantly using the wp_editor function.

    However, I want to only offer a subset of buttons. This is easily achieved in quicktags, but I cannot seem to figure our how to do it for tinyMCE.

    My settings array is below

    $tinyMCE_settings = array(
        "teeny" => true,
        "media_buttons" => false,
        "wpautop" => true,
        "textarea_rows" => 5,
        "quicktags" => array(
            "buttons" => "em,strong,link"
        )
    );

    There is a filter for mce_buttons, but how can I target a particular tinyMCE instance?

    Alternatively, can I use a syntax similar to the quicktags option above?

Viewing 1 replies (of 1 total)
  • Hi,

    You can use the teeny_mce_buttons filter for the buttons and the editor_id parameter to identify a particular tinyMCE instance.

    For example, to have only the bold, italic and underline buttons for a specific instance you can do :

    function mytheme_teeny_mce_buttons( $buttons, $editor_id ) {
    	if ( "my-instance-id" == $editor_id ) {
    	  return array( 'bold', 'italic', 'underline' );
            }
            return $buttons;
    }
    add_filter( 'teeny_mce_buttons', 'mytheme_teeny_mce_buttons', 10, 2 );
Viewing 1 replies (of 1 total)
  • The topic ‘wp_editor() function and tinyMCE buttons’ is closed to new replies.