WP HOOKS
filtrod 6.8.0

pre_count_many_users_posts

Args 4Plik wp-includes/user.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters whether to short-circuit performing the post counts.

When filtering, return an array of posts counts as strings, keyed by the user ID.

Parametry

ParametrTypOpis
$countstring[] | nullThe post counts. Return a non-null value to short-circuit.
$usersint[]Array of user IDs.
$post_typestring | string[]Single post type or array of post types to check.
$public_onlyboolWhether to only return counts for public posts.

Wywołanie

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

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

Popularne w tej kategorii