-
-
Save JPry/a2fcad3b0d1fee2b915a to your computer and use it in GitHub Desktop.
add editor style (works for front-end editors as well)
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 | |
add_filter( 'mce_css', 'jpry_add_editor_styles' ); | |
/** | |
* Filter the TinyMCE styles. | |
* | |
* @param string $styles The comma-separated list of stylesheets to be loaded by TinyMCE. | |
* | |
* @return string The updated comma-separated list of stylesheets to be loaded by TinyMCE. | |
*/ | |
function jpry_add_editor_styles( $styles ) { | |
$new_styles = array( | |
get_stylesheet_directory_uri() . '/editor-style.css', | |
); | |
// Add our styles to the array | |
$styles_array = array_merge( explode( ',', $styles ), $new_styles ); | |
$styles = implode( ',', $styles_array ); | |
return $styles; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment