Media Library Categories - Version 1.4.10

Version Description

  • Stay on active page in the media library when changing categories.
  • Fixed PHP 5.4 strict warning.
  • Added hierarchical display of the filter menu when inserting media. (premium only)
Download this release

Release Info

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

Code changes from version 1.4.9 to 1.4.10

Files changed (2) hide show
  1. index.php +8 -7
  2. readme.txt +6 -1
index.php CHANGED
@@ -3,7 +3,7 @@
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.4.9
7
  * Author: Jeffrey-WP
8
  * Author URI: http://codecanyon.net/user/jeffrey-wp/?ref=jeffrey-wp
9
  */
@@ -100,15 +100,15 @@ if ( is_admin() ) {
100
  /** Custom walker for wp_dropdown_categories, based on https://gist.github.com/stephenh1988/2902509 */
101
  class wpmediacategory_walker_category_filter extends Walker_CategoryDropdown{
102
 
103
- function start_el(&$output, $category, $depth, $args) {
104
- $pad = str_repeat(' ', $depth * 3);
105
- $cat_name = apply_filters('list_cats', $category->name, $category);
106
 
107
  if( !isset($args['value']) ) {
108
  $args['value'] = ( $category->taxonomy != 'category' ? 'slug' : 'id' );
109
  }
110
 
111
- $value = ($args['value']=='slug' ? $category->slug : $category->term_id );
112
 
113
  $output .= "\t<option class=\"level-$depth\" value=\"".$value."\"";
114
  if ( $value === (string) $args['selected'] ) {
@@ -224,8 +224,9 @@ if ( is_admin() ) {
224
 
225
  $sendback = admin_url( "upload.php?editCategory=1" );
226
 
227
- //$pagenum = $wp_list_table->get_pagenum();
228
- //$sendback = add_query_arg( 'paged', $pagenum, $sendback );
 
229
 
230
  foreach( $post_ids as $post_id ) {
231
 
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.4.10
7
  * Author: Jeffrey-WP
8
  * Author URI: http://codecanyon.net/user/jeffrey-wp/?ref=jeffrey-wp
9
  */
100
  /** Custom walker for wp_dropdown_categories, based on https://gist.github.com/stephenh1988/2902509 */
101
  class wpmediacategory_walker_category_filter extends Walker_CategoryDropdown{
102
 
103
+ function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
104
+ $pad = str_repeat( '&nbsp;', $depth * 3 );
105
+ $cat_name = apply_filters( 'list_cats', $category->name, $category );
106
 
107
  if( !isset($args['value']) ) {
108
  $args['value'] = ( $category->taxonomy != 'category' ? 'slug' : 'id' );
109
  }
110
 
111
+ $value = ( $args['value']=='slug' ? $category->slug : $category->term_id );
112
 
113
  $output .= "\t<option class=\"level-$depth\" value=\"".$value."\"";
114
  if ( $value === (string) $args['selected'] ) {
224
 
225
  $sendback = admin_url( "upload.php?editCategory=1" );
226
 
227
+ // remember pagenumber
228
+ $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
229
+ $sendback = add_query_arg( 'paged', $pagenum, $sendback );
230
 
231
  foreach( $post_ids as $post_id ) {
232
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: category, categories, media, library, medialibrary
5
  Requires at least: 3.1
6
  Tested up to: 3.9.1
7
- Stable tag: 1.4.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -68,6 +68,11 @@ add_filter( 'wpmediacategory_taxonomy', function(){ return 'category_media'; },
68
 
69
  == Changelog ==
70
 
 
 
 
 
 
71
  = 1.4.9 =
72
  * Fixed error message which in some cases appears when updating multiple items at once. [View support question](http://wordpress.org/support/topic/error-after-latest-update-3)
73
 
4
  Tags: category, categories, media, library, medialibrary
5
  Requires at least: 3.1
6
  Tested up to: 3.9.1
7
+ Stable tag: 1.4.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
68
 
69
  == Changelog ==
70
 
71
+ = 1.4.10 =
72
+ * Stay on active page in the media library when changing categories.
73
+ * Fixed PHP 5.4 strict warning.
74
+ * Added hierarchical display of the filter menu when inserting media. [(premium only)](http://codecanyon.net/item/media-library-categories-premium/6691290?ref=jeffrey-wp)
75
+
76
  = 1.4.9 =
77
  * Fixed error message which in some cases appears when updating multiple items at once. [View support question](http://wordpress.org/support/topic/error-after-latest-update-3)
78