Skip to content

Instantly share code, notes, and snippets.

@thierrypigot
Created December 19, 2022 14:59
Show Gist options
  • Save thierrypigot/036e0d63861256746c7fbfdaca4fe5a1 to your computer and use it in GitHub Desktop.
Save thierrypigot/036e0d63861256746c7fbfdaca4fe5a1 to your computer and use it in GitHub Desktop.
<?php
// Hook d'action :
add_action('init', 'mon_hook');
function mon_hook() {
// votre code ici
}
// Hook de filtre :
add_filter('the_content', 'mon_filtre');
function mon_filtre($contenu) {
// votre code ici
return $contenu;
}
// Hook personnalisé :
add_action('mon_hook', 'ma_fonction');
function ma_fonction() {
// votre code ici
}
// Hook personnalisé avec des arguments :
add_action('mon_hook', 'ma_fonction', 10, 3);
function ma_fonction($arg1, $arg2, $arg3) {
// votre code ici
}
// Hook de sécurité :
add_action('login_form_verify_password', 'ma_verification');
function ma_verification() {
// votre code ici
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment