filtrod 3.0.0
pre_get_shortlink
Opis — z kodu źródłowego
Filters whether to preempt generating a shortlink for the given post.
Returning a value other than false from the filter will short-circuit the shortlink generation process, returning that value instead.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$return | false | string | Short-circuit return value. Either false or a URL string. |
$id | int | Post ID, or 0 for the current post. |
$context | string | The context for the link. One of 'post' or 'query', |
$allow_slugs | bool | Whether to allow post slugs in the shortlink. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_get_shortlink', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_get_shortlink', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii