Skip to content

Instantly share code, notes, and snippets.

@s3rgiosan
s3rgiosan / terms.php
Last active December 16, 2022 16:10
A collection of helper functions for terms.
/**
* Returns the terms associated with the given object, hierarchically structured.
*
* @param array $object_id The ID of the object to retrieve.
* @param string|string[] $taxonomies The taxonomy names to retrieve terms from.
* @return array
*/
function get_object_hierarchical_terms( $object_id, $taxonomies ) {
// Retrieve the terms.
### Keybase proof
I hereby claim:
* I am s3rgiosan on github.
* I am s3rgiosan (https://keybase.io/s3rgiosan) on keybase.
* I have a public key whose fingerprint is F40C 4F8E B206 3360 1076 CA70 4FBF D42E 8A1D 167C
To claim this, I am signing this object: