<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[1717] sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php: WordCamp Post Type: Insert live Multi-Event Sponsor data into new sites.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/1717">1717</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/1717","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>iandunn</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-07-09 22:54:33 +0000 (Thu, 09 Jul 2015)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordCamp Post Type: Insert live Multi-Event Sponsor data into new sites.

Previously it was hard-coded, because at the time we didn't have the Multi Event Sponsor post types on Central. Now that we do, we can pull live data to avoid it becoming out of date.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswcptwcptwordcampwordcampnewsitephp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswcptwcptwordcampwordcampnewsitephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php  2015-07-09 18:00:51 UTC (rev 1716)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php    2015-07-09 22:54:33 UTC (rev 1717)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,6 +71,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $field_name = wcpt_key_to_str( $key, 'wcpt_' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( 'URL' == $key && 'wc-url' == $field_type && isset( $_POST[ $field_name ] ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        // todo use https instead of http
</ins><span class="cx" style="display: block; padding: 0 10px">                         $url = strtolower( substr( $_POST[ $field_name ], 0, 4 ) ) == 'http' ? $_POST[ $field_name ] : 'http://' . $_POST[ $field_name ];
</span><span class="cx" style="display: block; padding: 0 10px">                        $url = set_url_scheme( esc_url_raw( $url ), 'https' );
</span><span class="cx" style="display: block; padding: 0 10px">                        update_post_meta( $wordcamp_id, $key, esc_url( $url ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,6 +94,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // The sponsor region is required so we can import the relevant sponsors and levels
+               if ( ! get_post_meta( $wordcamp_id, 'Multi-Event Sponsor Region', true ) ) {
+                       return;
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $url = parse_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! $url || empty( $url['scheme'] ) || empty( $url['host'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,26 +213,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Create stubs for commonly-used posts
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @todo Create sponsorship levels based on new mes-sponsor-level taxonomy instead of hardcoding
-        *
</del><span class="cx" style="display: block; padding: 0 10px">          * @param WP_Post $wordcamp
</span><span class="cx" style="display: block; padding: 0 10px">         * @param array   $meta
</span><span class="cx" style="display: block; padding: 0 10px">         * @param WP_User $lead_organizer
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        protected function create_post_stubs( $wordcamp, $meta, $lead_organizer ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $assigned_sponsor_data = $this->get_assigned_sponsor_data( $wordcamp->ID );
+               $this->create_sponsorship_levels( $assigned_sponsor_data['assigned_sponsors'] );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // Get stub content
</span><span class="cx" style="display: block; padding: 0 10px">                $stubs = array_merge(
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->get_stub_posts( $wordcamp, $meta ),
</span><span class="cx" style="display: block; padding: 0 10px">                        $this->get_stub_pages( $wordcamp, $meta ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->get_stub_me_sponsors( $wordcamp, $meta ),
-                       $this->get_stub_me_sponsor_thank_yous( $wordcamp, $meta )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->get_stub_me_sponsors( $assigned_sponsor_data ),
+                       $this->get_stub_me_sponsor_thank_yous( $assigned_sponsor_data )
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Create sponsorship levels -- @todo pull these from Central instead of hardcoding
-               $sponsor_level_ids['champion']   = wp_create_term( 'WordCamp Champion',   'wcb_sponsor_level' );
-               $sponsor_level_ids['accomplice'] = wp_create_term( 'WordCamp Accomplice', 'wcb_sponsor_level' );
-               $sponsor_level_ids['pillar']     = wp_create_term( 'WordCamp Pillar',     'wcb_sponsor_level' );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 // Create actual posts from stubs
</span><span class="cx" style="display: block; padding: 0 10px">                remove_action( 'save_post', array( $GLOBALS['wordcamp_admin'], 'metabox_save' ) ); // prevent this callback from adding all the meta fields from the corresponding wordcamp post to new posts we create
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -265,8 +267,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                // Assign sponsorship level
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if ( isset( $page['term'] ) ) {
-                                       wp_set_post_terms( $page_id, $sponsor_level_ids[ $page['term'] ], 'wcb_sponsor_level', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         if ( 'wcb_sponsor' == $page['type'] && isset( $page['term'] ) ) {
+                                       wp_set_object_terms( $page_id, $page['term'], 'wcb_sponsor_level', true );
</ins><span class="cx" style="display: block; padding: 0 10px">                                 }
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -550,65 +552,46 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Create the sponsorship levels for the assigned Multi-Event Sponsors
+        *
+        * @param array $assigned_sponsors
+        */
+       protected function create_sponsorship_levels( $assigned_sponsors ) {
+               foreach( $assigned_sponsors as $sponsorship_level_id ) {
+                       foreach ( $sponsorship_level_id as $sponsor ) {
+                               wp_create_term(
+                                       $sponsor->sponsorship_level->post_title,
+                                       'wcb_sponsor_level'
+                               );
+                       }
+               }
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Get the content for sponsor stubs
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * These are just the multi-event sponsors. Each camp will also have local sponsors, but they'll add those manually.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @todo - load these from the new Multi_Event_Sponsors post type instead of hardcoding.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @param array   $assigned_sponsor_data
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @param WP_Post $wordcamp
-        * @param array   $meta
-        *
</del><span class="cx" style="display: block; padding: 0 10px">          * @return array
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        protected function get_stub_me_sponsors( $wordcamp, $meta ) {
-               $me_sponsors = array(
-                       array(
-                               'title'          => 'Code Poet',
-                               'content'        => "<p>If you use WordPress to build things for other people, Code Poet wants to make your life easier. No matter whether you freelance on a solo basis, lead a small web shop, make plugins in a dark closet, or crack the whip at a large design firm, Code Poet’s aim is to become your go-to source of information and resources to help you expand your WordPress skills and know-how. To make you better at what you do. To make it easier to make your living and look great doing it.</p> <p>You’re part of a tribe of WordPress designers and developers over 10,000 strong, spanning the entire globe. <a href='http://codepoet.com'>codepoet.com</a> aims to bring the working knowledge and real world strategies of those people into one place, for you to tap into.</p>",
-                               'status'         => 'publish',
-                               'type'           => 'wcb_sponsor',
-                               'featured_image' => 'http://central.wordcamp.org/files/2013/09/Code-Poet-2.png',
-                               'term'           => 'champion'
-                       ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function get_stub_me_sponsors( $assigned_sponsor_data ) {
+               $me_sponsors = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        array(
-                               'title'          => 'WPML',
-                               'content'        => "<p>WPML turns WordPress websites multilingual. It works with caching, SEO and E-Commerce plugins, and allows the building of complete multilingual sites. WPML powers simple blogs as well as corporate and enterprise sites.</p> <p>WPML allows users to translate everything in the site, including content, menus, widgets and even theme and plugin texts. WPML powers over 400,000 commercial websites from all over the world.</p> <p>More information about going multilingual can be found at <a href='http://wpml.org'>WPML.org</a></p>",
-                               'status'         => 'publish',
-                               'type'           => 'wcb_sponsor',
-                               'featured_image' => 'http://central.wordcamp.org/files/2013/09/wpml-web.png',
-                               'term'           => 'accomplice'
-                       ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         foreach ( $assigned_sponsor_data['assigned_sponsors'] as $sponsorship_level_id => $assigned_sponsors ) {
+                       foreach ( $assigned_sponsors as $assigned_sponsor ) {
+                               $me_sponsors[] = array(
+                                       'title'          => $assigned_sponsor->post_title,
+                                       'content'        => $assigned_sponsor->post_content,
+                                       'status'         => 'publish',
+                                       'type'           => 'wcb_sponsor',
+                                       'term'           => $assigned_sponsor->sponsorship_level->post_name,
+                                       'featured_image' => isset( $assigned_sponsor_data['featured_images'][ $assigned_sponsor->ID ] ) ? $assigned_sponsor_data['featured_images'][ $assigned_sponsor->ID ] : '',
+                               );
+                       }
+               }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        array(
-                               'title'          => 'Bluehost',
-                               'content'        => "<p><a href='http://bluehost.com'>Bluehost</a> has been a WordPress partner since 2005 and powers over one million WordPress sites. Their goal is to provide outstanding hosting services and customer support for the best possible price. Bluehost is also constantly innovating and upgrading their services and infrastructure at no additional cost to their customers. Join the millions of other website owners that have already chosen Bluehost and see how they can help you with your site.</p>",
-                               'status'         => 'publish',
-                               'type'           => 'wcb_sponsor',
-                               'featured_image' => 'http://central.wordcamp.org/files/2013/09/bluehost-logo13.png',
-                               'term'           => 'pillar'
-                       ),
-
-                       array(
-                               'title'          => 'DreamHost',
-                               'content'        => "<p>DreamHost is a global Web hosting and cloud services provider with over 350,000 customers and 1.2 million blogs, websites and apps hosted. The company offers a wide spectrum of Web hosting and cloud services including Shared Hosting, Virtual Private Servers (VPS), Dedicated Server Hosting, Domain Name Registration, the cloud storage service, DreamObjects, and the cloud computing service DreamCompute. More information can be found at <a href='http://dreamhost.com'>http://dreamhost.com</a>.</p>",
-                               'status'         => 'publish',
-                               'type'           => 'wcb_sponsor',
-                               'featured_image' => 'http://central.wordcamp.org/files/2013/09/dreamhost_logo-cmyk-no_tag-2012.jpg',
-                               'term'           => 'accomplice'
-                       ),
-
-                       array(
-                               'title'          => 'Media Temple',
-                               'content'        => "<p>From its inception in 1998, (mt) Media Temple has been on a mission to help people and businesses succeed online.</p> <p>Over 125,000 customers in 100 countries now rely on Media Temple’s tools for domain registration, web hosting, business applications, virtual servers, and other cloud services to power more than 1.5 million websites. With 200 dedicated, U.S.-based employees, Media Temple takes pride in our 24/7 customer support. Our customers range from everyday people to top bloggers, creative professionals, and small businesses, as well as large enterprises like Starbucks, Adidas, Samsung, and Toyota.</p> <p>More information can be found anytime on the web at <a href='http://mediatemple.com'>http://mediatemple.com</a> or on Twitter <a href='https://twitter.com/mediatemple'>@MediaTemple</a>.</p>",
-                               'status'         => 'publish',
-                               'type'           => 'wcb_sponsor',
-                               'featured_image' => 'http://central.wordcamp.org/files/2013/12/mt-250x140-dk.png',
-                               'term'           => 'pillar'
-                       ),
-               );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 return $me_sponsors;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -626,12 +609,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                switch_to_blog( BLOG_ID_CURRENT_SITE ); // central.wordcamp.org
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $data['featured_images']    = array();
</ins><span class="cx" style="display: block; padding: 0 10px">                 $data['assigned_sponsors']  = $multi_event_sponsors->get_wordcamp_me_sponsors( $wordcamp_id, 'sponsor_level' );
</span><span class="cx" style="display: block; padding: 0 10px">                $data['sponsorship_levels'] = get_posts( array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'post_type'   => MES_Sponsorship_Level::POST_TYPE_SLUG,
</span><span class="cx" style="display: block; padding: 0 10px">                        'numberposts' => -1
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // todo remove sponsorship levels item and refactor thank you stubs to use new posts in data['assigned_sponsors'][sponsor][sponsorship_level]
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                foreach( $data['assigned_sponsors'] as $sponsorship_level_id => $sponsors ) {
+                       foreach( $sponsors as $sponsor ) {
+                               if ( ! $attachment_id = get_post_thumbnail_id( $sponsor->ID ) ) {
+                                       continue;
+                               }
+
+                               if ( ! $attachment = wp_get_attachment_image_src( $attachment_id, 'full' ) ) {
+                                       continue;
+                               }
+
+                               $data['featured_images'][ $sponsor->ID ] = $attachment[0];
+                       }
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 restore_current_blog();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return $data;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -643,18 +642,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * The MES_Sponsorship_Level post excerpts contain the intro text for these messages, and the MES_Sponsor
</span><span class="cx" style="display: block; padding: 0 10px">         * post excerpts contain the blurb for each sponsor.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @param WP_Post $wordcamp
-        * @param array   $meta
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @param array   $assigned_sponsor_data
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @return array
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        protected function get_stub_me_sponsor_thank_yous( $wordcamp, $meta ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function get_stub_me_sponsor_thank_yous( $assigned_sponsor_data ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 /** @var $multi_event_sponsors Multi_Event_Sponsors */
</span><span class="cx" style="display: block; padding: 0 10px">                global $multi_event_sponsors;
</span><span class="cx" style="display: block; padding: 0 10px">                $pages = array();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $assigned_sponsor_data = $this->get_assigned_sponsor_data( $wordcamp->ID );
-
</del><span class="cx" style="display: block; padding: 0 10px">                 foreach ( $assigned_sponsor_data['sponsorship_levels'] as $sponsorship_level ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! empty( $assigned_sponsor_data['assigned_sponsors'][ $sponsorship_level->ID ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                $pages[] = array(
</span></span></pre>
</div>
</div>

</body>
</html>