akcjadynamicznyod 6.0.0
registered_post_type_{$post_type}
Args 2Plik wp-includes/post.php
Opis — z kodu źródłowego
Fires after a specific post type is registered.
The dynamic portion of the filter name, $post_type, refers to the post type key.
Possible hook names include:
registered_post_type_postregistered_post_type_page
Hook dynamiczny — możliwe nazwy
registered_post_type_pageregistered_post_type_postParametry
| Parametr | Typ | Opis |
|---|---|---|
$post_type | string | Post type. |
$post_type_object | \WP_Post_Type | Arguments used to register the post type. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'registered_post_type_{$post_type}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'registered_post_type_{$post_type}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii