register_(post_type)_post_type_args
Filters the arguments for registering a specific post type.
The dynamic portion of the filter name, $post_type, refers to the post type key.
Possible hook names include:
Usage
add_filter( 'register_(post_type)_post_type_args', 'wp_kama_register_post_type_args_filter', 10, 2 ); /** * Function for `register_(post_type)_post_type_args` filter-hook. * * @param array $args Array of arguments for registering a post type. See the register_post_type() function for accepted arguments. * @param string $post_type Post type key. * * @return array */ function wp_kama_register_post_type_args_filter( $args, $post_type ){ // filter... return $args; }
- $args(array)
- Array of arguments for registering a post type. See the register_post_type() function for accepted arguments.
- $post_type(string)
- Post type key.
Changelog
Since 6.0.0 | Introduced. |
Since 6.4.0 | Added late_route_registration, autosave_rest_controller_class and revisions_rest_controller_class arguments. |
Where the hook is called
register_(post_type)_post_type_args
wp-includes/class-wp-post-type.php 512
$args = apply_filters( "register_{$post_type}_post_type_args", $args, $this->name );