filtrdynamicznyod 2.3.0
edit_{$field}
Args 2Plik wp-includes/post.php
Opis — z kodu źródłowego
Filters the value of a specific post field to edit.
The dynamic portion of the hook name, $field, refers to the post field name. Possible filter names include:
edit_post_authoredit_post_dateedit_post_date_gmtedit_post_contentedit_post_titleedit_post_excerptedit_post_statusedit_post_passwordedit_post_nameedit_post_modifiededit_post_modified_gmtedit_post_content_filterededit_post_parentedit_post_typeedit_post_mime_type
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$value | mixed | Value of the post field. |
$post_id | int | Post ID. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'edit_{$field}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'edit_{$field}', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii