WordPress.org

Make WordPress Core

Ticket #17447: register_post_type_args-hook.diff

File register_post_type_args-hook.diff, 627 bytes (added by mikeschinkel, 20 months ago)
  • wp-includes/post.php

     
    985985                'show_in_nav_menus' => null, 'show_in_menu' => null, 'show_in_admin_bar' => null, 
    986986                'delete_with_user' => null, 
    987987        ); 
    988         $args = wp_parse_args($args, $defaults); 
    989         $args = (object) $args; 
     988        $args = wp_parse_args( $args, $defaults); 
     989        $args = (object) apply_filters( 'register_post_type_args', $args, $post_type ); 
     990        if ( empty( $args ) ) 
     991                return false; 
    990992 
    991993        $post_type = sanitize_key($post_type); 
    992994        $args->name = $post_type;