Convert the `$args` passed to `register_post_type()` into an array before passing them to the new `register_post_type_args` filter.
Fixes #17447 Built from https://develop.svn.wordpress.org/trunk@34513 git-svn-id: http://core.svn.wordpress.org/trunk@34477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f84c653fad
commit
949b6ee1df
|
@ -992,14 +992,15 @@ function register_post_type( $post_type, $args = array() ) {
|
|||
|
||||
// Sanitize post type name
|
||||
$post_type = sanitize_key( $post_type );
|
||||
$args = wp_parse_args( $args );
|
||||
|
||||
/**
|
||||
* Filter the arguments for registering a post type.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param array|string $args Array or string of arguments for registering a post type.
|
||||
* @param string $post_type Post type key.
|
||||
* @param array $args Array of arguments for registering a post type.
|
||||
* @param string $post_type Post type key.
|
||||
*/
|
||||
$args = apply_filters( 'register_post_type_args', $args, $post_type );
|
||||
|
||||
|
@ -1031,7 +1032,7 @@ function register_post_type( $post_type, $args = array() ) {
|
|||
'_builtin' => false,
|
||||
'_edit_link' => 'post.php?post=%d',
|
||||
);
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
$args = array_merge( $defaults, $args );
|
||||
$args = (object) $args;
|
||||
|
||||
$args->name = $post_type;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34512';
|
||||
$wp_version = '4.4-alpha-34513';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue