Created
March 29, 2014 22:01
-
-
Save neverything/9863732 to your computer and use it in GitHub Desktop.
Overwrite or extend tiny mce styles dropdown in required-starter child theme.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change options in the TinyMCE Styles dropdown | |
* @param array $args default styles array as seen in req-mce.php | |
* @return array our custom styles for the dropdown | |
*/ | |
function req_starter_editor_stlye_args_filter( $args ) { | |
$custom_args = array( | |
array( | |
'title' => __( 'Notes', 'required-starter' ), | |
'block' => 'div', | |
'classes' => 'note-paper', // Add your classes here | |
'wrapper' => true | |
), | |
array( | |
'title' => __( 'Lead-Text', 'required-starter' ), | |
'block' => 'div', | |
'classes' => 'lead', // Add your classes here | |
'wrapper' => true | |
), | |
array( | |
'title' => __( 'Image', 'required-starter' ), | |
'block' => 'figure', | |
'classes' => 'content-img', // Add your classes here | |
'wrapper' => true | |
), | |
array( | |
'title' => __( 'Partner Logos', 'required-starter' ), | |
'block' => 'div', | |
'classes' => 'partner-logos', // Add your classes here | |
'wrapper' => true | |
), | |
array( | |
'title' => __( 'Button', 'required-starter' ), | |
'selector' => 'a', | |
'classes' => 'button', // Add your classes here | |
'exact' => true | |
), | |
); | |
// Since you only have custom styles, | |
// we throw away the default $args array | |
// and simply return your styles. | |
return $custom_args; | |
// The alternative would be to use array_merge to | |
// combine the original $args and our $custom_args | |
//return array_merge($args, $custom_args); | |
} | |
add_filter( 'req_editor_stlye_args', 'req_starter_editor_stlye_args_filter' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment