WP HOOKS
filtrod 3.3.0

wp_insert_post_empty_content

Args 2Plik wp-includes/post.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters whether the post should be considered "empty".

The post is considered "empty" if both:

  1. The post type supports the title, editor, and excerpt fields
  2. 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

ParametrTypOpis
$maybe_emptyboolWhether the post should be considered "empty".
$postarrarrayArray 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
}

Popularne w tej kategorii