Media Library Categories - Version 1.0

Version Description

  • Initial release.
Download this release

Release Info

Developer jeffrey-wp
Plugin Icon 128x128 Media Library Categories
Version 1.0
Comparing to
See all releases

Version 1.0

Files changed (2) hide show
  1. index.php +24 -0
  2. readme.txt +25 -0
index.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: media library categories
4
+ * Description: Adds the ability to use categories in the media library.
5
+ * Version: 1.0
6
+ * Author: Jeffrey-WP
7
+ */
8
+
9
+ /** register taxonomy for attachments */
10
+ function wpmediacategory_init() {
11
+ register_taxonomy_for_object_type( 'category', 'attachment' );
12
+ }
13
+ add_action( 'init', 'wpmediacategory_init' );
14
+
15
+ /** Add a category filter */
16
+ function wpmediacategory_add_category_filter() {
17
+ $screen = get_current_screen();
18
+ if ( 'upload' == $screen->id ) {
19
+ $dropdown_options = array( 'show_option_all' => __( 'View all categories', 'wpmediacategory' ), 'hide_empty' => false, 'hierarchical' => true, 'orderby' => 'name', );
20
+ wp_dropdown_categories( $dropdown_options );
21
+ }
22
+ }
23
+ add_action( 'restrict_manage_posts', 'wpmediacategory_add_category_filter' );
24
+ ?>
readme.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: jeffreywp
3
+ Tags: category, categories, media, library
4
+ Requires at least: 3.0.1
5
+ Tested up to: 3.7.1
6
+ Stable tag: 1.0
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Adds the ability to use categories in the media library.
11
+
12
+ == Description ==
13
+
14
+ Adds the ability to use categories in the media library. When activated a dropdown of categories will show up in the media library.
15
+
16
+ == Installation ==
17
+
18
+ 1. Upload the mediacategory plugin
19
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
20
+ 3. A dropdown of categories will show up in the media library
21
+
22
+ == Changelog ==
23
+
24
+ = 1.0 =
25
+ * Initial release.