Changeset 483
- Timestamp:
- 03/31/2014 10:42:34 PM (10 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
r235 r483 505 505 } 506 506 507 // Gather relevant data about the session 507 508 $colspan = 1; 508 509 $classes = array(); 509 510 $session = get_post( $entry[ $term_id ] ); 510 511 $session_title = apply_filters( 'the_title', $session->post_title ); 512 $session_tracks = get_the_terms( $session->ID, 'wcb_track' ); 511 513 $session_type = get_post_meta( $session->ID, '_wcpt_session_type', true ); 512 514 … … 514 516 $session_type = 'session'; 515 517 518 // Fetch speakers associated with this session. 519 $speakers = array(); 520 $speakers_ids = array_map( 'absint', (array) get_post_meta( $session->ID, '_wcpt_speaker_id' ) ); 521 if ( ! empty( $speakers_ids ) ) { 522 $speakers = get_posts( array( 523 'post_type' => 'wcb_speaker', 524 'posts_per_page' => -1, 525 'post__in' => $speakers_ids, 526 ) ); 527 } 528 529 // Add CSS classes to help with custom styles 530 foreach ( $speakers as $speaker ) { 531 $classes[] = 'wcb-speaker-' . $speaker->post_name; 532 } 533 534 if ( is_array( $session_tracks ) ) { 535 foreach ( $session_tracks as $session_track ) { 536 $classes[] = 'wcb-track-' . $session_track->slug; 537 } 538 } 539 516 540 $classes[] = 'wcpt-session-type-' . $session_type; 517 541 $classes[] = 'wcb-session-' . $session->post_name; 542 543 // Determine the session title 518 544 if ( 'permalink' == $attr['session_link'] && 'session' == $session_type ) 519 545 $session_title = sprintf( '<a class="wcpt-session-title" href="%s">%s</a>', esc_url( get_permalink( $session->ID ) ), $session_title ); … … 524 550 525 551 $content = $session_title; 526 527 // Fetch speakers associated with this session.528 $speakers = array();529 $speakers_ids = array_map( 'absint', (array) get_post_meta( $session->ID, '_wcpt_speaker_id' ) );530 if ( ! empty( $speakers_ids ) ) {531 $speakers = get_posts( array(532 'post_type' => 'wcb_speaker',533 'posts_per_page' => -1,534 'post__in' => $speakers_ids,535 ) );536 }537 552 538 553 $speakers_names = array();
Note: See TracChangeset
for help on using the changeset viewer.