Gets an array of ancestor IDs for a given object.
$object_id = 0, $object_type = '', $resource_type = ''
Sortie :
@param int $object_id Optional. The ID of the object. Default 0. @param string $object_type Optional. The type of object for which we'll be retrieving @param string $resource_type Optional. Type of resource $object_type is. Accepts 'post_type' @return int[] An array of IDs of ancestors from lowest to highest in the hierarchy.
// Utilisation de la fonction get_ancestors
$result = get_ancestors($object_id = 0, $object_type = '', $resource_type = '');
if ($result) {
// Votre logique ici
}
Chargement des actualités...