The purpose of the Shiba Media Library Plugin is to facilitate the manipulation and grouping of images within the existing WordPress image library framework.
[Most recent Shiba Media Library updates]
December, 2015
Tested on WordPress 4.4. No changes needed.September 13th 2015 – Release 3.9.1
- Updated thumbnails column for WordPress 4.3.
- Tested on WordPress 4.3.
When creating permalink structures, care must to taken to ensure that the new structure does not override existing post, page, category, and tag permalinks.
Key Features of the Shiba Media Library Plugin
- Enables image tagging and allows you to group images into galleries by using their tags. Images can also to added manually using the regular media manager interface.
- In addition to images/attachments, galleries may also contain posts and other galleries. In this way, you group not only images, but also posts, galleries, and any combination of these object types. Here are some fun things you can achieve with expanded galleries.
- Easily search for posts, pages, galleries, and more in the expanded media manager interface, and include them directly into a gallery. The days of painfully hunting for IDs are over!
- Freely order images, posts, and pages within a gallery.
- Gallery objects get saved into your WordPress export files. This allows you to keep a backup of your gallery objects, as well as move them from blog to blog.
- Expanded media manager image search that allows you to find images based on title and alt text.
- Expanded search that allows you to find attachments and galleries based on titles, tags, and categories.
- Show the number of posts an image containing an image in the Media >> Library screen.
- View most-used tags for post, attachment, and gallery objects.
- Quick Edit image attachments.
- Adds a new drop-down menu to your existing WordPress Media Library. This menu will allow you to do bulk attachments to both attached and non-attached images.
- Detach a set of images from their post so that they revert back to their unattached state.
![Screen shot of expanded menu functions added to the Media >> Library screen by the Shiba Media Library plugin.](https://shibashake.com/wordpress-theme/wp-content/uploads/2010/03/media-library-plugin1.jpg)
The Power of Galleries and Tags
Gallery objects are stored in the regular WordPress post database. In this way, you get to leverage almost all existing functions that are available for WordPress post objects including displaying your galleries using the WordPress gallery shortcode.
Galleries created with the Shiba Media Library Plugin should also work with other plugins that support the WordPress gallery shortcode.
Example gallery that is rendered using the Shiba Gallery Plugin
This entire plugin operates within the current WordPress Media Library framework so any tag changes will automatically be reflected in your WordPress gallery shortcode results.
If you want to extract images with particular tags using PHP, just include the tags in your WordPress get_posts command.
$args = array( 'post_type' => 'attachment', 'tag' => 'tag-a,tag-b,tag-c' ); $attachments = get_posts( $args );
Why Can’t I Use Tags in the Gallery Shortcode?
The Shiba Media Library addresses the media library back-end and sets up tag links in the WordPress database. I.e., there is a link in the database saying that a particular image is linked to a given tag.
For tags to work in the gallery shortcode, it must also be supported on the gallery front-end – i.e., by the plugin that renders your images. The Shiba Gallery plugin, for example, supports image tags.
However, most gallery rendering plugins do not yet support this extension because it is currently not part of the native WordPress gallery shortcode and is therefore not a standard.
Shiba Media Library Updates
Shiba Media Library 3.9
May 2nd 2015
- Updated image search function (in the Media Manager interface) so that it works for attachment titles, alt text, as well as captions.
- Tested plugin on WordPress 4.2.
Shiba Media Library 3.8.2
September 17th 2014
- Updated the Add-Media templates and interface so that images can be properly selected and inserted.
- Updated the media table in the Edit Gallery screen so that it renders properly in WP 4.0.
- Updated some deprecated functions.
- Tested plugin on WordPress 4.0.
Shiba Media Library 3.8
April 22nd 2014
- Updated plugin directory and url paths to use standard functions instead of constants.
- Updated the Galleries >> Options screen to use the new wordpress update settings system (add_settings_error).
- Fixed a bug in the Media screen that occurs when expanded bulk operations are applied to an empty image set.
- Tested plugin on WordPress 3.9.
Shiba Media Library 3.7.2
Dec 24th 2013
- Fixed some warning messages and make sure post images show up when editing a gallery.
Shiba Media Library 3.7
Sept 26th 2013
- Posts, pages, and supporting custom post types can now be included in galleries from within the media manager interface.
- Expanded search for images to include title as well as alt text.
- Show number of posts that an image is included in (i.e. included in post content). Gallery images are not counted.
- New options page. You may now enable or disable the image quick edit, number of posts, and expanded media manager search functionalities.
- Fixed URL too long bug.
Shiba Media Library 3.6
Jan 7th 2013
- Updated for 3.5.
- Plugin gallery objects now use the id list system introduced in WordPress 3.5. Use the new media manager interface to upload and attach images to gallery objects.
- Fixed quick edit functions.
- Updated deprecated media functions.
- Encapsulated the plugin options page within an object class.
- Fixed gallery and attachment tag links in tag-metabox.
- Added an attachment_link filter so that %category% gallery-permalinks translate properly.
- Properly redirect bulk operations and delete permanently operation in the Edit Gallery screen.
Shiba Media Library 3.4
August 20th 2012
- Updated for WordPress 3.4.
- Added Quick Edit functionality to images. Quick Edit capability is accessible in the Media Library and Edit Gallery screens.
- Image ordering will now be saved in both draft and published modes.
- Updated old javascript functions to use jQuery.
Shiba Media Library 3.3
August 31st 2011
- Added ability to order images within Gallery objects.
- By going into Galleries >> Options, you may now change the gallery shortcode used for viewing a Gallery object.
- Gallery objects now have Shiba Widgets support.
- The “Insert into Post” button should now appear on custom post types.
- Removed image parallelization option. As outlined in Google Page Speed, new browsers now allow more than two concurrent connections per hostname. As such, the image parallelization option is no longer needed.
Shiba Media Library 3.2
February 16th, 2011
- Updated for WordPress 3.1, RC4. Tested on WP 3.0 and WP 3.1,RC4.
- Fixed bulk trash operation on Gallery screen.
- Permalinks now work properly on network activation and deactivation in WordPress Multisite.
- Columns from other plugins are now properly added in the Media Library screen.
Shiba Media Library 3.1
January 17th, 2011
- Updated for WordPress 3.1. Tested in WP 3.0 and WP 3.1,RC2.
- Fixed numerous bugs in the gallery query system. Gallery types should now work properly.
- Cleaned up the plugin so that gallery objects are now always custom post types. As a result the plugin requires WP 3.0 and above. If you are using WP 2.9, then please download Shiba Media Library 3.0.
Shiba Media Library 3.0.3
November 25th, 2010
- Fixed bulk operations in the Google Chrome browser. Shiba Media Library now has its own menu in the media screen.
- Cleaned up the gallery tagging system so that tagged gallery images can now be properly ordered with order, orderby, numberposts, and offset arguments. This makes it much easier to enable gallery paging.
Shiba Media Library 3.0
August 13th 2010
- Added ability to append image tags in bulk as requested by Peder.
- Re-enabled Insert into Post button even for images that are already attached.
Shiba Media Library 2.9
- Shiba Media Library is now updated for WordPress 3.0. It should work in 3.0 and 2.9+.
- All your previous gallery objects should still work seamlessly in the new update.
- Expanded image attachment and detachment functions are now better integrated into the standard WordPress Media Library interface.
- You may set your gallery permalink structure by going into Settings >> Permalinks
- Fixed PHP notices. Thanks to Writemcodeboy for alerting me to this issue.
Media Library Plugin 2.7
- Added in the ability to parallelize your image links. This enables more images to be downloaded simultaneously, and improves page speed.
- Also fixed some bugs associated with the permalink creation function. In particular, I refined the regular expression for gallery attachment images and added more rules for validating the gallery permalink structure.
Media Library Plugin 2.6
- As requested by Keoshi, I have added in the ability to edit your entire gallery permalink structure.
Media Library Plugin 2.5
- I just finished making some large changes to the permalink redirect code. If you are having permalink redirect issues, in particular with your feeds, then please download the latest version.
Media Library Plugin 2.4
- Added most-used attachment and gallery tag views.
- Permalink support and customization for gallery objects.
- Expanded media and gallery search.
- Plugin is cleaner and more secure.
Thanks to A.M. for making many of the great suggestions that went into this plugin update.
Media Library Plugin 2.3
- Expanded gallery objects so that they may contain posts, pages, and other gallery objects; in addition to image attachments.
- You may now assign thumbnails to galleries. This uses the Post Thumbnail system introduced in WordPress 2.9, so you will need at least version 2.9 and a gallery front-end that knows how to render posts to fully realize the power of this feature.
- You can now navigate to gallery objects, just like you do with attachments. Gallery object pages are rendered using the gallery shortcode.
** Thanks to Keoshi for making many of the great suggestions that went into this plugin update.
Media Library Plugin 2.2
- Fixed a bug in Release 2.1 where Trash links for posts and pages no longer work properly. This is an important bug fix so please download the latest version of the plugin.
Media Library Plugin 2.1
- Added bulk-actions, search, and date filter to the Manage Gallery screen. Now you can perform the same menu view operations on galleries as you can with posts and pages.
- Integrated the Manage Gallery menu with the WordPress Trash system. Now you can move galleries to the trash, untrash, or delete them permanently.
- Fixed various bugs with gallery links, trash links, as well as image tags. The gallery and tag system should now work a lot more smoothly.
Media Library Plugin 2.0
- Allows you to tag your images. Through tagging, you can include the same image into multiple galleries.
Media Library Plugin 1.0
- Allows you to re-attach multiple images to any post from the Media Library panel.
- Enables bulk image detachments.
- Works on WordPress 2.8
Great plugin. I think it desperately needs a user manual though. I have to explain it to a site editor and it’s just too complicated. It’s easier for them to use the good old upload, so it’s a hard sell.
Kind regards,
VirtualFlavius
If you let me know which tasks are especially difficult to perform, I will look into writing up a tutorial, or trying to improve the user interface. The more detailed, the better.
I noticed a small problem in my installation, my setup is as follows:
I have two custom post_types event and artist
The problem I am experiencing is that for example
I create an event with the title “Valentine” this gives it a post slug of “valentine” .
Then if I create a custom artist post with the name artist name and upload images to the artist custom post_type and tag them with the name of an event post_title “Valentine” the medialibrary gives the new tag a slug with a valentine-2
This causes problems when searching for attachments by tag as this way searches for the tags by slug… so when I search for attachments with the slug ‘valentine’ it returns nothing as the attachment was given the slug ‘valentine-2’
so the way I have gotten around this is…
$title_tag_image = get_the_title();
$term = get_term_by('name',$title_tag_image,'post_tag','ARRAY_N');
$get_tagid = $term[0];
global $post;
$args = array( 'numberposts' => '-1','post_type' => 'attachment',
'orderby' => 'name',
'order' => 'ASC',
'tag_id' => $get_tagid );
What do you think about this?
Is there an easier way?
And of course thank you for creating this plugin, it has helped a lot..
Keep up the good work
What you did looks good.
In the plugin I tried to use as much WP core stuff as I can in order to leverage existing WP functions, and existing plugins. As a result, the media library plugin uses the WP core post_tag and slug interface. There are some quirks, but staying compatible with WP core has a lot of advantages.
Tried out your plugin.
I turned it off immediately because it removed the smush.it column from the media library. So I suppose you are doing an alternate rendering of the whole table? I don’t have time to look into how columns are suppose to be added to the media library by plugins without conflicting with other plugins.
I just thought it was something you might want to know.
I have fixed it. Thanks for letting me know.
Hello,
I’m using your plugin but the bulk actions of the Media Library do not work. I select the images using the checkbox, but they do not delete. I have to do it individually. Also tags are not being created or added by the bulk drop down.
Can you help?
Thanks, Lewis.
Hello Lewis,
I need a bit more detail to try and debug this. When you click on the Apply button, what happens? Does the screen reload? Do you get any errors in the html page?
What version of WP are you running? Are you running other plugins?
Hi. I install your gallery and media library plugins on just about every site I work on. At them moment I am working on a client site http://babiesnbumps.com which is using the new 3.1 release candidate. It appears that the bulk functions in the library are not working. I was able to add the tags manually, of course, but I haven’t figured out how to detach images from posts…besides, I really like the bulk functionality. I’m hoping this is something you don’t know about yet, and that you will be able to quickly spot the trouble. If you don’t have a 3.1 site up yet I can give you admin access, just ask.
Hello Chuck,
Thanks for letting me know. I haven’t had the time to test out my plugins on 3.1 yet. I am currently in the middle of some art and writing projects so I will probably work on 3.1 updates after that.
If you are in a hurry and want to look into this yourself, the issue is probably related to updates in the upload.php file. In Media Library, the relevant file is shiba-library-menu.php.
Happy New Year!
Butch Add tags don’t work for me.
What happens when you try to add tags in batch? Does the screen reload but nothing gets updated? Do the other actions (detach, reattach, replace tags) work? Are you using other plugins while testing this out? To debug the issue I need a bit more detail about the exact steps you took, the results, and your environment.
I found the problem. I had wordpress open in Chrome and Firefox at the same time.
Thankyou for your reply though!
Thank you for your great plugins
can you explain “Gallery type” option (Any/Only Attachments/Only Posts/Only Galleries)?
Hello Mike,
Galleries can contain not only images (attachments), but they can also contain posts and other galleries. You can include these objects using tags.
This article gives some examples on how post galleries and gallery galleries can be useful –
http://shibashake.com/wordpress-theme/who-says-wordpress-galleries-should-only-contain-pictures
I’ve found an error which occurs with More Fields 1.5.3 (not the latest version admittedly because the update removes some functionality I need) which is visible in the Console in Chrome
Fatal error: Call to a member function init_admin_3_0() on a non-object in /home/user/example.com/wp-content/plugins/shiba-media-library/shiba-media-library.php on line 129
This happens when I try to add a new post or page and occurs in more-fields-write-js.php.
Any idea what the problem is?
Sounds like some classes are not getting properly loaded/created in the AJAX interface. Difficult to say for sure. As you know, plugin conflicts are difficult to debug because it requires working knowledge of all the plugins involved.
detaching images does not work for me, latest version of wordpress.
tick the image goto detach from the drop down, nothing happends at all.
sigh.
Did you click on Apply?
After you click Apply, what happens? Does the page reload? What other plugins are you using?
I need a bit more information to locate the problem.
Here is my problem. I can get the same image in multiple categories with this plugin, (awesome!) but I can’t figure out a way to order them within each category. Say I want an image in the category Architecture to show up #1, but I want it to show up #5 in the France category. Same image, different order depending on which category it’s in.
Would be nice if you could order the images when you see them in the gallery, but alas I cannot find a way. Any help?
Yeah manual ordering is currently not part of the plugin. I think it would be a very nice feature to have, but it is one of those things I haven’t gotten to. Too many projects, too little time. 😀
For some reason, I am unable to order the images in my gallery. I am using this code: [gallery id="589" order="ASC" orderby="title"]
I have tried multiple variations such as:
[gallery id="589" orderby="title DESC"]
Nothing works, doesn’t change the order of my pictures. Am I missing something here?
I also cannot order the images manually in a post gallery unless I attach them, which I can’t because I want the same image in multiple categories. What can I do so that I can be able to order the images manually?
This depends on the front-end gallery rendering plugin you are using. Some front-end plugins may not support order and orderby.
I am using Lightbox Gallery by Hiroaki Miyashita. The ordering works when I disable the Media Library plugin, so it is not that.
Do these two plugins not work well together? Is there any way to order my images?
Now that I look at the code I remember that I did not put in a function to sort the images returned by tags.
If you only want to sort the images by title then you can do the following in the short-term –
1. Go into shiba-media-library.php and look for the line –
It should be on line 543.
2. Add in your order and orderby arguments under it, i.e. replace it with –
You are awesome! This works great, thanks!