filtrdynamicznyod 2.3.0
{$field}
Args 3Plik wp-includes/post.php
Opis — z kodu źródłowego
Filters the value of a specific post field for display.
Only applied to post fields with a name which is prefixed with post_.
The dynamic portion of the hook name, $field, refers to the post field name. Possible filter names include:
post_authorpost_datepost_date_gmtpost_contentpost_titlepost_excerptpost_statuspost_passwordpost_namepost_modifiedpost_modified_gmtpost_content_filteredpost_parentpost_typepost_mime_type
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$value | mixed | Value of the prefixed post field. |
$post_id | int | Post ID. |
$context | string | Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'. Default 'display'. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( '{$field}', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( '{$field}', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii