Changeset 1571 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php
- Timestamp:
- 05/13/2015 11:17:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php
r1563 r1571 253 253 */ 254 254 protected function get_stub_pages( $wordcamp, $meta ) { 255 // todo remove the to field from all contact forms and notes, just let it default to the admin email 256 255 257 $pages = array( 256 258 array( … … 581 583 582 584 /** 585 * Get the assigned Multi-Event Sponsors and their sponsorship levels for the given WordCamp 586 * 587 * @param int $wordcamp_id 588 * 589 * @return array 590 */ 591 protected function get_assigned_sponsor_data( $wordcamp_id ) { 592 /** @var $multi_event_sponsors Multi_Event_Sponsors */ 593 global $multi_event_sponsors; 594 $data = array(); 595 596 switch_to_blog( BLOG_ID_CURRENT_SITE ); // central.wordcamp.org 597 598 $data['assigned_sponsors'] = $multi_event_sponsors->get_wordcamp_me_sponsors( $wordcamp_id, 'sponsor_level' ); 599 $data['sponsorship_levels'] = get_posts( array( 600 'post_type' => MES_Sponsorship_Level::POST_TYPE_SLUG, 601 'numberposts' => -1 602 ) ); 603 604 restore_current_blog(); 605 606 return $data; 607 } 608 609 /** 583 610 * Generate stub posts for thanking Multi-Event Sponsors 584 611 * … … 596 623 $pages = array(); 597 624 598 switch_to_blog( BLOG_ID_CURRENT_SITE ); // central.wordcamp.org 599 $assigned_me_sponsors = $multi_event_sponsors->get_wordcamp_me_sponsors( $wordcamp->ID, 'sponsor_level' ); 600 $sponsorship_levels = get_posts( array( 601 'post_type' => MES_Sponsorship_Level::POST_TYPE_SLUG, 602 'numberposts' => -1 603 ) ); 604 restore_current_blog(); 605 606 foreach ( $sponsorship_levels as $sponsorship_level ) { 607 if ( ! empty( $assigned_me_sponsors[ $sponsorship_level->ID ] ) ) { 625 $assigned_sponsor_data = $this->get_assigned_sponsor_data( $wordcamp->ID ); 626 627 foreach ( $assigned_sponsor_data['sponsorship_levels'] as $sponsorship_level ) { 628 if ( ! empty( $assigned_sponsor_data['assigned_sponsors'][ $sponsorship_level->ID ] ) ) { 608 629 $pages[] = array( 609 630 'title' => sprintf( __( 'Thank you to our %s sponsors', 'wordcamporg' ), $sponsorship_level->post_title ), … … 612 633 str_replace( 613 634 '[sponsor_names]', 614 $multi_event_sponsors->get_sponsor_names( $assigned_ me_sponsors[ $sponsorship_level->ID ] ),635 $multi_event_sponsors->get_sponsor_names( $assigned_sponsor_data['assigned_sponsors'][ $sponsorship_level->ID ] ), 615 636 $sponsorship_level->post_excerpt 616 637 ), 617 $multi_event_sponsors->get_sponsor_excerpts( $assigned_ me_sponsors[ $sponsorship_level->ID ] )638 $multi_event_sponsors->get_sponsor_excerpts( $assigned_sponsor_data['assigned_sponsors'][ $sponsorship_level->ID ] ) 618 639 ), 619 640 'status' => 'draft',
Note: See TracChangeset
for help on using the changeset viewer.