filtrod 4.6.0
pre_get_blogs_of_user
Opis — z kodu źródłowego
Filters the list of a user's sites before it is populated.
Returning a non-null value from the filter will effectively short circuit get_blogs_of_user(), returning that value instead.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$sites | null | object[] | An array of site objects of which the user is a member. |
$user_id | int | User ID. |
$all | bool | Whether the returned array should contain all sites, including those marked 'deleted', 'archived', or 'spam'. Default false. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_get_blogs_of_user', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_get_blogs_of_user', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii