filtrod 3.3.0
wp_insert_post_empty_content
Opis — z kodu źródłowego
Filters whether the post should be considered "empty".
The post is considered "empty" if both:
- The post type supports the title, editor, and excerpt fields
- The title, editor, and excerpt fields are all empty Returning a truthy value from the filter will effectively short-circuit the new post being inserted and return 0. If $wp_error is true, a WP_Error will be returned instead.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$maybe_empty | bool | Whether the post should be considered "empty". |
$postarr | array | Array of post data. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_insert_post_empty_content', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_insert_post_empty_content', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii