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!

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.

Shiba Media Library Plugin Menu.

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.

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 3.2

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.

Media Library Plugin 2.7

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.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.

Related Articles

The main addition to this release is an expansion on the media manager search interface- Posts, pages, and custom post types can now be searched for and added into galleries from the media manager interface. Image search is performed based on title as well as alt text. Shiba Media Library was tested on WordPress 3.5 and 3.6. [Full description of the Shiba Media Library] 1. Expanded Media Manager Search Below is a screen show of the expanded media manager gallery interface, showing [...]

[Most recent Shiba Media Library description.] Add Tags to Images The true power of Media Library Plugin 2.0, comes from image tagging. It allows you to tag your WordPress images or attachments with the existing WordPress tag framework. Once tagged, you can group your images into galleries simply by specifying their tag names. In this way, you can add the same image to multiple image galleries. How to Add Tags First download your images into the WordPress Media Library. [...]

Shiba Media Library is now updated for 3.0. It was tested on WordPress 3.0 and 2.9+. If you are using WordPress 3.0, the plugin will now use the new custom post type feature to create and manage gallery objects. In particular, you will get a new Gallery menu to view and modify gallery objects. All your previous gallery objects should still work seamlessly in the new update, but you will now have the option to set gallery status to draft, in-review, or published. [Full description of the [...]

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.

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.

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:

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.

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. 🙂

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.

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.

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?

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.

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

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.

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.

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.

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.)

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.

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.

Hey! Awesome plugin. One question though: is there a way to batch add tags to images after they’ve already gotten tagged previously, without the system removing previous tags? I.e. could I batch add tags also and not just “Set/Replace Tags”?

Thanks in advance, and please if you can e-mail me your reply. I couldn’t find your contact details anywhere on your website.

Great plugin. I am currently using wp-prettyphoto with the regular WP gallery, however it does not seem to play nice with your plugin. Any thoughts on how I might be able to achieve the equivalent of [gallery link="file"] with this?

I checked out wp-prettyphoto briefly. It does its own specialized handling of images and galleries, so it will not work with the WordPress core gallery system which is what is supported by Media Library Plugin.

Changing the links to file links will probably involve identifying where in the plugin file the links are assigned, and changing a small amount of code so that file links are used instead of attachment links. The plugin author is the best person to point you to the right location.

Otherwise, it may be simpler to switch to some other Lightbox plugin that supports the core WordPress gallery shortcode structure. There are a variety of them.

Using a plugin that supports the WordPress gallery shortcode will give you greater flexibility later on because you can plug and play with a large variety of plugins without having to change any of your shortcodes.

All the images for my imported into WP posts show up (since the original directory/filename didn’t change).

However, in order to have the images in posts show up in category pages, etc., it looks like I need to manually insert the first photo in a post to the media library and re-insert it in order for the image to show up in WP category pages for a keyword, etc.

Is there a way around this? Is there a way to have WP _or a plugin_ identify the first photo (or any photo) in a post, add it to the media library and reinsert it in a post so that it shows up in search results rather than no image at all?

Thanks for all the information. It seems like it could be a plugin conflict.

Are you using a plugin to generate the richer 10-dias-para-o-fim-do-suspense directory structure before %postname%? Or is that a page hierarchy? htt://www.corridadeformula1.com/10-dias-para-o-fim-do-suspense/temporada-2010/

If you are using a redirect plugin, there may also be conflicts because they are all making modifications to the permalink structures.

If you let me know the plugins you are using I could check it out and see if I can duplicate the issue you describe – but some plugin conflicts may be difficult to resolve.

Hi Shiba. I had some problems with Media Library plugin. It has caused a conflict with some pages. E.g. I have a post “temporada-2010” with no images. But page shows an image and no content wich I wrote there. Moreover, page’s title is from another post. It’s very crazy. o_O When I disable your plugin the page works again.

That is probably related to the permalink code. What do you have as your blog permalink and gallery permalink structure? Also is temporada-2010 a post or a page and what is its URL?

Some things to try – 1. Make sure to get the latest media-library zip [It should be version 2.7]. There were some permalink bugs with previous versions. 2. Set the gallery permalink structure to blank – this will default galleries to your post permalink.

Great question. Being able to create more complex queries was something I struggled with while creating the plugin.

There are two options – 1. Do it in the gallery backend and create a ui to allow combinations of various query operators. 2. Do it in the frontend and have it be part of the gallery shortcode.

Ultimately, I decided that querying operations fit much better on the front-end (within the gallery shortcode). For example, check out the Shiba Gallery plugin’s expanded set of shortcodes. Adding in an AND-tag query will not be too difficult in this case.

In fact, I think that the media library’s current limited OR-tag queries should also reside with the gallery shortcode system. However, at the current time, it is necessary to add some ability to use tags in the back-end because there are no front-end expanded shortcode standards yet. But it does make the back-end a lot more messy.

Let me know if you want me to add AND-tag capability into the Shiba Gallery plugin as that would be fairly easy. Alternatively, you can expand the shortcode options used by your current gallery plugin. You probably just need to locate where the get_posts call is made, and add in a new AND-tag query condition.

How I can alter “tags syntax”? By default, galleries show arguments “x” or “y”. But would be very useful change it to show just tags with “x” AND “y”, for example.

I had a F1 blog. I tagged photos with “Chinese Grand Prix” and “2010 Season”. However, Gallery with Chinese Grand Prix will show all seasons who contain that tag. I’d like to show only images who contain both tags.

3) another nice option to add is the ability to deattach the attached file instead delete the attached file (i mean both options are needed)

Hmmm, the plugin should have a detach option. If you go to Media >> Library, the plugin adds a new drop-down menu at the very top and there should be a detach option there that allows you to detach in bulk.

Note – this is an added drop-down menu at the very top of the screen directly under the Shiba Media Library heading.

There are other drop-down menus below – which are the standard ones added by WordPress Core.

I updated your plugin to test the permalinks option and I’ve noticed that the url is the same in my site, even if I add “galleries” into gallery base I think this happens because my index page is a page called “noticias” the galleries now is located at htt://mysite.com/noticias/galleries/gallery-name

Thanks for reporting the bug Pescadito. I have fixed it in the latest release.

i think a NICE feature to add is searh multimedia by post name, so in this way the neet to use a image tag is less important.

Hmmm, I am not sure what you mean. Do you mean search by the post name slug rather than the post title?

and another HUGH feature may be to import images directly from a url folder!

Yeah that was something I considered really early on, but I really wanted a plugin that would work together with the current WordPress media library which assumes that all the images are in the upload folder.

There may be many places in the system that make that assumption, so changing something so fundamental to the core may destabilize many other parts in the system.

Add – after thinking about this some more, I think it will be very possible to do this through the use of rewrite/redirect rules. I will put it on the list for future additions.

1) you are rigth: in library multimedia page, i wish to search multimedia library by post title name! so in this way i haven’t really need of ‘tag’ because i find old pictures by post title and reattach or manage it in any way.

Hi, thank you for this really great plugin (and also explanation article about its creation – it was very helpfull). Is there any chance to simply limit users (subscribers) to see only their files in Media library? And what about showing only files with specified media tag to specified user? I tried to find any hook or filter, but wit no success 🙁 Thank you very much for your help…

Do you want to add the external link only at the front-end? or do you also want to add it on the back-end? If you want to add it to be back-end, I would look into using add_post_meta which will allow you to add new attributes to post objects (i.e. image attachments)

Hello again I’ve updated the plugin, and I see you have supported the post thumbnail option.

I implemented your plugin in a website that I’m working (with a little tweaks in my theme), this is my website www. salesianos.pe (look at “Galeria’s section”) , and I have a question: How I can create a page (archives page) and display into them the galleries or albums? another question is: is posible to modify or personalize the url to handle this? i.e. mydomain.com/galleries (for gallery’s archives) mydomain/galleries/[gallery_postname] (for the overview of the gallery) mydomain/galleries/[gallery_postname]/[current_photo_postname] (single photo)

If you have noticed in my site, the galleries always are in /noticias/ directory, this is because I’ve configured to display a page in home and the post below “noticias” ulr I wish have all galeries below “galeries” directory, same as above explained

I hope you can help me with this, and again sorry for my english and so thank you for the plugin!

How I can create a page (archives page) and display into them the galleries or albums?

The most elegant way to do this, would be to create a category for all the galleries you want to group together and then render the whole category. This would however require a gallery front-end that knows how to deal with categories. I have updated the Shiba Gallery Plugin to render categories, so you may just use that. Or feel free to check out the code and see how to include that in your own gallery front-end.

Another way to do this would be through the back-end – but it is not as elegent and a bit more messy. You could assign the same tag to all the galleries you want to group together, and then create a meta-gallery with the same tag to include all of those galleries. Check the “Only galleries” option on the meta-gallery. This will group all the galleries together – then you can just render the meta-gallery.

In this case, your gallery front-end would need to know how to render gallery type objects. You can also check out the Shiba Gallery Plugin code for an example of how to do this.

is posible to modify or personalize the url to handle this?

Currently, galleries use the same permalink system as posts. You can probably change the permalink structure by writing a hook into the post get permalink function – get_post_permalink. This is the relevant filter call – apply_filters(‘post_type_link’, $post_link, $id, $leavename);

I will add it to the list for a future release although I may not get to it for a while because I am working on another plugin.

You bring up a really good general point which is that tags can be really powerful if it gets greater support in the WordPress backend.

1. Attachment Tags window on Media part shows tagcloud taken only from posts, not from attachments tags.

2. i would like to have posibility to edit tags like is in Posts part, but included tags assigned to attachments.

Yeah – this is something that I have been thinking about. In the latest release of the plugin I have expanded galleries so that it can also include posts, and other galleries. This makes it more natural to have the same tagging system propagate to all the objects.

However, you bring up a good point which is that most of the time, gallery grouping tags will be different from non-gallery grouping tags.

I will look into generating a tag cloud that just contains tags associated with attachments and galleries.

3. Can Search media search also in tags?

That would be a very good functionality to have.

I will also look into expanding Search Media so that it operates both on the title and on tags.

I am currently working on another plugin, but will get back to Media Library once I am done with it. Thanks for your great feedback!

I’m having trouble activating your plugin. I get the following error: Fatal error: Call to undefined function register_post_type() in /public_html/wordpress/wp-content/plugins/media-library-plus/media-library-plus.php on line 264

There seems to be a bug in the “Attach” feature. I was able to detach an image from a page but when I go to re-attach it I’m only able to search for posts to attach it to. Regardless of what radio button is checked the search feature continues to display “No Matches found” for names and post ids that are not actual blog posts. I’m using WP 2.9 if that’s any help.

The approach I would take is to write a gallery plugin that displays WordPress galleries in the way that you describe above. Then you can link your new gallery display function to the WordPress gallery shortcode.

Glad everything worked out well and thanks for your great suggestions!

I’ve been thinking to modify your plugin to get something like that. (custom page for galleries, get by categories, tags, etc, and custom page for single albums)

I will definitely have to code something up that does that and it will fit in really well with making the thumbnail system work on gallery objects.

I think what will work well is to create a new gallery type that will contain posts instead of attachments. Then you can display the gallery of posts/attachment-galleries using the same front-end gallery system. However, with the post_gallery you will be linking to posts instead of to an attachment.

It will be very cool! That is a very awesome idea! 😀

If you want to extend the plugin please feel free to do so.

Thanks Keoshi!

Btw. send me a link of your new gallery when it is up. Would love to check it out.