Ticket #2159: 2159.diff
File 2159.diff, 2.3 KB (added by , 9 years ago) |
---|
-
wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php
404 404 'avatar_size' => 100, 405 405 'posts_per_page' => -1, 406 406 'orderby' => 'date', 407 'team' => '', 407 408 ), $attr ); 408 409 409 410 $attr['show_avatars'] = $this->str_to_bool( $attr['show_avatars'] ); … … 410 411 $attr['orderby'] = strtolower( $attr['orderby'] ); 411 412 $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ) ? $attr['orderby'] : 'date'; 412 413 413 $ organizers = new WP_Query(array(414 $query_args = array( 414 415 'post_type' => 'wcb_organizer', 415 416 'posts_per_page' => intval( $attr['posts_per_page'] ), 416 417 'orderby' => $attr['orderby'], 417 ) );418 ); 418 419 420 if ( ! empty( $attr['team'] ) ) { 421 $query_args['tax_query'] = array( 422 array( 423 'taxonomy' => 'wcb_team', 424 'field' => 'slug', 425 'terms' => $attr['team'], 426 ), 427 ); 428 } 429 430 $organizers = new WP_Query( $query_args ); 431 419 432 if ( ! $organizers->have_posts() ) 420 433 return ''; 421 434 … … 2003 2016 'public' => true, 2004 2017 'show_ui' => true, 2005 2018 ) ); 2019 2020 // Labels for organizer teams. 2021 $labels = array( 2022 'name' => __( 'Teams', 'wordcamporg' ), 2023 'singular_name' => __( 'Team', 'wordcamporg' ), 2024 'search_items' => __( 'Search Teams', 'wordcamporg' ), 2025 'popular_items' => __( 'Popular Teams', 'wordcamporg' ), 2026 'all_items' => __( 'All Teams', 'wordcamporg' ), 2027 'edit_item' => __( 'Edit Team', 'wordcamporg' ), 2028 'update_item' => __( 'Update Team', 'wordcamporg' ), 2029 'add_new_item' => __( 'Add Team', 'wordcamporg' ), 2030 'new_item_name' => __( 'New Team', 'wordcamporg' ), 2031 ); 2032 2033 // Register organizer teams taxonomy 2034 register_taxonomy( 'wcb_team', 'wcb_organizer', array( 2035 'labels' => $labels, 2036 'rewrite' => array( 'slug' => 'team' ), 2037 'query_var' => 'team', 2038 'hierarchical' => true, 2039 'public' => true, 2040 'show_ui' => true, 2041 ) ); 2006 2042 } 2007 2043 2008 2044 /**