Tag Info

New answers tagged

1

I think you should first enable i tags.Then you should enable class id or span whatever you like.To do so add this code. function add_mce_markup( $initArray ) { $ext = 'i[id|name|class|style]'; if ( isset( $initArray['extended_valid_elements'] ) ) { $initArray['extended_valid_elements'] .= ',' . $ext; } else { ...


3

The text goes white when the id attribute ($editor_id) contains []. They are not allowed here. Make sure the second argument for wp_editor does not contain [], and the text becomes visible again. I have reported that regression with a test case on ticket #26778. To use brackets in the name attribute, use textarea_name in the settings parameter. Example ...


0

I've been stuggeling with a similar issue. (button not appearing in mce editor toolbar). This pattern worked for me in WP 3.9 / tinymce 4.0: tinymce.PluginManager.add( 'thing' , function( editor ){ editor.addButton('thing', { type: 'listbox', text: 'My listbox', onselect: function(e) { // do things... }, ...


0

You can filter the various toolbars in TMCE4, as you could in TMCE3. function my_mce_buttons_2( $buttons ) { if(in_array('forecolor', $buttons)) { $buttons = array_diff($buttons, array('forecolor')); } return $buttons; } add_filter('mce_buttons_2', 'my_mce_buttons_2');


0

And, if you'd like to have an actual icon button, then you can leverage dashicons, or your own icon font for it. Create a CSS file, and enqueue on the admin side; i.mce-i-pluginname:before { content: "\f164"; display: inline-block; -webkit-font-smoothing: antialiased; text-align: center; font: 400 20px/1 dashicons!important; speak: ...


0

I'm not sure if there is an official way to do this in TinyMCE 4.0 or not, I can't find any references in their docs or on WordPress - below is a PHP method you could use to do this: function myformatTinyMCE($in) { $del_buttons = array('bold', 'italic', 'strikethrough'); $temp = explode(',', $in['toolbar1']); foreach($del_buttons as $del){ ...


0

if you want to make intent in the beginning of sentence after <br> (SHIFT+ENTER), then you may need to use custom solution: in functions.php add: add_action('init', 'add_cust_button'); function add_cust_button() { if ( get_user_option('rich_editing') == 'true') { add_filter('mce_external_plugins', 'add_mycust_plugin'); ...


0

1) use soft returns (shift+enter) to insert <br> instead of paragraphs. 2) if you want to make intent in the beginning of sentence after (SHIFT+ENTER), then you may need to use this custom code: http://wordpress.stackexchange.com/a/139347/42702


9

The follow small plugin create a custom buttom inside line 1 of the WordPress TinyMCE Version 4, tested in WP Version 3.9-beta2. The plugin have var_dump include to understand the values. It also possible to add the button to other lines of the visual editor, only a other hook, like for line 2: mce_buttons_2. Result Plugin, php side - tinymce4-test.php ...


0

Ran into the same issue, try taking the wrapper value out of your settings array. array( 'title' => 'Head', 'block' => 'h4', 'classes' => 'headings' ),


1

First, I believe your css should use only one colon: .mce_mybutton:before { content: '\f459'; } Now, in order to get the css to the proper place. First, we add an action to admin_print_styles; then we check to see if we are editing a post or page; then we enqueue our stylesheet. We run the check to see if we are editing, so that we don't enqueue our ...


0

How about the theme_advanced_disable option (link)? tinyMCE.init({ ... theme_advanced_disable : "bold,italic" });



Top 50 recent answers are included