Commit 1e545a54 authored by Christopher Maio's avatar Christopher Maio Committed by John James Jacoby
Browse files

Fix bug with bulk editing categories in WordPress 4.1.1+ (#2)



* Let's actually use the term_id instead of slug.
Signed-off-by: default avatarChristopher Maio <cjmaio@innerdev.me>

* Remove debug code.
Signed-off-by: default avatarChristopher Maio <cjmaio@innerdev.me>
parent 62e3d0e5
......@@ -267,8 +267,8 @@ function wp_media_categories_custom_bulk_admin_footer() {
// add bulk_actions for each category term
foreach ( $media_terms as $term ) {
$optionTxt = esc_js( __( 'Toggle', 'wp-media-categories' ) . ' ' . $term->name );
$wp_media_categories_footer_script .= " jQuery('<option>').val('" . 'bulk_toggle' . "').attr('option_slug','" . $term->slug . "').text('" . $optionTxt . "').appendTo(\"select[name='action']\");";
$wp_media_categories_footer_script .= " jQuery('<option>').val('" . 'bulk_toggle' . "').attr('option_slug','" . $term->slug . "').text('" . $optionTxt . "').appendTo(\"select[name='action2']\");";
$wp_media_categories_footer_script .= " jQuery('<option>').val('" . 'bulk_toggle' . "').attr('option_slug','" . $term->term_id . "').text('" . $optionTxt . "').appendTo(\"select[name='action']\");";
$wp_media_categories_footer_script .= " jQuery('<option>').val('" . 'bulk_toggle' . "').attr('option_slug','" . $term->term_id . "').text('" . $optionTxt . "').appendTo(\"select[name='action2']\");";
}
$wp_media_categories_footer_script .= '});';
......
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