filtrdynamicznyod 2.5.0
get_{$adjacent}_post_where
Args 5Plik wp-includes/link-template.php
Opis — z kodu źródłowego
Filters the WHERE 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_whereget_previous_post_where
Hook dynamiczny — możliwe nazwy
get_next_post_whereget_previous_post_whereParametry
| Parametr | Typ | Opis |
|---|---|---|
$where | string | The <code>WHERE</code> clause in the SQL. |
$in_same_term | bool | Whether post should be in the same taxonomy term. |
$excluded_terms | int[] | string | Array of excluded term IDs. Empty string if none were provided. |
$taxonomy | string | Taxonomy. Used to identify the term used when <code>$in_same_term</code> is true. |
$post | \WP_Post | WP_Post object. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'get_{$adjacent}_post_where', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'get_{$adjacent}_post_where', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}Popularne w tej kategorii