registered_post_type
Fires after a post type is registered.
Использование
add_action( 'registered_post_type', 'wp_kama_registered_post_type_action', 10, 2 ); /** * Function for `registered_post_type` action-hook. * * @param string $post_type Post type. * @param WP_Post_Type $post_type_object Arguments used to register the post type. * * @return void */ function wp_kama_registered_post_type_action( $post_type, $post_type_object ){ // action... }
- $post_type(строка)
- Post type.
- $post_type_object(WP_Post_Type)
- Arguments used to register the post type.
Список изменений
С версии 3.3.0 | Введена. |
С версии 4.6.0 | Converted the $post_type parameter to accept a WP_Post_Type object. |
Где вызывается хук
registered_post_type
wp-includes/post.php 1711
do_action( 'registered_post_type', $post_type, $post_type_object );