How to Add Custom CSS to the Media Thickbox?

In WordPress 3.5, this hook works for me: add_action( ‘print_media_templates’, ‘wpse_75746_print_style_35’ ); function wpse_75746_print_style_35() { ?> <style> .media-modal-content, .media-sidebar { background: #FFF2D4 !important; } </style> <?php } In 3.4.2, this is the one: add_action( ‘admin_print_styles-media-upload-popup’, ‘wpse_75746_print_style_342’ ); function wpse_75746_print_style_342() { ?> <style> #media-upload { background: #FFF2D4 !important; } </style> <?php }

Restore Image Title Text

You can hook into the media_send_to_editor filter and add the title tag to the generated HTML image tag: function wpse_78529_restore_image_title( $html, $id ) { /* retrieve the post object */ $attachment = get_post( $id ); /* if the title attribute is already present, bail early */ if ( strpos( $html, ‘title=” ) ) return $html; … Read more

Errors when uploading images in WP 3.5

This was addressed on the Minimatica website: http://www.onedesigns.com/support/topic/how-to-fix-issues-with-media-uploader-with-minimatica-in-wordpress-3-5 You will need to update your functions.php file as follows: In functions.php find this line (line 225 if you haven’t altered the file): add_action(‘init’, ‘minimatica_register_styles’); and replace it with — add_action(‘wp_enqueue_scripts’, ‘minimatica_register_styles’); AND Then find this line (line 437 if you haven’t altered the file): add_filter( ‘ext2type’, … Read more

WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types

The file types that you have specified ‘application/msword’, ‘application/vnd.ms-excel’, ‘application/pdf’ are already supported by media uploader. To see the default supported mime file types, call wp_get_mime_types() function. Use upload_mimes filter as shown in following code to make media uploader to accept files types other than the default. Add following code in your themes functions.php file … Read more

Exclude an array

Strange but it works with same principle I was trying to. Maybe I had some grammer error. Here is a code if somebody will need it in future as there was nothing in search result: // get product media library $mediaArgs = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘post_status’ => null, … Read more

Too many connections to server

I contacted my hosting provider to solve this problem and they claim that my wordpress is generating too many simultaneous connections to server… The only times I’ve seen hosts put limits on the number of MySQL connections is when the host is free or very cheap or incompetent. Is it free hosting? It’s really easiest … Read more