filtrdynamicznyod 6.0.0
register_{$post_type}_post_type_args
Args 2Plik wp-includes/class-wp-post-type.php
Opis — z kodu źródłowego
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:
register_post_post_type_argsregister_page_post_type_args
Hook dynamiczny — możliwe nazwy
register_page_post_type_argsregister_post_post_type_argsParametry
| Parametr | Typ | Opis |
|---|---|---|
$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. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'register_{$post_type}_post_type_args', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'register_{$post_type}_post_type_args', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii