コード例 #1
0
        ?>
" rel="bookmark">
                                            <?php 
        if (!is_category()) {
            echo showAndTitle($post);
        } else {
            echo get_the_title();
        }
        ?>
                                        </a>

                                        <?php 
        if (is_category()) {
            $showHosts = explodedCat($catID, hosts);
            if (get_terms_meta($catID, 'staff', true)) {
                $showStaff = explodedCat($catID, staff);
                $showHosts = array_merge($showHosts, $showStaff);
            }
            unset($episodeHosts);
            unset($diff);
            $episodeHosts = [];
            $coAuthors = get_coauthors();
            foreach ($coAuthors as $coAuthor) {
                $episodeHosts[] = get_the_author_meta('id', $coAuthor->ID);
            }
            $diff = array_diff($episodeHosts, $showHosts);
            if ($diff) {
                unset($epGuests);
                $epGuests = [];
                $epGuests = nameList($diff);
                echo '(feat. ' . andList($epGuests), ')</i>';
コード例 #2
0
/**
 * Displays a list of all shows belonging to a person, based on the
 * relevant meta string. Then outputs them with a displaystring and
 * links to the various shows.
 * @param  [type] $userID        Takes the User's ID.
 * @param  [type] $catString     Takes the Category ID.
 * @param  [type] $displayString Displaystring to prepend to output.
 * @return [type]                Returns a list of the shows matching the user & meta.
 */
function userShows($userID, $catString, $displayString)
{
    $categoryIDs = get_all_category_ids();
    $author = get_userdata($userID);
    $hostShows = [];
    foreach ($categoryIDs as $catID) {
        $hosts = explodedCat($catID, $catString);
        if (in_array($userID, $hosts)) {
            if (!preg_match('/cancelled/', $displayString) && !get_terms_meta($catID, 'inactive') xor preg_match('/cancelled/', $displayString) && get_terms_meta($catID, 'inactive')) {
                $hostShows[get_cat_name($catID)] = site_URL() . '/' . getCatSlug($catID);
            }
        }
    }
    if ($hostShows) {
        return $author->first_name . "'s " . $displayString . ': ' . andListKeyed($hostShows) . '.<br />';
    }
}