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 efbd160..3dc7a0b 100644
|
|
class WordCamp_Post_Types_Plugin { |
281 | 281 | 'order' => 'desc', |
282 | 282 | 'track' => '', |
283 | 283 | 'speaker_link' => '', |
| 284 | 'groups' => '', |
284 | 285 | ), $attr ); |
285 | 286 | |
286 | 287 | foreach ( array( 'orderby', 'order', 'track', 'speaker_link' ) as $key_for_case_sensitive_value ) { |
… |
… |
class WordCamp_Post_Types_Plugin { |
292 | 293 | $attr['order'] = in_array( $attr['order'], array( 'asc', 'desc' ) ) ? $attr['order'] : 'desc'; |
293 | 294 | $attr['speaker_link'] = in_array( $attr['speaker_link'], array( 'permalink' ) ) ? $attr['speaker_link'] : ''; |
294 | 295 | $attr['track'] = array_map( 'trim', explode( ',', $attr['track'] ) ); |
| 296 | $attr['groups'] = array_map( 'trim', explode( ',', $attr['groups'] ) ); |
295 | 297 | |
296 | 298 | // Fetch all the relevant sessions |
297 | 299 | $session_args = array( |
… |
… |
class WordCamp_Post_Types_Plugin { |
347 | 349 | $speaker_args['post__in'] = $speaker_ids; |
348 | 350 | } |
349 | 351 | |
| 352 | if ( ! empty( $attr['groups'] ) ) { |
| 353 | $speaker_args['tax_query'] = array( |
| 354 | array( |
| 355 | 'taxonomy' => 'wcb_speaker_group', |
| 356 | 'field' => 'slug', |
| 357 | 'terms' => $attr['groups'], |
| 358 | ), |
| 359 | ); |
| 360 | } |
| 361 | |
350 | 362 | $speakers = new WP_Query( $speaker_args ); |
351 | 363 | |
352 | 364 | if ( ! $speakers->have_posts() ) |
… |
… |
class WordCamp_Post_Types_Plugin { |
2056 | 2106 | 'show_ui' => true, |
2057 | 2107 | ) |
2058 | 2108 | ); |
| 2109 | |
| 2110 | // Labels for speaker groups. |
| 2111 | $labels = array( |
| 2112 | 'name' => __( 'Groups', 'wordcamporg' ), |
| 2113 | 'singular_name' => __( 'Group', 'wordcamporg' ), |
| 2114 | 'search_items' => __( 'Search Groups', 'wordcamporg' ), |
| 2115 | 'popular_items' => __( 'Popular Groups', 'wordcamporg' ), |
| 2116 | 'all_items' => __( 'All Groups', 'wordcamporg' ), |
| 2117 | 'edit_item' => __( 'Edit Group', 'wordcamporg' ), |
| 2118 | 'update_item' => __( 'Update Group', 'wordcamporg' ), |
| 2119 | 'add_new_item' => __( 'Add Group', 'wordcamporg' ), |
| 2120 | 'new_item_name' => __( 'New Group', 'wordcamporg' ), |
| 2121 | ); |
| 2122 | |
| 2123 | // Register speaker groups taxonomy |
| 2124 | register_taxonomy( |
| 2125 | 'wcb_speaker_group', |
| 2126 | 'wcb_speaker', |
| 2127 | array( |
| 2128 | 'labels' => $labels, |
| 2129 | 'rewrite' => array( 'slug' => 'speaker-group' ), |
| 2130 | 'query_var' => 'group', |
| 2131 | 'hierarchical' => true, |
| 2132 | 'public' => true, |
| 2133 | 'show_ui' => true, |
| 2134 | ) |
| 2135 | ); |
2059 | 2136 | } |
2060 | 2137 | |
2061 | 2138 | /** |