Add tab on new media library
Add tab on new media library
Add tab on new media library
Notice: I’m considering that by Media Manager you’re referring to the Media Library. /wp-admin/media.php Maybe pre_get_posts could handle this, but won’t get there… I’d propose an alternative solution that prevents seeing lots of duplicates in the Media Library page: The output of the All Thumbs column is simply a link to the image. But I … Read more
You can use several functions to get the URL of a image of any of the intermediate sizes created by WordPress (thumbnail, medium, large, full, or any other custom size). You can use get_the_post_thumbnail()/the_post_thumbnail(): use this function if you want to get a <img> element of the featured image of a post (aka “post thumbnail”). … Read more
Images are registered in media library but still won’t show up
Trying to add filename over image in Media Browser
Here are 3 links to get you started, your question should be more clear, do you want this to work like twentyten’s header, using a custom theme options field, a category? How to use media upload on theme option page? How can I add an image upload field directly to a custom write panel? Attaching … Read more
You can bind to the ‘ended’ event by targeting the audio element in the playlist: $(‘.wp-playlist .mejs-mediaelement audio’).on(‘ended’, function (event) { console.log(‘ended’); }); The ‘click’ events are just standard, eg: $(‘.wp-playlist-item’).on(‘click’, function (event) { console.log(‘clicked’); });
Here is an example that adds a custom media field named Buy Now. This example saves the value of the custom field on the media overlay screen via ajax, as well as the media edit screen (non ajax). Edit: Added nonce check and sanitization. /** * Add custom field to media. */ add_filter( ‘attachment_fields_to_edit’, ‘wpse256463_attachment_fields’, … Read more
You can just replace the html with a checkbox, ensuring the name of the checkbox is the name of the <input> we’re replacing. You can also change the ‘label’ and the ‘help’ text, (see here for there the filter is fired) – just simply uncomment the appropritate lines and replace the text with your own. … Read more
VERSION 1 will query all the images and give you a count by checking the size of the returned array. VERSION 2 is a much faster method introduced by birgire. // VERSION 1 $images = get_posts(array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘any’, ‘numberposts’ => -1, ‘fields’ => ‘ids’, ‘post_mime_type’ => ‘image/jpeg,image/gif,image/jpg,image/png’, )); echo count($images) . … Read more