WP HOOKS
filtrod 5.9.0

is_post_status_viewable

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

Opis — z kodu źródłowego

Filters whether a post status is considered "viewable".

The returned filtered value must be a boolean type to ensure is_post_status_viewable() only returns a boolean. This strictness is by design to maintain backwards-compatibility and guard against potential type errors in PHP 8.1+. Non-boolean values (even falsey and truthy values) will result in the function returning false.

Parametry

ParametrTypOpis
$is_viewableboolWhether the post status is "viewable" (strict type).
$post_status\stdClassPost status object.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'is_post_status_viewable', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}

Popularne w tej kategorii