jebu1104
4/2/2015 - 3:26 PM

Customize format drop down in wp backend

Customize format drop down in wp backend

// 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,h4,h5,h6,div,address';
        // Add elements not included in standard tinyMCE dropdown p,h1,h2,h3,h4,h5,h6
        $init['extend_valid_elements'] = 'a[*]';
        return $init;
    }
    add_filter('tiny_mce_before_init', 'base_custom_mce_format' );
}