Tag Info

New answers tagged

0

I found nothing better than: // switch to attachment browser wp.media.frame.content.mode('browse'); // refresh attachment collection wp.media.frame.content.view.views._views[".media-frame-content"][0].views._views[""][1].collection.props.set({ignore:(+(new Date()))}); Feel free to add proper way of doing this.


3

Yes, the plugin @Squideyes suggests you, is perfectly fine, and should do the trick. However, I don't like the link-to-plugin only answers, so here the mine. If you upload the file to a subfolder of the WordPress uploads folder (by default wp-content/uploads, but can be easily changed) than convert a file from there to an attachment post is pretty easy via ...


0

Give this plugin a go: http://wordpress.org/plugins/add-from-server It allows you to upload the file via an FTP and then import it via admin. The plugin registers the media file to the database.


0

I would recommend using this plugin: http://wordpress.org/plugins/enhanced-media-library It allows you to fully manage your media files with the ability to add taxonomies (categories and tags). I would avoid renaming or creating new directories manually within the uploads directory on your server. It's important that new upload directories are registered ...


0

Thanks for a great solution. If in any case someone is looking for hiding images on the Add Media Popup and Wordpress media page, also included optional hiding of posts from other users. Feel free to check this one : Hide WordPress Posts and Media uploaded by other users


0

I'm adding this in as an option I didn't see listed above... W3 Total Cache (link below). https://wordpress.org/plugins/w3-total-cache/ I use this because it has a wide range of CDNs it supports, including a generic setting, and will also take care of offloading media files, theme files and other core files that don't necessarily need to be served from ...


0

Another option - wpengine.com have a pretty stellar repulation as a dedicated WordPress hosting company and they recently released what promises to be seamless integration with Amazon S3 for large storage needs. It might be the best of both worlds. I'm not affiliated in any way - but I am thinking of trying it myself.


1

Even if is not very flexible filter you can use the gettex hook. Only be aware that this filter runs for every string being translated, so can affect performarce if over-used. To narrow the performance impact you can add it only of admin footer, and remove it just after had use it: add_action('admin_footer', function() { add_filter( 'gettext', ...


0

This one is much easier to add on the functions.php and works like charm : function hide_media_by_other($query) { global $pagenow; if( 'upload.php' != $pagenow || !$query->is_admin ){ return $query; } if( !current_user_can( 'manage_options' ) ) { global $user_ID; $query->set('author', $user_ID ); } return $query; } ...


0

Thanks @timocouckuyt, that works fine but you also need this one for the /wp-admin/upload.php link : add_filter('pre_get_posts', 'hide_posts_media_by_other'); function hide_posts_media_by_other($query) { global $pagenow; if( 'upload.php' != $pagenow || !$query->is_admin ){ return $query; } if( !current_user_can( 'manage_options' ) ) { global ...


0

The main thing I didn't like about most of these solutions is that it was blinking on alot of screens, and if you clicked on Featured Image it would revert back to showing all images. After some searching I think found a permanent solution (Thanks to √únsal Korkmaz) which looks like it solves these problems. The code: add_action( 'admin_footer-post-new.php', ...


0

I'm not sure if this answers the question directly but I was trying to get a "URL" column on the Media Library page (to avoid clicking the edit link every time...) and found this code snippet which does exactly that. I played with it a little to get it to sort the URLs alphabetically and to strip the domain, to improve my workflow a bit more. Check it out: ...


1

I am working on something similar. This is for a podcast upload meta-box. Returns the url to the file. Here is what I have so far: /*******************************************************Podcast Meta-boxes *******************/ //Add Metabox add_action( 'add_meta_boxes', 'add_upload_file_metaboxes' ); function add_upload_file_metaboxes() { ...


0

This plug in is exactly what you are searching for: Media File Manager Advanced. Just check it out at:http://wordpress.org/plugins/media-file-manager-advanced/ It allow you to create folders and subfolder with a nice interface. Then on the new/edit post page it adds a button to insert a picture from any folder you've created!


0

I think the best plug in to solve this problem is Media File Manager Advanced. I let you check the description of it at: http://wordpress.org/plugins/media-file-manager-advanced/


0

You can use a tax query for all "Reference Type" terms, which will retrieve all attachments that have at least one "Reference Type" term. $rt_media = new WP_Query( array( 'posts_per_page' => -1, 'post_type' => 'attachment', 'tax_query' => array( array( 'taxonomy' => 'reference_type', ...


1

Here is simple function to create your own sub directory for every upload. function kv_custom_image_dir( $pathdata ) { $subdir = '/uploads_img'.$pathdata['subdir']; $pathdata['path'] = str_replace($pathdata['subdir'], $subdir, $pathdata['path']); $pathdata['url'] = str_replace($pathdata['subdir'], $subdir, $pathdata['url']); ...


2

Using Google Analytics will only collect clicks on your web pages, it will not count hits from external sites, RSS feeds, apps, etc. For this you'll need to utilise your server log files. AWStats is good for this but it is overkill for a single file - you'd need to log in, set the timeframe to a large span, then browse for your file... it would be much ...


1

You could add an ID as post_parent to the attachment of the header image via wp_update_post() (even though this seems to be a very very hacky way to do it!) The tricky part is to get the ID out of the attachment URL; fortunately Rarst solved this issue long time ago, so you can manually add get_attachment_id() to your functions. Next you'll have to assign ...



Top 50 recent answers are included