WP HOOKS
filtrdynamicznyod 2.5.0

get_{$adjacent}_post_join

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

Opis — z kodu źródłowego

Filters the JOIN clause in the SQL for an adjacent post query.

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

  • get_next_post_join
  • get_previous_post_join

Hook dynamiczny — możliwe nazwy

get_next_post_joinget_previous_post_join

Parametry

ParametrTypOpis
$joinstringThe JOIN clause in the SQL.
$in_same_termboolWhether post should be in the same taxonomy term.
$excluded_termsint[] | stringArray of excluded term IDs. Empty string if none were provided.
$taxonomystringTaxonomy. Used to identify the term used when <code>$in_same_term</code> is true.
$post\WP_PostWP_Post object.

Wywołanie

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

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

Popularne w tej kategorii