﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
5253	filter category_description call too many (2) in category_description() function	michelwp	anonymous	"Continuing the taxomony exploration (#5245) for multilingual tests (dev.xiligroup.com), I discover that the filter ''category_description'' was called '''two''' times. After uneasy research, I found that the origin is that [[BR]]
in '''get_term_field('description', $category, 'category')''' the function sanitize_term_field() was called ''one time too much'' : one by get_term and one for the field in the return...


{{{
function get_term_field( $field, $term, $taxonomy, $context = 'display' ) {
	$term = (int) $term;
	$term = get_term( $term, $taxonomy ); /* ------- sanitize here ?????? */
	if ( is_wp_error($term) )
		return $term;

	if ( !is_object($term) )
		return '';

	if ( !isset($term->$field) )
		return '';
/* or here - need to choose */
	return sanitize_term_field($field, $term->$field, $term->term_id, $taxonomy, $context);
}
}}}

"	defect (bug)	closed	high	2.5	General	2.3	normal	fixed	sanitize_term_field get_term_field needs-patch	
