Filters the arguments for registering a post type.
Parameters
$args
array- Array of arguments for registering a post type.
See the register_post_type() function for accepted arguments.More Arguments from register_post_type( … $args )
Post type registration arguments. $post_type
string- Post type key.
Source
$args = apply_filters( 'register_post_type_args', $args, $this->name );
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
Example of Custom Post Type args change via filter hook. Changing rewrite slug from
movies
tofilms
:You can also use `register_{$post_type}_post_type_args` to target a specific post type.
For example, you can use `register_post_post_type_args` to target only the Post post type and modify how it’s registered:
register_{$post_type}_post_type_args
is called after the filterregister_post_type_args
and thus can overwrite possible changes of the first one!