WP HOOKS
filtrod 2.7.0

wp_count_comments

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

Opis — z kodu źródłowego

Filters the comments count for a given post or the whole site.

Parametry

ParametrTypOpis
$countarray | \stdClassAn empty array or an object containing comment counts.
$post_idintThe post ID. Can be 0 to represent the whole site.

Wywołanie

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

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

Popularne w tej kategorii