How to open the add media dialogue it in a certain state / tab?

Suppose you want to open the modal to the create gallery section: var options = { frame: ‘post’, state: ‘gallery’, title: wp.media.view.l10n.createGalleryTitle, multiple: true }; var frame = wp.media.editor.open(null,options) If you want something else, I suggest you search through the core js source to change the Library ID as appropriate for the section you need.

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 }

How to customize WordPress Thickbox?

Update: Since the link is unavaiable anymore (linked a webarchive in comments but it’s still pretty old and buggy) I suggest to use this. It’s more efficient and reliable and does not require any file add-in or advanced knowledge being more detailed than the old one. Original I’ve bumped into this one before. Here, follow … Read more

Custom Thickbox Broken on Dashboard Page?

After digging into this for a bit, it looks like there’s a number of pages where WordPress ends up changing the behavior of the default thickbox implementation — this includes both javascript changes, as well as custom style rules. You can see an example of this here #File: wp-admin/js/media-upload.js // thickbox settings var tb_position; (function($) … Read more

Showing a Thickbox (tb_show) does nothing

Answer can be found here: https://stackoverflow.com/questions/13863087/wordpress-custom-widget-image-upload Even though the problem described isn’t exactly the same as I had, the code posted in the answer still helped me as that code actually does exactly what I needed. I also think that I didn’t originally find this answer as it’s on the regular Stack Overflow and not … Read more

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