get_ancestors

FUNCTION wp-includes\taxonomy.php (ligne 4977) github
Gets an array of ancestor IDs for a given object.

Paramètres

Entrée :
$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

// Utilisation de la fonction get_ancestors
$result = get_ancestors($object_id = 0, $object_type = '', $resource_type = '');

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...