Changeset 2730 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php
- Timestamp:
- 03/10/2016 07:19:29 PM (10 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
r2506 r2730 586 586 'term' => $assigned_sponsor->sponsorship_level->post_name, 587 587 'featured_image' => isset( $assigned_sponsor_data['featured_images'][ $assigned_sponsor->ID ] ) ? $assigned_sponsor_data['featured_images'][ $assigned_sponsor->ID ] : '', 588 'meta' => $this->get_stub_me_sponsors_meta( $assigned_sponsor ), 588 589 ); 589 590 } … … 591 592 592 593 return $me_sponsors; 594 } 595 596 /** 597 * Get the meta data for a `mes` post and prepare it for importing into a `wcb_sponsor` post 598 * 599 * @param WP_Post $assigned_sponsor 600 * 601 * @return array 602 */ 603 protected function get_stub_me_sponsors_meta( $assigned_sponsor ) { 604 $sponsor_meta = array(); 605 $meta_field_keys = array( 606 'company_name', 'website', 'first_name', 'last_name', 'email_address', 'phone_number', 607 'street_address1', 'street_address2', 'city', 'state', 'zip_code', 'country' 608 ); 609 610 switch_to_blog( BLOG_ID_CURRENT_SITE ); 611 612 foreach ( $meta_field_keys as $key ) { 613 $sponsor_meta["_wcpt_sponsor_$key"] = get_post_meta( $assigned_sponsor->ID, "mes_$key", true ); 614 } 615 616 restore_current_blog(); 617 618 return $sponsor_meta; 593 619 } 594 620
Note: See TracChangeset
for help on using the changeset viewer.