Last active
November 13, 2018 20:12
-
-
Save DevTarakanova/d3f5b1543ff1ecd7abac03fcd50cf49a to your computer and use it in GitHub Desktop.
Customize WSVC editor font sizes
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
// Create a function that adds the font selector | |
if (!function_exists('PREFIX_mce_buttons')) { | |
function PREFIX_mce_buttons($buttons) | |
{ | |
array_unshift($buttons, 'fontsizeselect'); // Add Font Size Select | |
return $buttons; | |
} | |
} | |
// Hook the function the mce buttons event | |
add_filter('mce_buttons_2', 'PREFIX_mce_buttons'); | |
// Everything that follows is OTIONAL --- | |
// The following is only if you want to customize the default font sizes | |
// Create a function to Customize mce editor font sizes | |
if (!function_exists('PREFIX_mce_text_sizes')) { | |
function PREFIX_mce_text_sizes($initArray) | |
{ | |
$initArray['fontsize_formats'] = "9px 10px 11px 12px 13px 14px 16px 17px 18px 19px 20px 21px 22px 23px 24px 25px 26px 27px 28px 29px 30px 32px 34px 36px 38px 40px 42px 44px 46px 48px 50px 52px 54px 56px 57px 58px 60px"; | |
return $initArray; | |
} | |
} | |
// Hook the function in the mce before init event | |
add_filter('tiny_mce_before_init', 'PREFIX_mce_text_sizes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment