Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // le hook que nous avons vu en tout début d'article…
- add_filter( 'tiny_mce_before_init', 'juiz_mce_before_init' );
- if ( !function_exists('juiz_mce_before_init')) {
- function juiz_mce_before_init( $styles ) {
- // on créé un tableau contenant nos styles
- $style_formats = array (
- // chaque style est un nouveau tableau
- // Style "Page en construction"
- array(
- 'title' => __('page en construction'),
- 'block' => 'div',
- 'classes' => 'construction'
- ),
- // Style "bouton"
- array(
- 'title' => __('lien externe'),
- 'selector' => 'a',
- 'classes' => 'external'
- ),
- // Style "Encart bleu"
- array(
- 'title' => __('encart bleu'),
- 'block' => 'div',
- 'classes' => 'encartbleu',
- 'wrapper' => true
- ),
- // Style "Encart vert"
- array(
- 'title' => __('encart vert'),
- 'block' => 'div',
- 'classes' => 'encartvert'
- )
- );
- // on remplace les styles existants par les nôtres
- $styles['style_formats'] = json_encode( $style_formats );
- return $styles;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement