Create metaboxes for hierarchical taxonomies. Props prettyboymp. fixes #10122

git-svn-id: https://develop.svn.wordpress.org/trunk@12798 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-22 19:30:05 +00:00
parent 8f1e29abd1
commit e5a67cebd5
17 changed files with 268 additions and 194 deletions
+4 -1
View File
@@ -194,6 +194,9 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
$args['name'] = $taxonomy;
$args['object_type'] = (array) $object_type;
$wp_taxonomies[$taxonomy] = (object) $args;
// register callback handling for metabox
add_filter('wp_ajax_add-'.$taxonomy, '_wp_ajax_add_hierarchical_term');
}
/**
@@ -1573,7 +1576,7 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
* slug has to be globally unique for every taxonomy.
*
* The way this works is that if the taxonomy that the term belongs to is
* heirarchical and has a parent, it will append that parent to the $slug.
* hierarchical and has a parent, it will append that parent to the $slug.
*
* If that still doesn't return an unique slug, then it try to append a number
* until it finds a number that is truely unique.