Changeset 5938
- Timestamp:
- 08/24/2007 06:41:01 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/taxonomy.php
r5712 r5938 13 13 14 14 function get_category_to_edit( $id ) { 15 $category = get_category( $id ); 16 17 $category->term_id = (int) $category->term_id; 18 $category->parent = (int) $category->parent; 19 15 $category = get_category( $id, OBJECT, 'edit' ); 20 16 return $category; 21 17 } … … 91 87 92 88 $parent = (int) $parent; 93 if ( empty($parent) || ! get_category( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) )89 if ( empty($parent) || !category_exists( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) ) 94 90 $parent = 0; 95 91 -
trunk/wp-includes/category.php
r5912 r5938 29 29 // Retrieves category data given a category ID or category object. 30 30 // Handles category caching. 31 function &get_category( &$category, $output = OBJECT) {32 $category = get_term($category, 'category', $output );31 function &get_category($category, $output = OBJECT, $filter = 'raw') { 32 $category = get_term($category, 'category', $output, $filter); 33 33 34 34 _make_cat_compat($category); -
trunk/wp-includes/taxonomy.php
r5937 r5938 230 230 * might be inaccurate or wrong. 231 231 */ 232 function &get_term( &$term, $taxonomy, $output = OBJECT, $filter = 'raw') {232 function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { 233 233 global $wpdb; 234 234 … … 885 885 $term = get_term ($term_id, $taxonomy, ARRAY_A); 886 886 887 $term = sanitize_term($term, $taxonomy, 'db');888 889 887 // Escape data pulled from DB. 890 888 $term = add_magic_quotes($term); … … 895 893 $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); 896 894 $args = wp_parse_args($args, $defaults); 895 $args = sanitize_term($args, $taxonomy, 'db'); 897 896 extract($args, EXTR_SKIP); 898 897 899 898 if ( empty($slug) ) 900 899 $slug = sanitize_title($name); 901 else902 $slug = sanitize_title($slug);903 900 904 901 if ( $alias_of ) {
Note: See TracChangeset
for help on using the changeset viewer.