Ticket #355: wc-post-types.php.diff
File wc-post-types.php.diff, 3.6 KB (added by , 11 years ago) |
---|
-
wc-post-types.php
510 510 $session_title = apply_filters( 'the_title', $session->post_title ); 511 511 $session_type = get_post_meta( $session->ID, '_wcpt_session_type', true ); 512 512 513 // Fetch speakers associated with this session. 514 $speakers = array(); 515 $speakers_ids = array_map( 'absint', (array) get_post_meta( $session->ID, '_wcpt_speaker_id' ) ); 516 if ( ! empty( $speakers_ids ) ) { 517 $speakers = get_posts( array( 518 'post_type' => 'wcb_speaker', 519 'posts_per_page' => -1, 520 'post__in' => $speakers_ids, 521 ) ); 522 } 523 524 foreach ( $speakers as $speaker ) { 525 $classes[] = esc_attr( $speaker->post_name ); 526 } 527 513 528 if ( ! in_array( $session_type, array( 'session', 'custom' ) ) ) 514 529 $session_type = 'session'; 515 530 516 531 $classes[] = 'wcpt-session-type-' . $session_type; 532 $classes[] = esc_attr( $session->post_name ); 533 534 $session_tracks = get_the_terms( $session->ID, 'wcb_track' ); 535 536 if ( false != $session_tracks ) { 537 foreach ( $session_tracks as $session_track ) { 538 $classes[] = esc_attr( $session_track->slug ); 539 } 540 } 517 541 542 $session_tags = get_the_terms( $session->ID, 'wcb_session_tag' ); 543 if ( false != $session_tags ) { 544 foreach ( $session_tags as $session_tag ) { 545 $classes[] = esc_attr( $session_tag->slug ); 546 } 547 } 548 518 549 if ( 'permalink' == $attr['session_link'] && 'session' == $session_type ) 519 550 $session_title = sprintf( '<a class="wcpt-session-title" href="%s">%s</a>', esc_url( get_permalink( $session->ID ) ), $session_title ); 520 551 elseif ( 'anchor' == $attr['session_link'] && 'session' == $session_type ) … … 524 555 525 556 $content = $session_title; 526 557 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 538 558 $speakers_names = array(); 539 559 foreach ( $speakers as $speaker ) { 540 560 $speaker_name = apply_filters( 'the_title', $speaker->post_title ); … … 1404 1424 'show_ui' => true, 1405 1425 ) ); 1406 1426 1427 // Labels for Session Tags 1428 $labels = array( 1429 'name' => __( 'Session Tags', $this->textdomain ), 1430 'singular_name' => __( 'Session Tag', $this->textdomain ), 1431 'search_items' => __( 'Search Session Tags', $this->textdomain ), 1432 'popular_items' => __( 'Popular Session Tags',$this->textdomain ), 1433 'all_items' => __( 'All Session Tags', $this->textdomain ), 1434 'edit_item' => __( 'Edit Session Tag', $this->textdomain ), 1435 'update_item' => __( 'Update Session Tag', $this->textdomain ), 1436 'add_new_item' => __( 'Add Session Tag', $this->textdomain ), 1437 'new_item_name' => __( 'New Session Tag', $this->textdomain ), 1438 ); 1439 1440 // Register the Session Tag taxonomy. 1441 register_taxonomy( 'wcb_session_tag', 'wcb_session', array( 1442 'labels' => $labels, 1443 'rewrite' => array( 'slug' => 'session_tag' ), 1444 'query_var' => 'session_tag', 1445 'hierarchical' => false, 1446 'public' => true, 1447 'show_ui' => true, 1448 ) ); 1449 1407 1450 // Labels for sponsor levels. 1408 1451 $labels = array( 1409 1452 'name' => __( 'Sponsor Levels', $this->textdomain ),