“Disabling” medium_editor keyboard styling
-
We are using the options to remove the “bold” and “underline” options in the menu – but medium editor still allows you to use the keyboard shortcuts ctrl-b & ctrl-u (for different fields mainly titles) [ and occasionally ctrl-i ]
We don’t want these tags to be stored – I have worked out how to fix this and applied a minor patch to the update_value function to remove them if the button options are disabled:
767 if( ! in_array(‘bold’, $field[‘standard_buttons’] ) ) {
768 $value = preg_replace( ‘/<\/?b>/’, ”, $value );
769 }
770 if( ! in_array(‘italic’, $field[‘standard_buttons’] ) ) {
771 $value = preg_replace( ‘/<\/?i>/’, ”, $value );
772 }
773 if( ! in_array(‘underline’, $field[‘standard_buttons’] ) ) {
774 $value = preg_replace( ‘/<\/?u>/’, ”, $value );
775 }
- The topic ‘“Disabling” medium_editor keyboard styling’ is closed to new replies.