From 7314a0f3df0f6c53488c3a8471cc4c50faecfd5c Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 11 May 2015 13:11:31 +0000 Subject: [PATCH] In category dropdown, 'selected' should match against 'value_field'. Props tlexcellent. Fixes #32330. Built from https://develop.svn.wordpress.org/trunk@32484 git-svn-id: http://core.svn.wordpress.org/trunk@32454 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 10 ++++++---- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 5fb7485332..60748aab69 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -1165,13 +1165,15 @@ class Walker_CategoryDropdown extends Walker { /** This filter is documented in wp-includes/category-template.php */ $cat_name = apply_filters( 'list_cats', $category->name, $category ); - if ( ! isset( $args['value_field'] ) || ! isset( $category->{$args['value_field']} ) ) { - $args['value_field'] = 'term_id'; + if ( isset( $args['value_field'] ) && isset( $category->{$args['value_field']} ) ) { + $value_field = $args['value_field']; + } else { + $value_field = 'term_id'; } - $output .= "\t