/** * Add body classes for SP pages * * @param array $classes * @return array */ function sp_body_class($classes) { $classes = (array) $classes; if (is_sportspress()) { $classes[] = 'sportspress'; $classes[] = 'sportspress-page'; } $post_type = get_post_type(); if ('sp_event' == $post_type) { $id = get_the_ID(); if (get_option('sportspress_event_show_maps', 'yes') == 'yes' && get_the_terms($id, 'sp_venue')) { $classes[] = 'sp-has-venue'; } if ('results' == sp_get_status($id)) { $classes[] = 'sp-has-results'; } } elseif ('sp_team' == $post_type && 'yes' == get_option('sportspress_team_show_logo', 'yes')) { $classes[] = 'sp-show-image'; } elseif ('sp_player' == $post_type && 'yes' == get_option('sportspress_player_show_photo', 'yes')) { $classes[] = 'sp-show-image'; } elseif ('sp_staff' == $post_type && 'yes' == get_option('sportspress_staff_show_photo', 'yes')) { $classes[] = 'sp-show-image'; } return array_unique($classes); }
public function event_content($content) { if (is_singular('sp_event')) { $status = sp_get_status(get_the_ID()); if ('results' == $status) { $caption = __('Recap', 'sportspress'); } else { $caption = __('Preview', 'sportspress'); } $content = self::add_content($content, 'event', apply_filters('sportspress_event_content_priority', 10), $caption); } return $content; }