Fires when the blog is switched.
$new_blog_id, $prev_blog_id, 'switch'
Sortie :
@param int $new_blog_id New blog ID. @param int $prev_blog_id Previous blog ID. @param string $context Additional context. Accepts 'switch' when called from switch_to_blog()
// Ajouter une fonction au hook action 'switch_blog'
add_action('switch_blog', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee($new_blog_id, $prev_blog_id, 'switch') {
// Votre code ici
error_log('Hook switch_blog déclenché');
}
Chargement des actualités...