Changing path for media upload folder in wordpress multisite

This has been answered Hook filter to change wp_upload_dir() path in multisite , including code to hook into the upload_dir hook. Note that there is a setting in wp-config.php for the ‘base’ upload folder define(‘UPLOADS’, ‘wp-content/myimages’); So with this code, the uploads folder is wp-content/myimages. But, that changes the place WP looks for the media, … Read more

Can I hide certain upload folders in media library [duplicate]

Perhaps a bit quick and dirty, but this should work: function media_library_hide_dlm_downloads($where) { if(isset($_POST[‘action’]) && ( $_POST[‘action’] == ‘query-attachments’)) { $where .= ‘ AND guid NOT LIKE “%wp-content/uploads/dlm_downloads%”‘; } return $where; } add_filter(‘posts_where’, ‘media_library_hide_dlm_downloads’); Read more about the posts_where filter.

Post edit – Media Library – Only get images from current post

This will lock uploads to “Uploaded to this post” and will not show “All media items” or other options in WordPress media panels. Add this code to your function.php file add_action( ‘admin_footer-post-new.php’, ‘firmasite_mediapanel_lock_uploaded’ ); add_action( ‘admin_footer-post.php’, ‘firmasite_mediapanel_lock_uploaded’ ); function firmasite_mediapanel_lock_uploaded() { ?> <script type=”text/javascript”> jQuery(document).on(“DOMNodeInserted”, function(){ // Lock uploads to “Uploaded to this post” jQuery(‘select.attachment-filters … Read more

add mediaelement.js plugins into WordPress video player control bar

You can alter the mediaelement.js feature-set using the mejs_settings hook. Settings Overview Defaults are: playpause, current, progress, duration, tracks, volume, fullscreen. Add the plugin to the array as needed to extend the features. add_filter(‘mejs_settings’, function ($settings) { $settings[‘features’] = array(…,’jumpforward’); return $settings; }); Make sure to enqueue the plugin itself: wp_enqueue_script( ‘mejs-plugin-name’, ‘path_to_plugin_file’, array(‘wp-mediaelement’), null, … Read more

Audio file’s length (duration) is missing from Attachment Details in Media Library [closed]

I found that this issue could be overcome by opening the mp3 file in the excellent Linux/Windows application Mp3 Diags and applying the Rebuild VBR Data transformation. It discards the file’s Xing header and attaches a new one. After doing this, the files’s duration and bitrate are listed in it’s Attachment Details when it is … Read more

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