Tag Info

Hot answers tagged

2

One way to do it would be to replace the editor's shortcuts object with a no-op. In your theme's "functions.php": add_action( 'wp_tiny_mce_init', function () { ?> <script> tinymce.on('SetupEditor', function (editor) { editor.shortcuts = { add: function() {} }; }); </script> <?php }); Re answer cited by the ...


2

Here's what I came up with. So far it doesn't seem to have broken anything: add_filter('tiny_mce_before_init', 'modify_formats'); function modify_formats($settings){ $formats = array( 'bold' => array('inline' => 'b'), 'italic' => array('inline' => 'i') ); $settings['formats'] = json_encode( $formats ); return $settings; ...


2

After checking out the code, the best way to do this would be to use the wp_editor_settings filter in /wp-includes/class-wp-editor.php. When you call wp_editor() it internally makes a call to _WP_Editors::editor($content, $editor_id, $settings);. This function first passes the $settings array through parse_settings() which uses that filter. add_filter( ...


1

One option is to add a class to the Styleselect menu in MCE. Adapted from the "TinyMCE Custom Styles" Codex page you first need to add the style select to the editor: // Callback function to insert 'styleselect' into the $buttons array function my_mce_buttons_2( $buttons ) { array_unshift( $buttons, 'styleselect' ); return $buttons; } // Register ...


1

Your sort of right, the Wordpress editor saves content thru a filter called the_content. This filter is used to filter the content of the post after it is retrieved from the database and before it is printed to the screen. Apply this filter to simulate TinyMCE formatting. <?php echo apply_filters( 'the_content', $options['textarea_input']); ?>


1

I was able to solve this by adding the WP Edit plugin to my site. It has an Advanced Link button, that allows me (or an editor) to manually type in a classname.



Only top voted, non community-wiki answers of a minimum length are eligible