WP HOOKS
filtrdynamicznyod 2.6.0

{$adjacent}_post_link

Args 5Plik wp-includes/link-template.php

Opis — z kodu źródłowego

Filters the adjacent post link.

The dynamic portion of the hook name, $adjacent, refers to the type of adjacency, 'next' or 'previous'. Possible hook names include:

  • next_post_link
  • previous_post_link

Hook dynamiczny — możliwe nazwy

next_post_linkprevious_post_link

Parametry

ParametrTypOpis
$outputstringThe adjacent post link.
$formatstringLink anchor format.
$linkstringLink permalink format.
$post\WP_Post | stringThe adjacent post. Empty string if no corresponding post exists.
$adjacentstringWhether the post is previous or next.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( '{$adjacent}_post_link', 'twoja_funkcja', 10, 5 );

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

Popularne w tej kategorii