filtrdynamicznyod 3.6.0
_wp_post_revision_field_{$field}
Args 4Plik wp-admin/includes/revision.php
Opis — z kodu źródłowego
Contextually filter a post revision field.
The dynamic portion of the hook name, $field, corresponds to a name of a field of the revision object.
Possible hook names include:
_wp_post_revision_field_post_title_wp_post_revision_field_post_content_wp_post_revision_field_post_excerpt
Hook dynamiczny — możliwe nazwy
_wp_post_revision_field_post_content_wp_post_revision_field_post_excerpt_wp_post_revision_field_post_titleParametry
| Parametr | Typ | Opis |
|---|---|---|
$revision_field | string | The current revision field to compare to or from. |
$field | string | The current revision field. |
$compare_from | \WP_Post | The revision post object to compare to or from. |
$context | string | The context of whether the current revision is the old or the new one. Either 'to' or 'from'. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( '_wp_post_revision_field_{$field}', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( '_wp_post_revision_field_{$field}', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii