<!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>[1233] sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php: WordCamp Post Type: Whitespace, readability, coding standards cleanup.</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/1233">1233</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/1233","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-06 22:01:22 +0000 (Fri, 06 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'>WordCamp Post Type: Whitespace, readability, coding standards cleanup.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswcptwcptwordcampwordcampadminphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswcptwcptwordcampwordcampadminphp"></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-admin.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-admin.php 2015-02-06 21:24:50 UTC (rev 1232)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php 2015-02-06 22:01:22 UTC (rev 1233)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( !class_exists( 'WordCamp_Admin' ) ) :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( ! class_exists( 'WordCamp_Admin' ) ) :
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * WCPT_Admin
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,8 +59,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses add_meta_box
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function metabox () {
- add_meta_box (
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function metabox() {
+ add_meta_box(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'wcpt_information',
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'WordCamp Information', 'wcpt' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcpt_wordcamp_metabox',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,7 +69,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'high'
</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">- add_meta_box (
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_meta_box(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'wcpt_organizer_info',
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Organizing Team', 'wcpt' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcpt_organizer_metabox',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'high'
</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">- add_meta_box (
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_meta_box(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'wcpt_venue_info',
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Venue Information', 'wcpt' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcpt_venue_metabox',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -96,7 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function metabox_save ( $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function metabox_save( $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't add/remove meta on revisions and auto-saves
</span><span class="cx" style="display: block; padding: 0 10px"> if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,14 +112,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get post value
</span><span class="cx" style="display: block; padding: 0 10px"> $post_value = wcpt_key_to_str( $key, 'wcpt_' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $values[$key] = isset( $_POST[$post_value] ) ? esc_attr( $_POST[$post_value] ) : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $values[ $key ] = isset( $_POST[ $post_value ] ) ? esc_attr( $_POST[ $post_value ] ) : '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'text' :
</span><span class="cx" style="display: block; padding: 0 10px"> case 'textarea' :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_id, $key, $values[$key] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $key, $values[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'checkbox' :
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $values[ $key ] ) && 'on' == $values[ $key ] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, $key, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,10 +129,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'date' :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( !empty( $values[$key] ) )
- $values[$key] = strtotime( $values[$key] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( !empty( $values[ $key ] ) )
+ $values[ $key ] = strtotime( $values[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- update_post_meta( $post_id, $key, $values[$key] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ update_post_meta( $post_id, $key, $values[ $key ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><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">- function meta_keys ( $meta_group = '' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function meta_keys( $meta_group = '' ) {
</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"> * Warning: These keys are used for both the input field label and the postmeta key, so if you want to
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -158,7 +158,7 @@
</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"> switch ( $meta_group ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'organizer' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'organizer':
</ins><span class="cx" style="display: block; padding: 0 10px"> $retval = array (
</span><span class="cx" style="display: block; padding: 0 10px"> 'Organizer Name' => 'text',
</span><span class="cx" style="display: block; padding: 0 10px"> 'WordPress.org Username' => 'text',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,7 +175,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'venue' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'venue':
</ins><span class="cx" style="display: block; padding: 0 10px"> $retval = array (
</span><span class="cx" style="display: block; padding: 0 10px"> 'Venue Name' => 'text',
</span><span class="cx" style="display: block; padding: 0 10px"> 'Physical Address' => 'textarea',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,7 +187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'wordcamp' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'wordcamp':
</ins><span class="cx" style="display: block; padding: 0 10px"> $retval = array (
</span><span class="cx" style="display: block; padding: 0 10px"> 'Start Date (YYYY-mm-dd)' => 'date',
</span><span class="cx" style="display: block; padding: 0 10px"> 'End Date (YYYY-mm-dd)' => 'date',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -201,8 +201,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'all' :
- default :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'all':
+ default:
</ins><span class="cx" style="display: block; padding: 0 10px"> $retval = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'Start Date (YYYY-mm-dd)' => 'date',
</span><span class="cx" style="display: block; padding: 0 10px"> 'End Date (YYYY-mm-dd)' => 'date',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,15 +253,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function admin_print_scripts() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( get_post_type() == WCPT_POST_TYPE_ID ) :
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <script>
- jQuery(document).ready(function($) {
- $('.date-field').datepicker({
- dateFormat: 'yy-mm-dd',
- changeMonth: true,
- changeYear: true
- });
- });
- </script>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <script>
+ jQuery( document ).ready( function( $ ) {
+ $( '.date-field' ).datepicker( {
+ dateFormat: 'yy-mm-dd',
+ changeMonth: true,
+ changeYear: true
+ } );
+ } );
+ </script>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> endif;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,7 +280,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Add some general styling to the admin area
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function admin_head () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function admin_head() {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( !empty( $_GET['post_type'] ) && $_GET['post_type'] == WCPT_POST_TYPE_ID ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .column-title { width: 40%; }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +296,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo Everything
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function user_profile_update ( $user_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function user_profile_update( $user_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( !wcpt_has_access() )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,12 +309,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo Everything
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function user_profile_wordcamp ( $profileuser ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function user_profile_wordcamp( $profileuser ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !wcpt_has_access() )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <h3><?php _e( 'WordCamps', 'wcpt' ); ?></h3>
</span><span class="cx" style="display: block; padding: 0 10px"> <table class="form-table">
</span><span class="cx" style="display: block; padding: 0 10px"> <tr valign="top">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -322,7 +325,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </td>
</span><span class="cx" style="display: block; padding: 0 10px"> </tr>
</span><span class="cx" style="display: block; padding: 0 10px"> </table>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ <?php
</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">@@ -333,7 +337,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $columns
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array $columns
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function column_headers ( $columns ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function column_headers( $columns ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $columns = array (
</span><span class="cx" style="display: block; padding: 0 10px"> 'cb' => '<input type="checkbox" />',
</span><span class="cx" style="display: block; padding: 0 10px"> 'title' => __( 'Title', 'wcpt' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -354,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $column
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function column_data ( $column, $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function column_data( $column, $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $_GET['post_type'] !== WCPT_POST_TYPE_ID )
</span><span class="cx" style="display: block; padding: 0 10px"> return $column;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,7 +391,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'wcpt_organizer' :
</span><span class="cx" style="display: block; padding: 0 10px"> echo wcpt_get_wordcamp_organizer_name() ? wcpt_get_wordcamp_organizer_name() : __( 'No Organizer', 'wcpt' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'wcpt_venue' :
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -405,7 +408,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $post
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array $actions
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function post_row_actions ( $actions, $post ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function post_row_actions( $actions, $post ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( WCPT_POST_TYPE_ID == $post->post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $actions['inline hide-if-no-js'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -652,17 +655,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Functions for displaying specific meta boxes
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wcpt_wordcamp_metabox () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wcpt_wordcamp_metabox() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta_keys = $GLOBALS['wordcamp_admin']->meta_keys( 'wordcamp' );
</span><span class="cx" style="display: block; padding: 0 10px"> wcpt_metabox( $meta_keys );
</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">-function wcpt_organizer_metabox () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wcpt_organizer_metabox() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta_keys = $GLOBALS['wordcamp_admin']->meta_keys( 'organizer' );
</span><span class="cx" style="display: block; padding: 0 10px"> wcpt_metabox( $meta_keys );
</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">-function wcpt_venue_metabox () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wcpt_venue_metabox() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $meta_keys = $GLOBALS['wordcamp_admin']->meta_keys( 'venue' );
</span><span class="cx" style="display: block; padding: 0 10px"> wcpt_metabox( $meta_keys );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -676,13 +679,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @subpackage Template Tags
</span><span class="cx" style="display: block; padding: 0 10px"> * @since WordCamp Post Type (0.1)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wcpt_metabox ( $meta_keys ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wcpt_metabox( $meta_keys ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $meta_keys as $key => $value ) :
</span><span class="cx" style="display: block; padding: 0 10px"> $object_name = wcpt_key_to_str( $key, 'wcpt_' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-?>
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="inside">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( 'checkbox' == $value ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -692,51 +696,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php else : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php // todo indent the contents (and do other whitespace cleanup) in the next commit. avoid doing here because of diff noise. ?>
- <p>
- <strong><?php echo $key; ?></strong>
- </p>
- <p>
- <label class="screen-reader-text" for="<?php echo $object_name; ?>"><?php echo $key; ?></label>
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php switch ( $value ) {
- case 'text' : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p>
+ <strong><?php echo $key; ?></strong>
+ </p>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <input type="text" size="36" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" value="<?php echo esc_attr( get_post_meta( $post_id, $key, true ) ); ?>" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p>
+ <label class="screen-reader-text" for="<?php echo $object_name; ?>"><?php echo $key; ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php switch ( $value ) :
+ case 'text' : ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'date' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <input type="text" size="36" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" value="<?php echo esc_attr( get_post_meta( $post_id, $key, true ) ); ?>" />
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Quick filter on dates
- if ( $date = get_post_meta( $post_id, $key, true ) ) {
- $date = date( 'Y-m-d', $date );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php break;
+ case 'date' :
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Quick filter on dates
+ if ( $date = get_post_meta( $post_id, $key, true ) ) {
+ $date = date( 'Y-m-d', $date );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <input type="text" size="36" class="date-field" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" value="<?php echo $date; ?>" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <input type="text" size="36" class="date-field" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>" value="<?php echo $date; ?>" />
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'textarea' : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php break;
+ case 'textarea' : ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <textarea rows="4" cols="23" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>"><?php echo esc_attr( get_post_meta( $post_id, $key, true ) ); ?></textarea>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <textarea rows="4" cols="23" name="<?php echo $object_name; ?>" id="<?php echo $object_name; ?>"><?php echo esc_attr( get_post_meta( $post_id, $key, true ) ); ?></textarea>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php break;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- default:
- do_action( 'wcpt_metabox_value', $key, $value, $object_name );
- break;
- } ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ default:
+ do_action( 'wcpt_metabox_value', $key, $value, $object_name );
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ endswitch; ?>
+ </p>
+
+ <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php endif; ?>
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-
- endforeach;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php endforeach;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-?>
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>