Make WordPress Core

Ticket #17447: 17447.3.diff

File 17447.3.diff, 1.0 KB (added by johnbillion, 9 years ago)
  • src/wp-includes/post-functions.php

     
    992992
    993993        // Sanitize post type name
    994994        $post_type = sanitize_key( $post_type );
     995        $args      = wp_parse_args( $args );
    995996
    996997        /**
    997998         * Filter the arguments for registering a post type.
    998999         *
    9991000         * @since 4.4.0
    10001001         *
    1001          * @param array|string $args      Array or string of arguments for registering a post type.
    1002          * @param string       $post_type Post type key.
     1002         * @param array  $args      Array of arguments for registering a post type.
     1003         * @param string $post_type Post type key.
    10031004         */
    10041005        $args = apply_filters( 'register_post_type_args', $args, $post_type );
    10051006
     
    10311032                '_builtin'             => false,
    10321033                '_edit_link'           => 'post.php?post=%d',
    10331034        );
    1034         $args = wp_parse_args( $args, $defaults );
     1035        $args = array_merge( $defaults, $args );
    10351036        $args = (object) $args;
    10361037
    10371038        $args->name = $post_type;