diff --git wordcamp.org/public_html/wp-content/mu-plugins/wcorg-misc.php wordcamp.org/public_html/wp-content/mu-plugins/wcorg-misc.php
index e53ea67..9fcc325 100644
|
|
function wcorg_content_slugs_to_body_tag( $body_classes ) { |
203 | 203 | } |
204 | 204 | add_filter( 'body_class', 'wcorg_content_slugs_to_body_tag' ); |
205 | 205 | |
| 206 | |
| 207 | /** |
| 208 | * Add the sessions's category slugs to the body tag |
| 209 | * |
| 210 | * @param array $body_classes |
| 211 | * |
| 212 | * @return array |
| 213 | */ |
| 214 | function wcorg_session_category_slugs_to_body_tag( $body_classes ) { |
| 215 | global $wp_query; |
| 216 | $post = $wp_query->get_queried_object(); |
| 217 | |
| 218 | if ( is_a( $post, 'WP_Post' ) && 'wcb_session' === $post->post_type ) { |
| 219 | $session_categories = get_the_terms( $post->ID, 'wcb_session_category' ); |
| 220 | |
| 221 | if ( is_array( $session_categories ) ) { |
| 222 | foreach ( $session_categories as $session_category ) { |
| 223 | $body_classes[] = 'wcb-session-category-' . $session_category->slug; |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | return $body_classes; |
| 229 | } |
| 230 | add_filter( 'body_class', 'wcorg_session_category_slugs_to_body_tag' ); |
| 231 | |
206 | 232 | /* |
207 | 233 | * Flush the rewrite rules on the current site. |
208 | 234 | * |
diff --git wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
index 503bbff..225ca94 100644
|
|
class WordCamp_Post_Types_Plugin { |
54 | 54 | add_filter( 'the_content', array( $this, 'add_speaker_info_to_session_posts' ) ); |
55 | 55 | add_filter( 'the_content', array( $this, 'add_slides_info_to_session_posts' ) ); |
56 | 56 | add_filter( 'the_content', array( $this, 'add_video_info_to_session_posts' ) ); |
| 57 | add_filter( 'the_content', array( $this, 'add_session_categories_to_session_posts' ) ); |
57 | 58 | add_filter( 'the_content', array( $this, 'add_session_info_to_speaker_posts' ) ); |
58 | 59 | |
59 | 60 | add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ) ); |
… |
… |
class WordCamp_Post_Types_Plugin { |
1413 | 1414 | } |
1414 | 1415 | |
1415 | 1416 | /** |
| 1417 | * Add session's categories to Session posts |
| 1418 | * |
| 1419 | * @param string $content |
| 1420 | * |
| 1421 | * @return string |
| 1422 | */ |
| 1423 | function add_session_categories_to_session_posts( $content ) { |
| 1424 | global $post; |
| 1425 | |
| 1426 | if ( ! $this->is_single_cpt_post( 'wcb_session' ) ) { |
| 1427 | return $content; |
| 1428 | } |
| 1429 | |
| 1430 | $session_categories_html = ''; |
| 1431 | |
| 1432 | $session_categories_list = get_the_term_list( $post->ID, 'wcb_session_category', '', _x( ', ', 'Used between list items, there is a space after the comma.', 'wordcamporg' ) ); |
| 1433 | if ( $session_categories_list ) { |
| 1434 | $session_categories_html = sprintf( '<span class="session-categories-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', |
| 1435 | _x( 'Categories', 'Used before session category names.', 'wordcamporg' ), |
| 1436 | $session_categories_list |
| 1437 | ); |
| 1438 | } |
| 1439 | |
| 1440 | return $content . $session_categories_html; |
| 1441 | } |
| 1442 | |
| 1443 | /** |
1416 | 1444 | * Add session information to Speaker posts |
1417 | 1445 | * |
1418 | 1446 | * We don't enable it for sites that were created before it was committed, because some will have already |
… |
… |
class WordCamp_Post_Types_Plugin { |
2146 | 2174 | // Register the Categories taxonomy. |
2147 | 2175 | register_taxonomy( 'wcb_session_category', 'wcb_session', array( |
2148 | 2176 | 'labels' => $labels, |
2149 | | 'rewrite' => array( 'slug' => 'session_category' ), |
| 2177 | 'rewrite' => array( 'slug' => 'session-category' ), |
2150 | 2178 | 'query_var' => 'session_category', |
2151 | 2179 | 'hierarchical' => true, |
2152 | 2180 | 'public' => true, |