/** * Retrieve all taxonomies associated with a post. * * This function can be used within the loop. It will also return an array of * the taxonomies with links to the taxonomy and name. * * @since 2.5.0 * * @param int $post Optional. Post ID or will use Global Post ID (in loop). * @param array $args Override the defaults. * @return array */ function get_the_taxonomies($post = 0, $args = array()) { if (is_int($post)) { $post =& get_post($post); } elseif (!is_object($post)) { $post =& $GLOBALS['post']; } $args = nxt_parse_args($args, array('template' => '%s: %l.')); extract($args, EXTR_SKIP); $taxonomies = array(); if (!$post) { return $taxonomies; } foreach (get_object_taxonomies($post) as $taxonomy) { $t = (array) get_taxonomy($taxonomy); if (empty($t['label'])) { $t['label'] = $taxonomy; } if (empty($t['args'])) { $t['args'] = array(); } if (empty($t['template'])) { $t['template'] = $template; } $terms = get_object_term_cache($post->ID, $taxonomy); if (empty($terms)) { $terms = nxt_get_object_terms($post->ID, $taxonomy, $t['args']); } $links = array(); foreach ($terms as $term) { $links[] = "<a href='" . esc_attr(get_term_link($term)) . "'>{$term->name}</a>"; } if ($links) { $taxonomies[$taxonomy] = nxt_sprintf($t['template'], $t['label'], $links, $terms); } } return $taxonomies; }
$title = translate($group_data['name']); } echo '<h4 class="nxt-people-group">' . $title . "</h4>\n"; } if (!empty($group_data['shuffle'])) { shuffle($group_data['data']); } // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt. switch ($group_data['type']) { case 'list': array_walk($group_data['data'], '_nxt_credits_add_profile_link', $credits['data']['profiles']); echo '<p class="nxt-credits-list">' . nxt_sprintf('%l.', $group_data['data']) . "</p>\n\n"; break; case 'libraries': array_walk($group_data['data'], '_nxt_credits_build_object_link'); echo '<p class="nxt-credits-list">' . nxt_sprintf('%l.', $group_data['data']) . "</p>\n\n"; break; default: $compact = 'compact' == $group_data['type']; $classes = 'nxt-people-group ' . ($compact ? 'compact' : ''); echo '<ul class="' . $classes . '" id="nxt-people-group-' . $group_slug . '">' . "\n"; foreach ($group_data['data'] as $person_data) { echo '<li class="nxt-person" id="nxt-person-' . $person_data[2] . '">' . "\n\t"; echo '<a href="' . sprintf($credits['data']['profiles'], $person_data[2]) . '">'; $size = 'compact' == $group_data['type'] ? '30' : '60'; echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr($person_data[0]) . '" /></a>' . "\n\t"; echo '<a class="web" href="' . sprintf($credits['data']['profiles'], $person_data[2]) . '">' . $person_data[0] . "</a>\n\t"; if (!$compact) { echo '<span class="title">' . translate($person_data[3]) . "</span>\n"; } echo "</li>\n";