Mastering the TinyMCE Styles Dropdown in the WordPress Visual Editor

add_filter( ’tiny_mce_before_init’, ‘my_mce_before_init’ );function my_mce_before_init( $settings ) { $style_formats = array( array( ’title’ => ‘Button’, ‘selector’ => ‘a’, ‘classes’ => ‘button’ ), array( ’title’ => ‘Callout Box’, ‘block’ => ‘div’, ‘classes’ => ‘callout’, ‘wrapper’ => true ), array( ’title’ => ‘Bold Red Text’, ‘inline’ => ‘span’, ‘styles’ => array( ‘color’ => ‘#f00’, ‘fontWeight’ => ‘bold’ ) ) ); $settings[‘style_formats’] = json_encode( $style_formats ); return $settings;}

Source: Mastering the TinyMCE Styles Dropdown in the WordPress Visual Editor


Geplaatst

in

door

Reacties

Geef een reactie

Uw e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *