From 7be3b09bb662a6c61ab8b85fd283733dedd83d78 Mon Sep 17 00:00:00 2001 From: Mike Francis Date: Mon, 9 Feb 2015 14:44:12 +0000 Subject: [PATCH] Update formatting and add shortcode, TinyMCE and WPML stuff. --- functions.php | 56 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/functions.php b/functions.php index c3abeaf..3cb1be0 100644 --- a/functions.php +++ b/functions.php @@ -1,6 +1,6 @@ ' . $content . ''; +} + +add_shortcode( 'button', 'button_shortcode' ); + + +/** + * TinyMCE + */ + +function my_mce_buttons_2( $buttons ) { + array_unshift( $buttons, 'styleselect' ); + $buttons[] = 'hr'; + return $buttons; +} + +add_filter( 'mce_buttons_2', 'my_mce_buttons_2' ); + +function my_mce_before_init( $settings ) { + $style_formats = array( + /* + * Example + * + array( + 'title' => '', + 'selector' => '', + 'classes' => '' + ) */ + ); + $settings['style_formats'] = json_encode( $style_formats ); + return $settings; +} + +add_filter( 'tiny_mce_before_init', 'my_mce_before_init' );