[wp-meta] [Making WordPress.org] #561: Allowing filtering of speakers by track

Making WordPress.org noreply at wordpress.org
Tue Jul 15 19:46:20 UTC 2014


#561: Allowing filtering of speakers by track
--------------------------+--------------------------
  Reporter:  hlashbrooke  |      Owner:
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Component:  wordcamp.org
Resolution:               |   Keywords:  has-patch
--------------------------+--------------------------

Comment (by iandunn):

 What about something like this?

 {{{
 #!php
 $speaker_ids    = array();
 $track_sessions = get_posts( array(
         'post_type'   => 'wcb_session',
         'numberposts' => -1,
         'tax_query'   => array(
                 array(
                         'taxonomy' => 'wcb_track',
                         'field'    => 'slug',
                         'terms'    => explode( ',', $track_slugs ),
                 ),
         ),
 ) );

 foreach ( $track_sessions as $session ) {
         $session_speaker_ids = get_post_meta( $session->ID,
 '_wcpt_speaker_id' );
         $speaker_ids         = array_merge( $speaker_ids,
 $session_speaker_ids );
 }

 $speakers = get_posts( array(
         'post_type'   => 'wcb_speaker',
         'numberposts' => -1,
         'post__in'    => $speaker_ids,

         // order, etc parameters can still go here
 ) );
 }}}

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/561#comment:3>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list