diff --git a/ecrire/inc/filtres.php b/ecrire/inc/filtres.php index 5d363634912a7f094740395141f34e1ac1f0aacd..5904a559e926a5b63cc8aff0a6dbc89ae74f6dcb 100644 --- a/ecrire/inc/filtres.php +++ b/ecrire/inc/filtres.php @@ -5266,6 +5266,7 @@ function identifiant_slug($texte, $type = '', $options = array()) { return $texte; } + /** * Prépare un texte (issu d'une chaine de langue historique) pour un affichage en label ou titre * @@ -5295,6 +5296,27 @@ function uniformiser_label(string $text, bool $ucfirst = true) : string { * @return array */ function filtre_objet_trouver_parent_dist($objet, $id_objet) { + // compatibilite signature inversee + if (is_numeric($objet) and !is_numeric($id_objet)) { + list($objet, $id_objet) = [$id_objet, $objet]; + } include_spip('base/objets'); return objet_trouver_parent($objet, $id_objet); } + + +/** + * Cherche les enfants d'un contenu précis + * + * @param string $objet + * @param int|string $id_objet + * @return array + */ +function filtre_objet_trouver_enfants_dist($objet, $id_objet) { + // compatibilite signature inversee + if (is_numeric($objet) and !is_numeric($id_objet)) { + list($objet, $id_objet) = [$id_objet, $objet]; + } + include_spip('base/objets'); + return objet_trouver_enfants($objet, $id_objet); +}