WP HOOKS
filtrod 1.5.0

get_comments_number

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

Opis — z kodu źródłowego

Filters the returned comment count for a post.

Parametry

ParametrTypOpis
$comments_numberstring | intA string representing the number of comments a post has, otherwise 0.
$post_idintPost ID.

Wywołanie

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

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

Popularne w tej kategorii