register_page_post_type_args
Filters the arguments for registering a specific post type.
Это один из вариантов динамического хука register_(post_type)_post_type_args
Использование
add_filter( 'register_page_post_type_args', 'wp_kama_register_page_post_type_args_filter', 10, 2 ); /** * Function for `register_page_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_page_post_type_args_filter( $args, $post_type ){ // filter... return $args; }
- $args(массив)
- Array of arguments for registering a post type. See the register_post_type() function for accepted arguments.
- $post_type(строка)
- Post type key.
Список изменений
С версии 6.0.0 | Введена. |
С версии 6.4.0 | Added late_route_registration, autosave_rest_controller_class and revisions_rest_controller_class arguments. |
Где вызывается хук
register_page_post_type_args
wp-includes/class-wp-post-type.php 512
$args = apply_filters( "register_{$post_type}_post_type_args", $args, $this->name );