Unable to add “code” button to TinyMCE toolbar

That is a very good question. I just tested your code locally and see the same result. A little digging reveals a twp-part problem. wp-includes/class-wp-editor.php is a good read for TinyMCE customizations WordPress 3.9 did update to TinyMCE 4.0 and the TinyMCE docs imply that the superscript button is now called “superscript” and not just … Read more

How to replace the content of tinyMCE editor in both text and visual mode using jQuery?

The first thing to do is to select the active editor. Here we select the editor using its id, which is content. var activeEditor = tinyMCE.get(‘content’); Then we use tinyMCE’s setContent: var activeEditor = tinyMCE.get(‘content’); var content=”HTML or plain text content here…”; activeEditor.setContent(content); However, if the editor is in text mode to begin with, after … Read more

Replace Taxomony Description Field with Visual/WYSIWYG Editor

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 scope=”row”>Description</th> <td> <?php wp_editor(html_entity_decode($term->description), ‘description’, array(‘media_buttons’ => false)); ?> <script> jQuery(window).ready(function(){ jQuery(‘label[for=description]’).parent().parent().remove(); }); </script> </td> </tr> <?php … Read more

How to use tinyMCE for user “biographical info”?

I found a very helpful blog post which shows exactly how to accomplish what I am after with only three small changes to the user-edit.php page. First Change I had to add a class name to the <textarea> tag for the description. <textarea name=”description” id=”description” rows=”5″ cols=”30″ class=”CLASS_NAME_HERE”><?php echo esc_html($profileuser->description); ?> </textarea><br /> Second Change … Read more

Enqueue Script After TinyMCE initialized

Adding scripts after TinyMCE: You might check out the before_wp_tiny_mce and after_wp_tiny_mcehooks. If you take a look at the file /wp-includes/class-wp-editor.php you can see that the TinyMCE settings scripts are not all loaded through the usual enqueue methods, but some are displayed via: add_action( ‘admin_print_footer_scripts’, array( __CLASS__, ‘editor_js’), 50 ); where the editor_js method contains … Read more

Load wp_editor via ajax [duplicate]

Add this to your plugin file: (you can also add it on the theme’s functions file) function ajax_wp_editor() { ?> your html form here <?php } //for all users add_action(‘wp_ajax_nopriv_ajax_wp_editor’, ‘ajax_wp_editor’); // for logged in users add_action(‘wp_ajax_ajax_wp_editor’, ‘ajax_wp_editor’); Request Ajax using this URL: [BLOG_ADDRESS]/wp-admin/admin-ajax.php?action=ajax_wp_editor

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