Make WordPress Core

Ticket #21593: 21593.patch

File 21593.patch, 1.6 KB (added by ocean90, 13 years ago)
  • wp-includes/taxonomy.php

     
    328328                                        );
    329329        $args = wp_parse_args($args, $defaults);
    330330
     331        $taxonomy = sanitize_key( $taxonomy );
     332
     333        if ( strlen( $taxonomy ) > 32 )
     334                return new WP_Error( 'taxonomy_too_long', __( 'Taxonomies cannot exceed 32 characters in length' ) );
     335
    331336        if ( false !== $args['query_var'] && !empty($wp) ) {
    332337                if ( true === $args['query_var'] )
    333338                        $args['query_var'] = $taxonomy;
     
    380385        $wp_taxonomies[$taxonomy] = (object) $args;
    381386
    382387        // register callback handling for metabox
    383         add_filter('wp_ajax_add-' . $taxonomy, '_wp_ajax_add_hierarchical_term');
     388        add_filter('wp_ajax_add-' . $taxonomy, '_wp_ajax_add_hierarchical_term');
    384389
    385390        do_action( 'registered_taxonomy', $taxonomy, $object_type, $args );
    386391}
  • wp-includes/post.php

     
    989989        $args = (object) $args;
    990990
    991991        $post_type = sanitize_key($post_type);
    992         $args->name = $post_type;
    993992
    994993        if ( strlen( $post_type ) > 20 )
    995                         return new WP_Error( 'post_type_too_long', __( 'Post types cannot exceed 20 characters in length' ) );
     994                return new WP_Error( 'post_type_too_long', __( 'Post types cannot exceed 20 characters in length' ) );
    996995
     996        $args->name = $post_type;
     997
    997998        // If not set, default to the setting for public.
    998999        if ( null === $args->publicly_queryable )
    9991000                $args->publicly_queryable = $args->public;