Make WordPress Core

Ticket #14910: sanitize_key-for-taxonomies-2.patch

File sanitize_key-for-taxonomies-2.patch, 558 bytes (added by WraithKenny, 13 years ago)

Use sanitize_key in register_taxonomy and account for arrays

  • wp-includes/taxonomy.php

     
    346346        unset( $args['capabilities'] );
    347347
    348348        $args['name'] = $taxonomy;
    349         $args['object_type'] = (array) $object_type;
     349        $args['object_type'] = is_array($object_type) ? array_map('sanitize_key', $object_type) : (array) sanitize_key($object_type);
    350350
    351351        $args['labels'] = get_taxonomy_labels( (object) $args );
    352352        $args['label'] = $args['labels']->name;