summaryrefslogtreecommitdiffstats
path: root/wp-includes/taxonomy.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-01-02 16:00:05 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-01-02 16:00:05 +0000
commit1503e05616c295e6f980134dc341fa1a66dc9672 (patch)
treeb0a7dc356affec0059670603f1cb990da7dbc026 /wp-includes/taxonomy.php
parentc65d51fec1d641efd1ec8a44c046cd54d588fe3b (diff)
downloadwordpress-mu-1503e05616c295e6f980134dc341fa1a66dc9672.tar.gz
wordpress-mu-1503e05616c295e6f980134dc341fa1a66dc9672.tar.xz
wordpress-mu-1503e05616c295e6f980134dc341fa1a66dc9672.zip
Merge with WP 2.3.2
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1172 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/taxonomy.php')
-rw-r--r--wp-includes/taxonomy.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php
index ea9fae6..92ebdda 100644
--- a/wp-includes/taxonomy.php
+++ b/wp-includes/taxonomy.php
@@ -663,6 +663,10 @@ function is_term($term, $taxonomy = '') {
* @return array|object Term with all fields sanitized
*/
function sanitize_term($term, $taxonomy, $context = 'display') {
+
+ if ( 'raw' == $context )
+ return $term;
+
$fields = array('term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group');
$do_object = false;
@@ -933,8 +937,8 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
$term_group = $alias->term_group;
} else {
// The alias isn't in a group, so let's create a new one and firstly add the alias term to it.
- $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms") + 1;
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $alias->term_id ) );
+ $term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1;
+ $wpdb->query("UPDATE $wpdb->terms SET term_group = $term_group WHERE term_id = $alias->term_id");
}
}