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 a2f8038..1798952 100644
|
|
function wcorg_content_slugs_to_body_tag( $body_classes ) { |
202 | 202 | } |
203 | 203 | add_filter( 'body_class', 'wcorg_content_slugs_to_body_tag' ); |
204 | 204 | |
| 205 | |
| 206 | /** |
| 207 | * Add the sessions's category slugs to the body tag |
| 208 | * |
| 209 | * @param array $body_classes |
| 210 | * |
| 211 | * @return array |
| 212 | */ |
| 213 | function wcorg_session_category_slugs_to_body_tag( $body_classes ) { |
| 214 | global $wp_query; |
| 215 | $post = $wp_query->get_queried_object(); |
| 216 | |
| 217 | if ( is_a( $post, 'WP_Post' ) && 'wcb_session' === $post->post_type ) { |
| 218 | $session_categories = get_the_terms( $post->ID, 'wcb_session_category' ); |
| 219 | |
| 220 | if ( is_array( $session_categories ) ) { |
| 221 | foreach ( $session_categories as $session_category ) { |
| 222 | $body_classes[] = 'wcb-session-category-' . $session_category->slug; |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | return $body_classes; |
| 228 | } |
| 229 | add_filter( 'body_class', 'wcorg_session_category_slugs_to_body_tag' ); |
| 230 | |
205 | 231 | /* |
206 | 232 | * Flush the rewrite rules on the current site. |
207 | 233 | * |
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 bbdca08..fd245dc 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 { |
1353 | 1354 | } |
1354 | 1355 | |
1355 | 1356 | /** |
| 1357 | * Add session's categories to Session posts |
| 1358 | * |
| 1359 | * @param string $content |
| 1360 | * |
| 1361 | * @return string |
| 1362 | */ |
| 1363 | function add_session_categories_to_session_posts( $content ) { |
| 1364 | global $post; |
| 1365 | |
| 1366 | if ( ! $this->is_single_cpt_post( 'wcb_session' ) ) { |
| 1367 | return $content; |
| 1368 | } |
| 1369 | |
| 1370 | $session_categories_html = ''; |
| 1371 | |
| 1372 | $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' ) ); |
| 1373 | if ( $session_categories_list ) { |
| 1374 | $session_categories_html = sprintf( '<span class="session-categories-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', |
| 1375 | _x( 'Categories', 'Used before session category names.', 'wordcamporg' ), |
| 1376 | $session_categories_list |
| 1377 | ); |
| 1378 | } |
| 1379 | |
| 1380 | return $content . $session_categories_html; |
| 1381 | } |
| 1382 | |
| 1383 | /** |
1356 | 1384 | * Add session information to Speaker posts |
1357 | 1385 | * |
1358 | 1386 | * We don't enable it for sites that were created before it was committed, because some will have already |