Tag Info

New answers tagged

0

Easy thing, install plugin called tinymce-advanced and in the setting page for the plugin just click check box for Stop removing the p and br tags when saving and show them in HTML editor and save.


1

If you wait for the SetupEditor event then you can access the editors: add_action( 'admin_print_footer_scripts', function () { ?> <script type="text/javascript"> jQuery(function ($) { tinymce.on('SetupEditor', function (editor) { if (editor.id === 'contentLeft') { // Could use new 'input' event ...


2

This is the simple way to remove emoji. Add bellow code to your function.php remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'wp_print_styles', 'print_emoji_styles' );


3

To achieve the dropdown styles we have to use the filter hook tiny_mce_before_init. This filter grants developers access to the TinyMCE settings array. The following example adds custom style options to an existing Style dropdown. add_filter( 'tiny_mce_before_init', 'my_mce_before_init' ); function my_mce_before_init( $settings ) { $style_formats = ...


0

I found out myself. I had to call media_upload_header(); in the Iframe and trigger the following javascript: var html = 'stuff I want to return to editor'; var win = window.dialogArguments || opener || parent || top; win.send_to_editor(html); I have no Idea how, but this works.


0

I use this on my instals to get rid of p tags around images: /* * * Remove annoying <p> tags on images, messes with my shizzle * */ function my_filter_ptags_on_images($content) { return preg_replace('/<p>(\s*)(<img .* \/>)(\s*)<\/p>/iU', '\2', $content); } add_filter('the_content', 'my_filter_ptags_on_images');


2

You can use a {$taxonomy}_edit_form_fields action hook to add html to the term edit table. In that HTML you can remove description textarea and add tinymce editor add_action("{$taxonomy}_edit_form_fields", 'add_form_fields_example', 10, 2); function add_form_fields_example($term, $taxonomy){ ?> <tr valign="top"> <th ...


0

you can use this if you looking any certain post type remove_filter('the_content','wpautop'); //decide when you want to apply the auto paragraph add_filter('the_content','my_custom_formatting'); function my_custom_formatting($content){ if(get_post_type()=='my_custom_post') //if it does not work, you may want to pass the current post object to ...


1

i use this custom button for ad's in TinyMCE, i use JavaScript code to add/develop this one look into this code: jQuery(document).ready(function ($) { tinymce.create('tinymce.plugins.wpse72394_plugin', { init: function (ed, url) { // Register command for when button is clicked ...


1

It's called wpautop. There is a plugin that will help you to effectively deal with this Please check PS Disable Auto Formatting Hope it helps


5

You can disable the visual editor entirely in your profile settings. If you need to disable it on a per page basis, take a look at this answer. Using text mode may not solve the empty paragraph problem, the wpautop filter is applied to the content regardless of how the content is edited. You can remove the filter, but then you'll have to manually break and ...



Top 50 recent answers are included