For a manual installation via FTP:
- Upload the 'wp-media-library-categories' directory to the '/wp-content/plugins/' directory
- Activate the plugin through the 'Plugins' screen in your WordPress admin area
- A dropdown of categories will show up in the media library
To upload the plugin through WordPress, instead of FTP:
- Upload the zip file 'wp-media-library-categories-installable.zip' on the 'Add New' plugins screen (see the 'Upload' tab) in your WordPress admin area and activate.
- Activate the plugin through the 'Plugins' screen in your WordPress admin area
- A dropdown of categories will show up in the media library
How to use separate categories for the WordPress Media Library (and don't use the same categories as in posts & pages)?
By default the WordPress Media Library uses the same categories as WordPress does (such as in posts & pages). If you want to use separate categories for the WordPress Media Library add this code to the file functions.php located in your theme or child-theme:
/**
* separate media categories from post categories
* use a custom category called 'category_media' for the categories in the media library
*/
add_filter( 'wpmediacategory_taxonomy', function(){ return 'category_media'; } ); //requires PHP 5.3 or newer
Or if you have an older PHP version:
add_filter( 'wpmediacategory_taxonomy', create_function( '', 'return "category_media";' ) ); //requires PHP 4.0.1 or newer
How to use category in the [gallery] shortcode?
To only show images from one category in the gallery you have to add the 'category' parameter to the [gallery] shortcode.
The value passed to the 'category' parameter can be either the category slug or the term_id.
[gallery category="my-category-slug"]
Or with term_id:
[gallery category="14"]
If you use an incorrect slug by default WordPress shows the images that are attached to the page / post that is displayed. If you use an incorrect term_id no images are shown. Aside from this behavior, the [gallery] shortcode works as it does by default with the built-in shortcode from WordPress (see the WordPress gallery shortcode codex page). Some plugins that also use the gallery shortcode (like Jetpack) disable the category option on the gallery shortcode.
Can I upgrade from the free version to the premium version without problems?
Yes, you can delete the free version and then install the premium version. All assigned categories will be remembered.
2.1.2
- Support for WordPress 4.4
- Fix compatibility with Advanced Custom Fields and some other plugins.
2.1.1
- Support for WordPress 4.2
- Security enhancement for add_query_arg XSS.
- Remember selected category.
2.1.0
- Support for WordPress 4.1
- Add category checkboxes to attachment details on insert media popup.
2.0.9
- Support for WordPress 4.0
- Added categories filter to media grid view.
- Security enhancement.
- Resolved conflict with UberMenu plugin.
2.0.8
- Improved compatibility with other plugins that use the [gallery] shortcode.
- Remember author when changing categories.
- Added example code in the FAQ for creating seperate categories with PHP 4. Read here for a howto
2.0.7
- Added support for category to the default WordPress shortcode gallery. Read here for a howto
- Remember ordering when changing categories.
- Improved code styling to match WordPress code standard even more strictly.
2.0.6
- Stay on active page in the media library when changing categories.
2.0.5
- Added hierarchical display of the filter menu when inserting media.
- Fixed PHP 5.4 strict warning.
2.0.4
- Fixed alignment of filter for custom categories in WordPress 3.9
2.0.3
- Fixed error message which in some cases appears when updating multiple items at once.
2.0.2
- Fixed media count on the categories page.
- Added item count in the category filter dropdown when using separate categories for the WordPress Media Library.
- Support for WordPress 3.9
2.0.1
- New images are now added to the default category (if a default category exists). In most cases the default category is "Uncategorized".
2.0
- By default the WordPress Media Library uses the same categories as WordPress does (such as posts & pages). Now you can use separate categories for the WordPress Media Library. Read here for a howto
- Fixed bug where in some rare cases the filter by category didn't work
Before 2.0
- Category options & management in the Media Library
- Category filter when inserting media
- Category filter when creating galleries
- Taxonomy filter
- Support for bulk actions (to add / change or remove categories from multiple media items at once)
- Internationalisation
- Extensive documentation