filtrdynamicznyod 2.3.0
pre_{$field}
Args 1Plik wp-includes/post.php
Opis — z kodu źródłowego
Filters the value of a specific post field before saving.
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:
pre_post_authorpre_post_datepre_post_date_gmtpre_post_contentpre_post_titlepre_post_excerptpre_post_statuspre_post_passwordpre_post_namepre_post_modifiedpre_post_modified_gmtpre_post_content_filteredpre_post_parentpre_post_typepre_post_mime_type
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$value | mixed | Value of the post field. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'pre_{$field}', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}
// rejestracja funkcji zwrotnej
add_filter( 'pre_{$field}', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}Popularne w tej kategorii