Commit af4e437d authored by John James Jacoby's avatar John James Jacoby
Browse files

Bump to 2.0.0.

Fix widget dropdown and taxonomy recount.
parent 4a5f68ca
......@@ -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
......
......@@ -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 201609060002;
return 201806050001;
}
<?php
/**
* Media Categories AJAX
*
* @package Media/Categories/AJX
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/**
* Changing categories in the grid view
*
......
......@@ -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
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment