Make fonts.com font work in TinyMCE (iframe referrer issue)

I ran into this issue with Typekit, here’s my solution: http://www.tomjn.com/150/typekit-wp-editor-styles/ add_filter(“mce_external_plugins”, “tomjn_mce_external_plugins”); function tomjn_mce_external_plugins($plugin_array){ $plugin_array[‘typekit’] = get_template_directory_uri().’/typekit.tinymce.js’; return $plugin_array; } and this js: (function() { tinymce.create(‘tinymce.plugins.typekit’, { init: function(ed, url) { ed.onPreInit.add(function(ed) { // Get the DOM document object for the IFRAME var doc = ed.getDoc(); // Create the script we will add to … Read more

Highlight custom widgets in the admin area?

All widgets in the admin area get an id in the style widget-[global_counter]_[widget_key]-[widget_id], like widget-59_monkeyman_widget_shortcut-5 (installed widget) or widget-11_monkeyman_widget_shortcut-__i__ (an uninstalled widget in the list). If your widget key contains something unique for all your widgets (like your company name), you can use this and add a substring attribute CSS selector (which works in most … Read more

How to list ALL Pages in the dashboard?

If that listing has too many pages, maybe you’ll run into troubles. You probably already know that this can be set in the Screen Options of the page http://example.com/wp-admin/edit.php?post_type=page. If you try to put a really high value there, this warning pops up and the system doesn’t accept it: But the following permanently sets this … Read more

What is the best method to close off the backend?

If you know the sub-net of your VPN you could restrict access to /wp-admin via .htaccess using standard Apache rules. <Directory /var/www/wp-admin/> Order deny,allow Allow from 192.168.1.0/24 Allow from 127 </Directory> Obviously you’d need to adjust the directory and IP address subnet to suit your needs. To restrict access to a specific file: <Files _FILE_.php> … Read more

how do I force a single column layout in screen layout

You can use the filter screen_layout_columns to set only one column for the post screen get_user_option_screen_layout_post to force the user option to 1. If you want to use that for custom post type then use get_user_option_screen_layout_{post_type} The following code will do it: function so_screen_layout_columns( $columns ) { $columns[‘post’] = 1; return $columns; } add_filter( ‘screen_layout_columns’, … Read more