Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Publicious.org
Plugins
Media Categories
Commits
af4e437d
Commit
af4e437d
authored
Jun 05, 2018
by
John James Jacoby
Browse files
Bump to 2.0.0.
Fix widget dropdown and taxonomy recount.
parent
4a5f68ca
Changes
5
Hide whitespace changes
Inline
Side-by-side
readme.txt
View file @
af4e437d
...
...
@@ -2,8 +2,8 @@
Contributors: johnjamesjacoby, stuttter
Tags: media, library, attachment, category, categories, organizer, management, files
Requires at least: 4.6
Tested up to: 4.
7
Stable tag:
1.1
.0
Tested up to: 4.
9
Stable tag:
2.0
.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9Q4F4EL5YJ62J
...
...
@@ -21,7 +21,6 @@ Add categories to media & attachments.
* [WP Chosen](https://wordpress.org/plugins/wp-chosen/ "Make long, unwieldy select boxes much more user-friendly.")
* [WP Event Calendar](https://wordpress.org/plugins/wp-event-calendar/ "The best way to manage events in WordPress.")
* [WP Term Meta](https://wordpress.org/plugins/wp-term-meta/ "Metadata, for taxonomy terms.")
* [WP Term Order](https://wordpress.org/plugins/wp-term-order/ "Sort taxonomy terms, your way.")
* [WP Term Authors](https://wordpress.org/plugins/wp-term-authors/ "Authors for categories, tags, and other taxonomy terms.")
* [WP Term Colors](https://wordpress.org/plugins/wp-term-colors/ "Pretty colors for categories, tags, and other taxonomy terms.")
...
...
@@ -57,6 +56,10 @@ http://github.com/stuttter/wp-media-categories/
== Changelog ==
= [2.0.0] - 2018-06-05 =
* Fix bug where count could target wrong taxonomy
* Fix bug where dropdown widget URL used wrong taxonomy slug
= [1.1.0] - 2016-09-28 =
* Fix "no_category" admin filtering
...
...
wp-media-categories.php
View file @
af4e437d
...
...
@@ -10,7 +10,7 @@
* Text Domain: wp-media-categories
* Domain Path: /wp-media-categories/lang
* Description: Categories for media & attachments
* Version:
1.1
.0
* Version:
2.0
.0
*/
// Exit if accessed directly
...
...
@@ -38,7 +38,7 @@ function _wp_media_categories() {
add_action
(
'plugins_loaded'
,
'_wp_media_categories'
);
/**
* Return the plugin
's
URL
* Return the plugin URL
*
* @since 0.1.0
*
...
...
@@ -56,5 +56,5 @@ function wp_media_categories_get_plugin_url() {
* @return int
*/
function
wp_media_categories_get_asset_version
()
{
return
201
609
06000
2
;
return
201
8
060
5
00
01
;
}
wp-media-categories/includes/ajax.php
View file @
af4e437d
<?php
/**
* Media Categories AJAX
*
* @package Media/Categories/AJX
*/
// Exit if accessed directly
defined
(
'ABSPATH'
)
||
exit
;
/**
* Changing categories in the grid view
*
...
...
wp-media-categories/includes/functions.php
View file @
af4e437d
...
...
@@ -30,7 +30,7 @@ function wp_media_categories_update_count_callback( $terms = array(), $media_tax
WHERE taxonomy = %s
)) AS unioncount GROUP BY term_taxonomy_id"
;
$prepared
=
$wpdb
->
prepare
(
$sql
,
'
media_
category'
,
'
media_
category'
);
$prepared
=
$wpdb
->
prepare
(
$sql
,
$
media_
taxonomy
->
name
,
$
media_
taxonomy
->
name
);
$count
=
$wpdb
->
get_results
(
$prepared
);
// update all count values from taxonomy
...
...
wp-media-categories/includes/widgets.php
View file @
af4e437d
...
...
@@ -67,6 +67,9 @@ class WP_Media_Categories extends WP_Widget {
$media_cat_args
[
'id'
]
=
$dropdown_id
;
$media_cat_args
[
'value_field'
]
=
'slug'
;
// Get the taxonomy slug
$slug
=
get_taxonomy
(
$media_cat_args
[
'taxonomy'
]
)
->
rewrite
[
'slug'
];
/**
* Filter the arguments for the Categories widget drop-down.
*
...
...
@@ -84,7 +87,7 @@ class WP_Media_Categories extends WP_Widget {
var
dropdown
=
document
.
getElementById
(
"
<?php
echo
esc_js
(
$dropdown_id
);
?>
"
);
function
onMediaCatChange
()
{
if
(
dropdown
.
options
[
dropdown
.
selectedIndex
].
value
!==
-
1
)
{
location
.
href
=
"
<?php
echo
home_url
(
)
.
'/'
.
$media_taxonomy
;
?>
/
"
+
dropdown
.
options
[
dropdown
.
selectedIndex
].
value
;
location
.
href
=
"
<?php
echo
home_url
(
$slug
)
;
?>
/
"
+
dropdown
.
options
[
dropdown
.
selectedIndex
].
value
;
}
}
dropdown
.
onchange
=
onMediaCatChange
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment