Articles of media settings

Audio Playlist : How to bind events for “track change”, “track end”?

I’m customizing native WordPress playlist echo do_shortcode(”); I’d like to bind events to detect “track change” and “track end” and do something when those events fired. So, I checked wp-playlist.js. I see some events but I have no idea how to bind it on a separate js file (jquery) events : { ‘click .wp-playlist-item’ : […]

Can I stop wordpress generating media sizes

I am using atelier theme on a shop website and I have seen the disk space grow rapidly. In my analysis, I have noticed that Atelier is creating 17 different media sizes when it uploads an image: thumbnail – 150×150 medium – 300×300 medium_large – 768×9999 large – 1024×1024 shop_thumbnail – 180×180 shop_catalog – 800×800 […]

Post type specific upload folder in 3.5

In 3.4 I used the following function to change image upload folder by post type. Different upload directory based on post type in a theme Now it doesn’t work anymore in 3.5. Do you have any idea how to replace this function in 3.5 version? thanks

Resize the WP media Uploader iFrame

I’m trying to customize the look of the iframe that pops up (media uploader). I’ve manage to remove some fields etc, but I cannot re-size the frame. Does anybody know how to do this?

wp.media add context

I have wp.media frame on my plugin to upload doc, docx file. I am filtering the uploaded file. If uploaded other than supported file, it will display this error I am filtering it at wp_handle_upload_prefilter to check for supported file However this filter will affect all other media uploader as well. I think, if it […]

How to set CORS header?

I have been accessing media images in a Ruby on Rails application via ajax from wordpress 4.2.4. I am getting following error while accessing the image via ajax. XMLHttpRequest cannot load http://img.mywordpresstips.com/plugins/test.jpeg. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://stage.mysite.com’ is therefore not allowed access. I tried WP-CORS plugin and set * […]

Change default tab of media manager

Is there a way to change the default media manager tab? I have managed to remove everything that I didn’t want to show in media manager, using the instructions from the first post here Add a menu item to WordPress 3.5 Media Manager. I also have created a custom tab. The problem is that when […]

Add control in image detail panel

I am trying to add a checkbox control in the image details popup (when editing image in a post). I have added the following code in my template function.php but I can’t manage to display the checkbox in the popup. What am I missing? function bluesolutions_customize_register($wp_customize) { $wp_customize->add_section(‘bluesolutions_use_lighbox_section’, array( ‘title’ => __(‘Lightbox’, ‘mytheme’), ‘description’ => […]

Different upload directory based on post type in a theme

I have a lot of uploaded image files and image sizes. So it would be better to organize media files into folders based on post type. I have just read this tutorial, but as I can see it works with plugins. How to change this to use in a theme? Thanks. function custom_upload_directory( $args ) […]

Allowing for multiple template views on the Gallery Settings page when using the Visual Editor

I’m trying to extend this answer by making it possible to switch shortcode attributes from the UI and alter the gallery markup based on those attributes. In this case, if owl is set to true then an Owl Carousel would render in the gallery’s place – which is does. But like any shortcode you have […]