@@ -1730,10 +1730,8 @@ function sanitize_term( $term, $taxonomy, $context = 'display' ) {
17301730 if ( isset ( $ term ->$ field ) ) {
17311731 $ term ->$ field = sanitize_term_field ( $ field , $ term ->$ field , $ term_id , $ taxonomy , $ context );
17321732 }
1733- } else {
1734- if ( isset ( $ term [ $ field ] ) ) {
1733+ } elseif ( isset ( $ term [ $ field ] ) ) {
17351734 $ term [ $ field ] = sanitize_term_field ( $ field , $ term [ $ field ], $ term_id , $ taxonomy , $ context );
1736- }
17371735 }
17381736 }
17391737
@@ -1770,7 +1768,7 @@ function sanitize_term( $term, $taxonomy, $context = 'display' ) {
17701768 * 'attribute', or 'js'. Default 'display'.
17711769 * @return mixed Sanitized field.
17721770 */
1773- function sanitize_term_field ( $ field , $ value , $ term_id , $ taxonomy , $ context ) {
1771+ function sanitize_term_field ( $ field , $ value , $ term_id , $ taxonomy , $ context = ' display ' ) {
17741772 $ int_fields = array ( 'parent ' , 'term_id ' , 'count ' , 'term_group ' , 'term_taxonomy_id ' , 'object_id ' );
17751773 if ( in_array ( $ field , $ int_fields , true ) ) {
17761774 $ value = (int ) $ value ;
@@ -3199,9 +3197,9 @@ function wp_unique_term_slug( $slug, $term ) {
31993197 *
32003198 * @global wpdb $wpdb WordPress database abstraction object.
32013199 *
3202- * @param int $term_id The ID of the term.
3203- * @param string $taxonomy The taxonomy of the term.
3204- * @param array $args {
3200+ * @param int $term_id The ID of the term.
3201+ * @param string $taxonomy The taxonomy of the term.
3202+ * @param array $args {
32053203 * Optional. Array of arguments for updating a term.
32063204 *
32073205 * @type string $alias_of Slug of the term to make this term an alias of.
0 commit comments