Version Description
- Add a link to media categories on the plugin page
Download this release
Release Info
Developer | jeffrey-wp |
Plugin | Media Library Categories |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1
- index.php +19 -7
- readme.txt +4 -1
index.php
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name:
|
|
|
4 |
* Description: Adds the ability to use categories in the media library.
|
5 |
-
* Version: 1.
|
6 |
* Author: Jeffrey-WP
|
7 |
*/
|
8 |
|
@@ -14,11 +15,22 @@ add_action( 'init', 'wpmediacategory_init' );
|
|
14 |
|
15 |
/** Add a category filter */
|
16 |
function wpmediacategory_add_category_filter() {
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
}
|
23 |
add_action( 'restrict_manage_posts', 'wpmediacategory_add_category_filter' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
?>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: Media Library Categories
|
4 |
+
* Plugin URI: http://wordpress.org/plugins/wp-media-library-categories/
|
5 |
* Description: Adds the ability to use categories in the media library.
|
6 |
+
* Version: 1.1
|
7 |
* Author: Jeffrey-WP
|
8 |
*/
|
9 |
|
15 |
|
16 |
/** Add a category filter */
|
17 |
function wpmediacategory_add_category_filter() {
|
18 |
+
$screen = get_current_screen();
|
19 |
+
if ( 'upload' == $screen->id ) {
|
20 |
+
$dropdown_options = array( 'show_option_all' => __( 'View all categories', 'wpmediacategory' ), 'hide_empty' => false, 'hierarchical' => true, 'orderby' => 'name', );
|
21 |
+
wp_dropdown_categories( $dropdown_options );
|
22 |
+
}
|
23 |
}
|
24 |
add_action( 'restrict_manage_posts', 'wpmediacategory_add_category_filter' );
|
25 |
+
|
26 |
+
/** Add a link to media categories on the plugin page */
|
27 |
+
function wpmediacategory_add_plugin_action_links( $links ) {
|
28 |
+
return array_merge(
|
29 |
+
array(
|
30 |
+
'settings' => '<a href="' . get_bloginfo( 'wpurl' ) . '/wp-admin/edit-tags.php?taxonomy=category&post_type=attachment">' . __('Categories') . '</a>'
|
31 |
+
),
|
32 |
+
$links
|
33 |
+
);
|
34 |
+
}
|
35 |
+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wpmediacategory_add_plugin_action_links' );
|
36 |
?>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ 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.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -21,5 +21,8 @@ Adds the ability to use categories in the media library. When activated a dropdo
|
|
21 |
|
22 |
== Changelog ==
|
23 |
|
|
|
|
|
|
|
24 |
= 1.0 =
|
25 |
* Initial release.
|
3 |
Tags: category, categories, media, library
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 3.7.1
|
6 |
+
Stable tag: 1.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
21 |
|
22 |
== Changelog ==
|
23 |
|
24 |
+
= 1.1 =
|
25 |
+
* Add a link to media categories on the plugin page
|
26 |
+
|
27 |
= 1.0 =
|
28 |
* Initial release.
|