<!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>[1302] sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors: Multi Event Sponsors: Refactor the Regions taxonomy into its own class.</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/1302">1302</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/1302","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-02-24 19:58:53 +0000 (Tue, 24 Feb 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'>Multi Event Sponsors: Refactor the Regions taxonomy into its own class.

There was arguably already enough code to warrant putting it in its own file, and I'm going to be adding more soon.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsbootstrapphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/bootstrap.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmessponsorphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/mes-sponsor.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmessponsorshiplevelphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/mes-sponsorship-level.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmultieventsponsorsphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/multi-event-sponsors.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmesregionphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/mes-region.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsbootstrapphp"></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/multi-event-sponsors/bootstrap.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/multi-event-sponsors/bootstrap.php        2015-02-24 19:56:46 UTC (rev 1301)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/bootstrap.php  2015-02-24 19:58:53 UTC (rev 1302)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,10 +12,12 @@
</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"> require_once( __DIR__ . '/classes/multi-event-sponsors.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require_once( __DIR__ . '/classes/mes-region.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once( __DIR__ . '/classes/mes-sponsor.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require_once( __DIR__ . '/classes/mes-sponsorship-level.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['multi_event_sponsors']  = new Multi_Event_Sponsors();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$GLOBALS['mes_sponsor']           = new MES_Region();
</ins><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['mes_sponsor']           = new MES_Sponsor();
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['mes_sponsorship_level'] = new MES_Sponsorship_Level();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmesregionphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/mes-region.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/multi-event-sponsors/classes/mes-region.php                               (rev 0)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/mes-region.php 2015-02-24 19:58:53 UTC (rev 1302)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,99 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+/*
+ * Register the Regions taxonomy and manage all of its related functionality
+ *
+ * See note in MES_Sponsor class documentation on the use of custom post types and taxonomies for regions and
+ * sponsorship levels.
+ */
+
+class MES_Region {
+       const TAXONOMY_SLUG = 'mes-regions';
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               add_action( 'init',               array( $this, 'create_taxonomy' ) );
+               add_action( 'add_meta_boxes' ,    array( $this, 'remove_meta_box' ),             10, 2 );
+               add_action( 'wcpt_metabox_value', array( $this, 'wcpt_region_dropdown_render' ), 10, 3 );
+               add_action( 'wcpt_metabox_save',  array( $this, 'wcpt_region_dropdown_save' ),   10, 3 );
+       }
+
+       /**
+        * Registers the regions taxonomy
+        */
+       public function create_taxonomy() {
+               $region_params = array(
+                       'label'                 => __( 'Region', 'wordcamporg' ),
+                       'labels'                => array(
+                               'name'          => __( 'Regions', 'wordcamporg' ),
+                               'singular_name' => __( 'Region', 'wordcamporg' )
+                       ),
+                       'hierarchical'          => true,
+                       'rewrite'               => array( 'slug' => self::TAXONOMY_SLUG ),
+               );
+
+               if ( ! taxonomy_exists( self::TAXONOMY_SLUG ) ) {
+                       register_taxonomy( self::TAXONOMY_SLUG, MES_Sponsor::POST_TYPE_SLUG, $region_params );
+               }
+       }
+
+       /**
+        * Remove the region meta box from the post types it's registered with, since the terms aren't assigned to
+        * them directly.
+        *
+        * @param string  $post_type
+        * @param WP_Post $post
+        */
+       public function remove_meta_box( $post_type, $post ) {
+               $registered_post_types = array(
+                       MES_Sponsor::POST_TYPE_SLUG,
+                       MES_Sponsorship_Level::POST_TYPE_SLUG
+               );
+
+               if ( ! in_array( $post_type, $registered_post_types ) ) {
+                       return;
+               }
+
+               remove_meta_box( 'mes-regionsdiv', null, 'side' );
+       }
+
+       /**
+        * Render the dropdown element with regions for the WordCamp Post Type plugin
+        *
+        * @param string $key
+        * @param string $value
+        * @param string $field_name
+        */
+       public function wcpt_region_dropdown_render( $key, $value, $field_name ) {
+               if ( 'Multi-Event Sponsor Region' != $key ) {
+                       return;
+               }
+
+               global $post;
+
+               $regions         = get_terms( self::TAXONOMY_SLUG, array( 'hide_empty' => false ) );
+               $selected_region = get_post_meta( $post->ID, $key, true );
+
+               require( dirname( __DIR__ ) . '/views/template-region-dropdown.php' );
+       }
+
+       /**
+        * Save the dropdown element with regions for the WordCamp Post Type plugin
+        *
+        * @param string $key
+        * @param string $value
+        * @param int    $post_id
+        */
+       public function wcpt_region_dropdown_save( $key, $value, $post_id ) {
+               if ( 'Multi-Event Sponsor Region' != $key ) {
+                       return;
+               }
+
+               $post_key = wcpt_key_to_str( $key, 'wcpt_' );
+               if ( isset( $_POST[ $post_key ] ) ) {
+                       update_post_meta( $post_id, $key, absint( $_POST[ $post_key ] ) );
+               }
+       }
+} // end MES_Region
</ins></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmessponsorphp"></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/multi-event-sponsors/classes/mes-sponsor.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/multi-event-sponsors/classes/mes-sponsor.php      2015-02-24 19:56:46 UTC (rev 1301)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/mes-sponsor.php        2015-02-24 19:58:53 UTC (rev 1302)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,20 +13,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> class MES_Sponsor {
</span><span class="cx" style="display: block; padding: 0 10px">        const POST_TYPE_SLUG     = 'mes';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        const REGIONS_SLUG       = 'mes-regions';
</del><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">         * Constructor
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function __construct() {
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'init',                                   array( $this, 'create_post_type' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_action( 'init',                                   array( $this, 'create_taxonomies' ) );
-               add_action( 'add_meta_boxes_' . self::POST_TYPE_SLUG, array( $this, 'remove_meta_boxes' ) );
</del><span class="cx" style="display: block; padding: 0 10px">                 add_action( 'admin_init',                             array( $this, 'add_meta_boxes' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'save_post',                              array( $this, 'save_post' ), 10, 2 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_action( 'wcpt_metabox_value',                     array( $this, 'wcpt_region_dropdown_render' ), 10, 3 );
-               add_action( 'wcpt_metabox_save',                      array( $this, 'wcpt_region_dropdown_save' ), 10, 3 );
</del><span class="cx" style="display: block; padding: 0 10px">                 add_filter( 'the_content',                            array( $this, 'add_header_footer_text' ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               // todo readjust whitespace after this commit
</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">@@ -64,32 +61,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'rewrite'         => array( 'slug' => 'multi-event-sponsor', 'with_front' => false ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'query_var'       => true,
</span><span class="cx" style="display: block; padding: 0 10px">                        'supports'        => array( 'title', 'editor', 'author', 'excerpt', 'revisions', 'thumbnail' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'taxonomies'      => array( self::REGIONS_SLUG ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'taxonomies'      => array( MES_Region::TAXONOMY_SLUG ),
</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">                register_post_type( self::POST_TYPE_SLUG, $post_type_params );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Registers the category taxonomy
-        */
-       public function create_taxonomies() {
-               $region_params = array(
-                       'label'                 => __( 'Region', 'wordcamporg' ),
-                       'labels'                => array(
-                               'name'          => __( 'Regions', 'wordcamporg' ),
-                               'singular_name' => __( 'Region', 'wordcamporg' )
-                       ),
-                       'hierarchical'          => true,
-                       'rewrite'               => array( 'slug' => self::REGIONS_SLUG ),
-               );
-
-               if ( ! taxonomy_exists( self::REGIONS_SLUG ) ) {
-                       register_taxonomy( self::REGIONS_SLUG, self::POST_TYPE_SLUG, $region_params );
-               }
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * Adds meta boxes for the custom post type
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function add_meta_boxes() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -97,7 +75,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'mes_regional_sponsorships',
</span><span class="cx" style="display: block; padding: 0 10px">                        __( 'Regional Sponsorships', 'wordcamporg' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        array( $this, 'markup_meta_boxes' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        self::POST_TYPE_SLUG,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 MES_Sponsor::POST_TYPE_SLUG,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'normal',
</span><span class="cx" style="display: block; padding: 0 10px">                        'default'
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -106,22 +84,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'mes_contact_information',
</span><span class="cx" style="display: block; padding: 0 10px">                        __( 'Contact Information', 'wordcamporg' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        array( $this, 'markup_meta_boxes' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        self::POST_TYPE_SLUG,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 MES_Sponsor::POST_TYPE_SLUG,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'normal',
</span><span class="cx" style="display: block; padding: 0 10px">                        'default'
</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><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Remove the taxonomy meta boxes, since we don't assign them directly.
-        *
-        * @param WP_Post $post
-        */
-       public function remove_meta_boxes( $post ) {
-               remove_meta_box( 'mes-regionsdiv', null, 'side' );
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * Builds the markup for all meta boxes
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param WP_Post $post
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +101,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                switch ( $box['id'] ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'mes_regional_sponsorships':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $regions               = get_terms( self::REGIONS_SLUG, array( 'hide_empty' => false ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $regions               = get_terms( MES_Region::TAXONOMY_SLUG, array( 'hide_empty' => false ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $sponsorship_levels    = get_posts( array( 'post_type' => MES_Sponsorship_Level::POST_TYPE_SLUG, 'numberposts' => -1 ) );
</span><span class="cx" style="display: block; padding: 0 10px">                                $regional_sponsorships = $this->populate_default_regional_sponsorships( get_post_meta( $post->ID, 'mes_regional_sponsorships', true ), $regions );
</span><span class="cx" style="display: block; padding: 0 10px">                                $view                  = 'metabox-regional-sponsorships.php';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,44 +199,6 @@
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Render the dropdown element with regions for the WordCamp Post Type plugin
-        *
-        * @param string $key
-        * @param string $value
-        * @param string $field_name
-        */
-       public function wcpt_region_dropdown_render( $key, $value, $field_name ) {
-               if ( 'Multi-Event Sponsor Region' != $key ) {
-                       return;
-               }
-
-               global $post;
-
-               $regions         = get_terms( self::REGIONS_SLUG, array( 'hide_empty' => false ) );
-               $selected_region = get_post_meta( $post->ID, $key, true );
-
-               require( dirname( __DIR__ ) . '/views/template-region-dropdown.php' );
-       }
-
-       /**
-        * Save the dropdown element with regions for the WordCamp Post Type plugin
-        *
-        * @param string $key
-        * @param string $value
-        * @param int    $post_id
-        */
-       public function wcpt_region_dropdown_save( $key, $value, $post_id ) {
-               if ( 'Multi-Event Sponsor Region' != $key ) {
-                       return;
-               }
-
-               $post_key = wcpt_key_to_str( $key, 'wcpt_' );
-               if ( isset( $_POST[ $post_key ] ) ) {
-                       update_post_meta( $post_id, $key, absint( $_POST[ $post_key ] ) );
-               }
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * Add the header and footer copy to the sponsorship level content
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string $content
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmessponsorshiplevelphp"></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/multi-event-sponsors/classes/mes-sponsorship-level.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/multi-event-sponsors/classes/mes-sponsorship-level.php    2015-02-24 19:56:46 UTC (rev 1301)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/mes-sponsorship-level.php      2015-02-24 19:58:53 UTC (rev 1302)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,10 +15,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function __construct() {
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'init',                                   array( $this, 'create_post_type' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_action( 'add_meta_boxes_' . self::POST_TYPE_SLUG, array( $this, 'remove_meta_boxes' ) );
</del><span class="cx" style="display: block; padding: 0 10px">                 add_action( 'admin_init',                             array( $this, 'add_meta_boxes' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'save_post',                              array( $this, 'save_post' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'the_content',                            array( $this, 'add_header_footer_text' ) );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               // todo readjust whitepsace after this commit
</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">@@ -57,22 +58,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'rewrite'         => array( 'slug' => 'sponsorship-level', 'with_front' => false ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'query_var'       => true,
</span><span class="cx" style="display: block; padding: 0 10px">                        'supports'        => array( 'title', 'editor', 'author', 'excerpt', 'revisions' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'taxonomies'      => array( MES_Sponsor::REGIONS_SLUG ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'taxonomies'      => array( MES_Region::TAXONOMY_SLUG ),
</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">                register_post_type( self::POST_TYPE_SLUG, $post_type_params );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Remove the taxonomy meta boxes, since we don't assign them directly.
-        *
-        * @param WP_Post $post
-        */
-       public function remove_meta_boxes( $post ) {
-               remove_meta_box( 'mes-regionsdiv', null, 'side' );
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * Adds meta boxes for the custom post type
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function add_meta_boxes() {
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginsmultieventsponsorsclassesmultieventsponsorsphp"></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/multi-event-sponsors/classes/multi-event-sponsors.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/multi-event-sponsors/classes/multi-event-sponsors.php     2015-02-24 19:56:46 UTC (rev 1301)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/multi-event-sponsors.php       2015-02-24 19:58:53 UTC (rev 1302)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,7 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function shortcode_multi_event_sponsors( $parameters ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $sponsors           = $this->reindex_array_by_object_id( get_posts( array( 'post_type' => MES_Sponsor::POST_TYPE_SLUG, 'numberposts' => -1 ) ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $regions            = $this->reindex_array_by_object_id( get_terms( MES_Sponsor::REGIONS_SLUG, array( 'hide_empty' => false ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $regions            = $this->reindex_array_by_object_id( get_terms( MES_Region::TAXONOMY_SLUG, array( 'hide_empty' => false ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $sponsorship_levels = $this->reindex_array_by_object_id( get_posts( array( 'post_type' => MES_Sponsorship_Level::POST_TYPE_SLUG, 'numberposts' => -1 ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">                $grouped_sponsors   = $this->group_sponsors_by_region_and_level( $sponsors );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,8 +54,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * This makes for efficient direct access when the ID is known.
</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 $array
-        * @return mixed
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  * @param array $old_array
+        * @return array
</ins><span class="cx" style="display: block; padding: 0 10px">          */
</span><span class="cx" style="display: block; padding: 0 10px">        protected function reindex_array_by_object_id( $old_array ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $new_array = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,8 +123,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @return int
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        protected function uksort_regions( $region_a_id, $region_b_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $region_a = get_term( $region_a_id, MES_Sponsor::REGIONS_SLUG );
-               $region_b = get_term( $region_b_id, MES_Sponsor::REGIONS_SLUG );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $region_a = get_term( $region_a_id, MES_Region::TAXONOMY_SLUG );
+               $region_b = get_term( $region_b_id, MES_Region::TAXONOMY_SLUG );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $region_a->name == $region_b->name ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return 0;
</span></span></pre>
</div>
</div>

</body>
</html>