Ticket #14153: post.patch

File post.patch, 616 bytes (added by surger1976, 3 years ago)

post.php register_post_type

  • post.php

     
    883883 
    884884        add_action( 'future_' . $post_type, '_future_post_hook', 5, 2 ); 
    885885 
    886         foreach ( $args->taxonomies as $taxonomy ) { 
    887                 register_taxonomy_for_object_type( $taxonomy, $post_type ); 
     886        foreach ( $args->taxonomies as $taxonomy => $taxonomy_args ) { 
     887                if ( is_numeric($taxonomy) ) { 
     888                        register_taxonomy_for_object_type( $taxonomy, $taxonomy_args ); 
     889                } else { 
     890                        register_taxonomy( $taxonomy, $post_type, $taxonomy_args ); 
     891                } 
    888892        } 
    889893 
    890894        return $args;