Make WordPress Core

Changeset 34513


Ignore:
Timestamp:
09/24/2015 07:38:11 PM (10 years ago)
Author:
johnbillion
Message:

Convert the $args passed to register_post_type() into an array before passing them to the new register_post_type_args filter.

Fixes #17447

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-functions.php

    r34472 r34513  
    993993    // Sanitize post type name
    994994    $post_type = sanitize_key( $post_type );
     995    $args      = wp_parse_args( $args );
    995996
    996997    /**
     
    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 );
     
    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
Note: See TracChangeset for help on using the changeset viewer.