Making WordPress.org

Changeset 4349

Timestamp:
11/11/2016 09:44:06 PM (8 years ago)
Author:
iandunn
Message:

WordCamp Post Types: Add a taxonomy for organizer teams

Fixes #2159
Props Kau-Boy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php

    r4172 r4349  
    405405            'posts_per_page' => -1,
    406406            'orderby'        => 'date',
     407
    407408        ), $attr );
    408409
     
    411412        $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand' ) ) ) ? $attr['orderby'] : 'date';
    412413
    413         $organizers = new WP_Query( array(
     414        $ array(
    414415            'post_type' => 'wcb_organizer',
    415416            'posts_per_page' => intval( $attr['posts_per_page'] ),
    416417            'orderby' => $attr['orderby'],
    417         ) );
     418        );
     419
     420        if ( ! empty( $attr['teams'] ) ) {
     421            $query_args['tax_query'] = array(
     422                array(
     423                    'taxonomy' => 'wcb_organizer_team',
     424                    'field'    => 'slug',
     425                    'terms'    => explode( ',', $attr['teams'] ),
     426                ),
     427            );
     428        }
     429
     430        $organizers = new WP_Query( $query_args );
    418431
    419432        if ( ! $organizers->have_posts() )
     
    20042017            'show_ui'               => true,
    20052018        ) );
     2019
     2020
     2021
     2022
     2023
     2024
     2025
     2026
     2027
     2028
     2029
     2030
     2031
     2032
     2033
     2034
     2035
     2036
     2037
     2038
     2039
     2040
     2041
     2042
     2043
     2044
     2045
    20062046    }
    20072047
Note: See TracChangeset for help on using the changeset viewer.