apply_filters( 'teeny_mce_buttons', array $buttons, string $editor_id )

Filters the list of teenyMCE buttons (Text tab).


Description Description


Parameters Parameters

$buttons

(array) An array of teenyMCE buttons.

$editor_id

(string) Unique editor identifier, e.g. 'content'.


Top ↑

Source Source

File: wp-includes/class-wp-editor.php

View on Trac


Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Mahdi Yazdani
    /**
     * The following snippet shows you how to limit the toolbar buttons to the 
     * text format dropdown, and the bold and italic buttons. 
     *
     * @access   public
     * @param    $buttons        An array of teenyMCE buttons.
     * @param    $editor_id      Unique editor identifier, e.g. 'content'.
     * @return   array           List of teenyMCE buttons
     */
    function prefix_custom_teeny_mce_buttons( $buttons, $editor_id ) {
        
        $buttons = array( 'formatselect', 'bold', 'italic' );
        return $buttons;
    
    }
    add_filter( 'teeny_mce_buttons', 'prefix_custom_teeny_mce_buttons', 10, 2 );
    

You must log in before being able to contribute a note or feedback.