Remove all table widths from editor content

I would approach this by modifying the attributes allowed in the table, tr, and td markup from wp_kses. wp_kses is a function that runs on the content to filter out unwanted tags and attributes. It stands for KSES Strips Evil Scripts, but it does much more than that. It’s a large and sometimes convoluted function, … Read more

Insert shortcode in post editor from javascript (Visual / HTML)

I was pulling my hair out on this one, but I might have figured it out. Try this (with jQuery): if( ! tinyMCE.activeEditor || tinyMCE.activeEditor.isHidden()) { jQuery(‘textarea#content’).val(“[SHORTCODE]test[/SHORTCODE] “); } else { tinyMCE.execCommand(‘mceInsertRawHTML’, false, “[SHORTCODE]test[/SHORTCODE] “); } Basically, you need to set the value of the textarea directly if the editor is hidden.

Open link in a new tab checked by default when adding a new link in visual post editor

Add this function in your theme’s functions.php function my_enqueue($hook) { if (‘post.php’ != $hook ) { return; } wp_enqueue_script(‘my_custom_script’, get_template_directory_uri() . ‘/js/myscript.js’); } add_action(‘admin_enqueue_scripts’, ‘my_enqueue’);` In myscript.js place this code jQuery(document).ready(function(){ jQuery(‘#wp-link-target’).prop(“checked”, true); }) It worked for me.

Add table controls with wp_editor minimal editor configuration (‘teeny’)

Finally got it running with few pieces of extra buttons too :): <?php $tinymce_options = array(‘plugins’ => “table,lists,link,textcolor,hr”, ‘toolbar1’=>”fontsizeselect,forecolor,backcolor,bold,italic,underline,strikethrough,alignleft,aligncenter,alignright,alignjustify”,’toolbar2’=>”blockquote,hr,table,bullist,numlist,undo,redo,link,unlink”); $editor_config= array(‘teeny’=>true, ‘textarea_rows’=>5, ‘editor_class’=>’csec_text’, ‘textarea_name’=>’csec_text’, ‘wpautop’=>false, ‘tinymce’=>$tinymce_options); wp_editor($content, $id, $editor_config); ?> Check: wp_editor in add_meta_boxes does not show gallery for better option working in accordance with WordPress.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)