Skip to content

Instantly share code, notes, and snippets.

@phenix-factory
Last active March 1, 2016 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phenix-factory/f6264f0d15fa85a92508 to your computer and use it in GitHub Desktop.
Save phenix-factory/f6264f0d15fa85a92508 to your computer and use it in GitHub Desktop.
SPIP: vider le cache de l'objet associer
<?php
/**
* On passe par le pipeline post_edition_lien
* afin de vider le cache des objet associer
* Pratique lorsqu'une structure dépend d'un mot-clé SPIP
*
* @param mixed $flux
* @access public
* @return mixed
*/
function prefix_post_edition_lien($flux) {
$objet = $flux['data']['objet'];
$id_objet = $flux['data']['id_objet'];
// Vider le cache de l'objet quand un mot clé lui est associer
include_spip('inc/invalideur');
suivre_invalideur("id='$objet/$id_objet'");
return $flux;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment