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.
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.
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
Jason says
Hi!!!
I thought it already had the folder setup function… so I guess we will need to wait! 🙂 Looking forward to it!!!
Jason
Shelly says
Just curious – does this gallery only work for administrator-level users? I’ve tried everything I can to get this to work for an editor-level user, and I cannot. It only seems to work if I set them as an admin.
I’ve also tried changing the “10,” (in stuff like the add_filter section for admin) to an “8” in the shiba-media-library.php file, but still no go.
From what I can tell, you’re using current_user_can and they have either delete_posts or edit_posts capabilities (which editors have both of) but I still cannot get my editors to see the menu items to manage and add galleries.
Shelly says
Nevermind! I found it. In shiba_media_library.php, around line 217 (in function add_pages() ) there’s “administrator” settings for the three menu items. I changed that to “editor” and they showed up.
Would it be possible to include this in a future release?
ShibaShake says
Thanks for letting me know Shelly. I can definitely make those changes and include it in the next release.
Shelly says
Actually, I was wrong. If I change it to ‘editor” then it shows the gallery options ONLY for the editor – the administrator is locked out. Which is the weirdest thing I’ve ever seen. I’ve been trying for the last two days to figure out why it’s doing that, to no avail. Usually, if you set someone to have access at Editor level, then the admin will also have access – but with this – nope. So weird.
Shelly says
Okay, well, I found a workaround. It doesn’t *seem* to be messing with how the plugin works, so hopefully there’s no adverse effects that I should be aware pf. Anyway, basically, I replaced the add_page() function (in shiba-media-library.php) with this:
function add_pages() {
// Add a new submenu under Options:
$this->add_gallery = add_media_page(‘Add Gallery’, ‘Add Gallery’, ‘editor’, ‘shiba_add_gallery’, array(&$this,’add_gallery_page’) );
$this->add_gallery = add_media_page(‘Add Gallery’, ‘Add Gallery’, ‘administrator’, ‘shiba_add_gallery’, array(&$this,’add_gallery_page’) );
$this->manage_gallery = add_media_page(‘Manage Gallery’, ‘Manage Gallery’, ‘editor’, ‘shiba_manage_gallery’, array(&$this,’manage_gallery_page’) );
$this->manage_gallery = add_media_page(‘Manage Gallery’, ‘Manage Gallery’, ‘administrator’, ‘shiba_manage_gallery’, array(&$this,’manage_gallery_page’) );
$this->media_tools = add_media_page(‘Media Tools’, ‘Media Tools’, ‘administrator’, ‘shiba_media_tools’, array(&$this,’media_tools_page’) );
add_action(“admin_print_styles-$this->add_gallery”, array(&$this,’add_gallery_admin_styles’) );
add_action(“admin_print_scripts-$this->add_gallery”, array(&$this,’add_gallery_admin_scripts’) );
add_action(“load-$this->add_gallery”, array(&$this, ‘add_gallery_on_load’));
}
Now the code has the menus on both the editor and admin accounts, and the Media Tools is set for admin only (per your next comment)
Hopefully that helps someone else 🙂
Now, if I could just get the captions to show up in the Gallery – man I love puzzles 😉
ShibaShake says
Hi Shelly,
What version of WP is your client using? It sounds like you may not have the latest version of the plugin that uses custom post types. I think that may fix the add_page issues.
ShibaShake says
Now that I think about it some more, perhaps Media Options should be an administrator menu. It does blog wide settings which I don’t imagine an editor should have access to. What do you think?
Shelly says
Well, I can say this: I am the web developer (I’m the one creating the theme) and I’m subbing for the actual design house. WE want admin-level access, because the client – even though they own the site, does NOT need to be mucking around in the plugin and theme files. SO we have them set as “Editor” so they can do galleries, images, uploads, write posts, add users – all that stuff that an editor can do.
I do think you’re right though – the “Media Tools” should be reserved for Admins (I don’t see how it would be helpful to them when all they are doing is managing content) but the rest, they should have access to.
Thanks! 🙂
aziwaan says
Hi There,
Im trying to use the gallery plugin but when I paste your shortcode in a post [media-library-gallery] it just renders as text.
Any ideas what mught be causing this, im running WP locally out of the box.
Thanks in advance
ShibaShake says
Hello aziwaan,
The plugin works with the standard WP gallery shortcode, [gallery].
Rus Miller says
I believe there is a small bug in shiba-media-library.php, which destroys any existing content while simultaneously preventing us from displaying gallery objects programmatically in templates by defining our own gallery shortcode, i.e.,
ID).'" link="file" columns="4"]')); ?>
—————————–
Around Line 440:
$content = "[gallery]";
I believe should be:
if($content != '') $content = "[gallery]";
—————————–
I’m not sure if $content is empty in the default case but this works for me in my template.
Also, this is a powerful plugin, thanks for your contribution, but the documentation leaves a lot to be desired. I’m still not sure how it could be used as intended, and some usage examples/tutorials would be very welcome. I’ve only used it up to now in order to detach images from posts (that functionality alone is great!). I know it does other things but trying to figure out what and how is very frustrating. Anyway, I know you’ve put a lot of time into it and I’m grateful, but it would be nice if we could actually do all the things you intended. 🙂
Rus Miller says
rrrrrrrrrrrr. My code is being stripped out. If you want my fix, please email me.
ShibaShake says
In addition to the bulk attach and bulk detach capabilities, the plugin addresses three other key areas –
1. Creation of gallery objects. Gallery objects allow you to group images together without cluttering up your post space. You can set your own gallery object permalink (Settings >> Permalink).
2. Tag images. Image tagging can be very powerful and will allow you to attach the same image to multiple galleries.
3. Parallelize image links. This allows you to spread your image links over multiple domains and sub-domains so that more images can be loaded simultaneously and thus enhance page speed.
Let me know which of these areas needs more explanation and which areas are unclear and I will add that on my to-do list. Thanks.
Angela says
Plugin works great with 3.0 for detaching images. Thank you!
iMenn says
Dear Shiba,
Thank you so much for this great plugin. It’s the solution I was dreaming for.
Let me ask one question. How can I set amount of picture in the gallery (create pagination of pictures)? Or I should write query_post myself?
I create the catalog from Page in http://www.dkcurtain.com/portfolio/
and create Tag Gallery in sidebar, such as http://www.dkcurtain.com/gallery/pleat-curtain/
Thank so much in advance 🙂
ShibaShake says
That would depend on the gallery plugin you are using to render the images. If you are rendering the images yourself, then yes, you would include the number of images you want to show within the get_posts or query_posts function call.
iMenn says
Thank so much 🙂
I’ve never rendered the images myself. Could you please suggest some links that have example code?
ShibaShake says
If you are not familiar with image rendering, it will be easier to just use a gallery plugin and then extend the plugin to deal with pagination. Just look for the call to get_posts or query_posts with post_type = attachment. That is where the images are retrieved. Then you can use paginate_links to paginate the image results.
http://shibashake.com/wordpress-theme/wordpress-query_posts-and-get_posts#paginate
iMenn says
Thank you so much 🙂 I’ll try 😀
Bolekz says
hi,
i am trying your plugin on a wp-multisite and running in 1 issue.
i am trying to have the same gallery for all the blogs, so i can use the same images on every blog, mainly because i have one blog that fetches the all the posts from the others.
my problem is, that i can create galleries per blog, but then i can not see them on the main blog.
is it possible to have one gallery path for all the blogs?
thanks and keep the good work up, your plugins are amazing.
ShibaShake says
In the same way that you can fetch posts from the different blog tables you can also fetch galleries from the different blog tables. The gallery objects are stored as a custom post type so they reside in the same tables as posts (i.e. wp*_posts). The gallery objects have post_type = gallery.
vache says
hello, firstly great plugin
i have a small issue
with the addition of custom post types a small problem arises with WordPress Media Library Plugin
this function “add_insert_into_post_button($form_fields, $post)”
only has post and page as a post type, if you can please add a way to have other post types as well, meaning all the post types that are being used,
or you can use a setting page
idk whats best, for now i have manually added the other post types i am using that need the insert into post button
thanks vache
ShibaShake says
I can probably add in a hook to allow the addition of more post types. I’ll put that on my to-do list.
Dewey Bushaw says
Hey Shiba,
It looks like line 18 in shiba-mlib-helper.php is breaking in 3.1.1
add_filter(‘attachment_fields_to_edit’, array(&$this, ‘add_insert_into_post_button’), 10, 2);
The “Insert into Post” is not showing up unless you comment this line out.
Thanks
ShibaShake says
Is it not showing up for custom post types? If so, here is the fix –
http://shibashake.com/wordpress-theme/media-library-plus-plugin/comment-page-2#comment-3480
I will fix this in the next release.
Shelly says
I’m curious – I’m having an issue getting Editor-level users to Add and Manage galleries. Apparently only administrators can do this – which is weird, because in your files, I see references to allow anyone who can edit/delete posts to have access to this stuff, which my editors *do* have access to. Am I missing something? Because I really need my editors to be able to add to and manage the galleries.
ShibaShake says
Hmmm, there may be some condition somewhere that requires admin privileges. I will look into it.
ShibaShake says
Hello Shelly,
I just tested the plugin with Editor permissions, and I was able to create and update galleries. What error messages are you getting in Editor mode? What operations cause the error? What theme and plugins are you using? The more detail you can provide, the better, so that I can duplicate the bug.
If you can, try testing things out using TwentyTen with no plugins and see if you get the same errors.
Shelly says
So sorry I haven’t responded – it’s been crazy down here! I just came back to check to see if you have updates (and you do), and I saw this 🙂
I have no issues seeing it with Editor level permissions – it’s having Editor level and *above* accessing it. For some reason, I can make Editors access the Galleries just fine, but it won’t allow admins. (And yes, I did attempt it with Twenty Ten – as well as Default – with all plugins shut off). I just upgraded to your newest versions though (Media Library 3.0.3 and Gallery 3.3.7 on WordPress 3.0.3) and now everyone’s accessing everything as they should. But now we have a fun new issue: The tagged images aren’t showing up in the Galleries. They are not becoming associated with the Galleries we’ve set up in the Shiba Gallery section. For example we have images tagged with “dogs”, and set up a Gallery titled “Dog Images”, set to pull in “Any” with the tag of “dogs”, and although the galleries are being created, nothing is being associated with them, and therefore not showing up on the site.
I’m getting ready to troll through and see if something is conflicting, but as it stands right now, that’s what going on.
Shelly says
Okay – quick update. Using TwentyTen, and no other plugins activated save Shiba Gallery and Shiba Media Library – and the attachments still aren’t being associated with the Galleries. Very odd. There’s no messages or anything – everything appears to be working as it should, but when I go to the “Galleries > Galleries” page in the admin area, under the “Images” column, everything says “0” – so nothing is being associated with the galleries, even though it’s set to pick up tagged images. (Spelling and case have been checked.)
Shelly says
Okay, I think I’ve found the issue. You’re assuming my table prefix is the default (wp_). It is not. The error in my logs pointed to this – it reads like so:
[22-Dec-2010 16:35:48] WordPress database error Table ‘mytable.wp_term_relationships’ doesn’t exist for query SELECT DISTINCT myprefix_posts.* FROM myprefix_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) INNER JOIN wp_terms ON (wp_term_taxonomy.term_id = wp_terms.term_id) WHERE 1=1 AND myprefix_posts.post_parent = 1053 AND myprefix_posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘gallery’) AND (myprefix_posts.post_status ‘trash’ AND myprefix_posts.post_status ‘auto-draft’) ORDER BY menu_order,dtc_posts.ID ASC made by require, require_once, include, the_content, apply_filters, call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, gallery_shortcode, apply_filters, call_user_func_array, Shiba_Gallery->parse_gallery_shortcode, Shiba_Gallery->parse_shiba_gallery, get_children, get_posts, WP_Query->query, WP_Query->get_posts
so it looks like there might be a couple of “oopsies” in leaving the default prefix assumed in the code somewhere. So far, I’ve only found one instance on line 466 of shiba-media-library.php, but I’m still trolling through to see if I can find more, since fixing that one didn’t fix the issue yet.
ShibaShake says
Opps, my bad. I will work on fixing it. I think this is the only spot because it is the only thing I changed recently, but please let me know if you find more. Thanks!
Merry Christmas and Happy Holidays!
ShibaShake says
Ok I fixed all the instances in shiba-media-library.php. Please test out the new zip (3.0.5) and let me know how it goes. Thanks.
Shelly says
Thanks! I’ll give it a go now.
And since I have you here, I thought you should know that replacing the Lytebox option (in the Gallery plugin, I know this isn’t the “Gallery” plugin section, sorry!) with the SlimBox probably wasn’t a terrific idea. Turns out Slimbox will not resize images if they are larger than the browser window screen. I even looked at SlimBox’s documentation, and they specifically spell out that it won’t do this. I *must* have it do that, since the images we’re using are minimum sized 3200 pixels in width. Lytebox *would* resize.
I appreciate that Slimbox is a lighter script, but I still think Lytebox should be an option, since it will resize images. Just thought I’d mention it.
But thanks for the fix! And hope you had a great Christmas 🙂
ShibaShake says
Thanks for letting me know Shelly. I will put it back in on the next update.