Am I using the right hook for removing quicktags on the admin TinyMCE?

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( ‘wp_editor_settings’, ‘remove_editor_quicktags’, 10, 2 ); function remove_editor_quicktags( $settings, … Read more

TinyMCE Editor Set Default Tab

I came across this page — http://wp-snippets.com/set-default-editor/ * — which looks promising, though a little out of date. Instead of their code, I would suggest trying this: add_filter( ‘wp_default_editor’, ‘wpse101200_default_editor’ ); function wpse101200_default_editor( $editor ) { return ‘tinymce’; } Reference WPSeek’s wp_default_editor() page wp_default_editor() in the WordPress core source Unfortunately, the Codex doesn’t currently have … Read more

How to use tinyMCE for user “biographical info” without messing with any core file?

Not sure if this is the perfect way to do it, but it worked for me by removing the description element using jQuery and then adding editor for the description element. /******************************************* * TinyMCE EDITOR “Biographical Info” USER PROFILE *******************************************/ function biographical_info_tinymce() { if ( basename($_SERVER[‘PHP_SELF’]) == ‘profile.php’ || basename($_SERVER[‘PHP_SELF’]) == ‘user-edit.php’ && function_exists(‘wp_tiny_mce’) ) … Read more

Restrict file uploads by extension?

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes The filter: add_filter(‘upload_mimes’,’restict_mime’); function restict_mime($mimes) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘gif’ => ‘image/gif’, ‘png’ => ‘image/png’, ); return $mimes; } From what I understand this will not work for admins or any user with the unfiltered_upload … Read more

TinyMCE style_select – Append Classes

EDIT The quick and easy method is just a simple setting: style_formats_merge… function myformatTinyMCE($in) { $style_formats = array( array( ‘title’ => ‘Classes’, ‘items’ => array( array( ‘title’ => ‘Blue Color’, ‘selector’ => ‘p,strong,u,em,ol,ul’, ‘classes’ => ‘blueColor’ ) ) ) ); $in[‘style_formats_merge’] = true; $in[‘style_formats’] = json_encode( $style_formats ); return $in; } add_filter(‘tiny_mce_before_init’, ‘myformatTinyMCE’ ); Everything … Read more

TinyMCE popup windows using WP functions

The popup of a TinyMCE is outside WordPress. You must include the wp-load.php, same handle like outside the WordPress install. But think about this solution and maybe it is cleaner, that you create your data in a json string and handle this data in the popup. It is helpful to reads this post about the … Read more

WordPress MultiSite Paste from Word Tool Does not work

Problem was the page encoding. The wordpress database is UTF-8, i had switched the default to ISO-[something] to match the database we’re using to populate additional content and had not noticed any issue for over a month- until we started populating the blogs section of this page. We discovered the problem by following the code … Read more

Hacking TinyMCE for better usability (shortcodes and html)

Have a look at my Gridster Plugin, it replaces every shortcode [gridster id=”” title=””] with a visual replacement, like you know from the -Shortcode. To change parameters of the current shortcode, you’re able to click a button and a tinyMCE modal will let you change anything within a user-friendly GUI. The functions are based on … Read more

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