Changeset 5546 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
- Timestamp:
- 06/07/2017 12:43:23 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
r5545 r5546 282 282 'track' => '', 283 283 'speaker_link' => '', 284 'groups' => '', 284 285 ), $attr ); 285 286 … … 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 … … 346 348 if ( ! empty( $attr['track'] ) ) { 347 349 $speaker_args['post__in'] = $speaker_ids; 350 } 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 ); 348 360 } 349 361 … … 2057 2069 ) 2058 2070 ); 2071 2072 // Labels for speaker groups. 2073 $labels = array( 2074 'name' => __( 'Groups', 'wordcamporg' ), 2075 'singular_name' => __( 'Group', 'wordcamporg' ), 2076 'search_items' => __( 'Search Groups', 'wordcamporg' ), 2077 'popular_items' => __( 'Popular Groups', 'wordcamporg' ), 2078 'all_items' => __( 'All Groups', 'wordcamporg' ), 2079 'edit_item' => __( 'Edit Group', 'wordcamporg' ), 2080 'update_item' => __( 'Update Group', 'wordcamporg' ), 2081 'add_new_item' => __( 'Add Group', 'wordcamporg' ), 2082 'new_item_name' => __( 'New Group', 'wordcamporg' ), 2083 ); 2084 2085 // Register speaker groups taxonomy 2086 register_taxonomy( 2087 'wcb_speaker_group', 2088 'wcb_speaker', 2089 array( 2090 'labels' => $labels, 2091 'rewrite' => array( 'slug' => 'speaker_group' ), 2092 'query_var' => 'speaker_group', 2093 'hierarchical' => true, 2094 'public' => true, 2095 'show_ui' => true, 2096 'show_in_rest' => true, 2097 'rest_base' => 'speaker_group', 2098 ) 2099 ); 2059 2100 } 2060 2101
Note: See TracChangeset
for help on using the changeset viewer.