<!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>[7165] sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php: WordCamp Central: Apply coding standards.</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 { white-space: pre-line; 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/7165">7165</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/7165","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>2018-04-25 18:13:29 +0000 (Wed, 25 Apr 2018)</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 Central: Apply coding standards.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentthemeswordcampcentral2012functionsphp">sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentthemeswordcampcentral2012functionsphp"></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/themes/wordcamp-central-2012/functions.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/themes/wordcamp-central-2012/functions.php 2018-04-25 18:13:26 UTC (rev 7164)
+++ sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php 2018-04-25 18:13:29 UTC (rev 7165)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,7 +5,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * (Almost) everything in this file works around the base class called WordCamp_Central_Theme,
</span><span class="cx" style="display: block; padding: 0 10px"> * which is a static class, and should never have an instance (hence the trigger_error trick
</span><span class="cx" style="display: block; padding: 0 10px"> * in the class constructor.)
</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><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">@@ -51,7 +50,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> static function after_setup_theme() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_theme_support( 'post-formats', array( 'link', 'image' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $GLOBALS['custom_background'] = 'WordCamp_Central_Theme_Kill_Features';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $GLOBALS['custom_background'] = 'WordCamp_Central_Theme_Kill_Features';
</ins><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['custom_image_header'] = 'WordCamp_Central_Theme_Kill_Features';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add some new image sizes, also site shot is 205x148, minimap is 130x70
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,22 +71,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unregister_sidebar( 'secondary-widget-area' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_sidebar( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => __( 'Pages Widget Area', 'twentyten' ),
- 'id' => 'pages-widget-area',
- 'description' => __( 'Widgets displayed on pages.', 'twentyten' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => __( 'Pages Widget Area', 'twentyten' ),
+ 'id' => 'pages-widget-area',
+ 'description' => __( 'Widgets displayed on pages.', 'twentyten' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'after_widget' => '</li>',
- 'before_title' => '<h3 class="widget-title">',
- 'after_title' => '</h3>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
</ins><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px"> register_sidebar( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => __( 'Blog Widget Area', 'twentyten' ),
- 'id' => 'blog-widget-area',
- 'description' => __( 'Widgets displayed on the blog.', 'twentyten' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => __( 'Blog Widget Area', 'twentyten' ),
+ 'id' => 'blog-widget-area',
+ 'description' => __( 'Widgets displayed on the blog.', 'twentyten' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'after_widget' => '</li>',
- 'before_title' => '<h3 class="widget-title">',
- 'after_title' => '</h3>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'after_widget' => '</li>',
+ 'before_title' => '<h3 class="widget-title">',
+ 'after_title' => '</h3>',
</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">@@ -96,8 +95,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Removes pages and WordCamps from search results.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> static function pre_get_posts( $query ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $query->is_search && $query->is_main_query() && ! is_admin() )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $query->is_search && $query->is_main_query() && ! is_admin() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $query->set( 'post_type', 'post' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</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">@@ -108,8 +108,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> static function process_forms() {
</span><span class="cx" style="display: block; padding: 0 10px"> $available_actions = array( 'subscribe' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! isset( $_REQUEST['wccentral-form-action'] ) || ! in_array( $_REQUEST['wccentral-form-action'], $available_actions ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $_REQUEST['wccentral-form-action'] ) || ! in_array( $_REQUEST['wccentral-form-action'], $available_actions ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $action = $_REQUEST['wccentral-form-action'];
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $action ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,11 +117,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Subscribe to mailing list
</span><span class="cx" style="display: block; padding: 0 10px"> case 'subscribe':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! call_user_func( array( __CLASS__, 'can_subscribe' ) ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! call_user_func( array( __CLASS__, 'can_subscribe' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Jetpack will do the is_email check for us
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $email = $_REQUEST['wccentral-subscribe-email'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $email = $_REQUEST['wccentral-subscribe-email'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $subscribe = Jetpack_Subscriptions::subscribe( $email, 0, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The following part is taken from the Jetpack subscribe widget (subscriptions.php)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,11 +139,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"> if ( $error ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch( $error ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ( $error ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'invalid_email':
</span><span class="cx" style="display: block; padding: 0 10px"> $redirect = add_query_arg( 'subscribe', 'invalid_email' );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'active': case 'pending':
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'active':
+ case 'pending':
</ins><span class="cx" style="display: block; padding: 0 10px"> $redirect = add_query_arg( 'subscribe', 'already' );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,7 +172,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_localize_script( 'wordcamp-central', 'wordcampCentralOptions', self::get_javascript_options() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* We add some JavaScript to pages with the comment form
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * We add some JavaScript to pages with the comment form
</ins><span class="cx" style="display: block; padding: 0 10px"> * to support sites with threaded comments (when in use).
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_singular() && get_option( 'thread_comments' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -207,7 +211,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $options['markerIconHeight'] = 94;
</span><span class="cx" style="display: block; padding: 0 10px"> $options['markerIconWidth'] = 122;
</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 ( $map_markers = self::get_map_markers( $map_id ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $map_markers = self::get_map_markers( $map_id );
+
+ if ( $map_markers ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $options['mapMarkers'] = $map_markers;
</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">@@ -229,7 +235,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match_all( '/' . get_shortcode_regex() . '/s', $post_content, $shortcodes, PREG_SET_ORDER );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $shortcodes as $shortcode ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'wcc_map' == $shortcode[2] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'wcc_map' === $shortcode[2] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $attributes = shortcode_parse_atts( $shortcode[3] );
</span><span class="cx" style="display: block; padding: 0 10px"> $map_id = sanitize_text_field( $attributes['id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,14 +255,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected static function get_map_markers( $map_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $transient_key = "wcc_map_markers_$map_id";
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $markers = get_transient( $transient_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">- if ( $markers = get_transient( $transient_key ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $markers ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $markers;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $markers = array();
</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">- // Get the raw marker posts for the given map
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Get the raw marker posts for the given map.
</ins><span class="cx" style="display: block; padding: 0 10px"> $parameters = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'wordcamp',
</span><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => -1,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,7 +273,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch( $map_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ( $map_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'schedule':
</span><span class="cx" style="display: block; padding: 0 10px"> $parameters['meta_query'][] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'key' => 'Start Date (YYYY-mm-dd)',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -278,32 +285,34 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $raw_markers = get_posts( $parameters );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Convert the raw markers into prepared objects that are ready to be used on the JavaScript side
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Convert the raw markers into prepared objects that are ready to be used on the JavaScript side.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $raw_markers as $marker ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'schedule' == $map_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'schedule' === $map_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $marker_type = 'upcoming';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $marker_type = get_post_meta( $marker->ID, 'Start Date (YYYY-mm-dd)', true ) > strtotime( '-2 days' ) ? 'upcoming' : 'past';
</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">- if ( ! $coordinates = get_post_meta( $marker->ID, '_venue_coordinates', true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $coordinates = get_post_meta( $marker->ID, '_venue_coordinates', true );
+
+ if ( ! $coordinates ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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"> $markers[ $marker->ID ] = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'id' => $marker->ID,
- 'name' => wcpt_get_wordcamp_title( $marker->ID ),
- 'dates' => wcpt_get_wordcamp_start_date( $marker->ID ),
- 'location' => get_post_meta( $marker->ID, 'Location', true ),
- 'venueName' => get_post_meta( $marker->ID, 'Venue Name', true ),
- 'url' => self::get_best_wordcamp_url( $marker->ID ),
- 'latitude' => $coordinates['latitude'],
- 'longitude' => $coordinates['longitude'],
- 'iconURL' => "icon-marker-{$marker_type}-2x.png",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'id' => $marker->ID,
+ 'name' => wcpt_get_wordcamp_title( $marker->ID ),
+ 'dates' => wcpt_get_wordcamp_start_date( $marker->ID ),
+ 'location' => get_post_meta( $marker->ID, 'Location', true ),
+ 'venueName' => get_post_meta( $marker->ID, 'Venue Name', true ),
+ 'url' => self::get_best_wordcamp_url( $marker->ID ),
+ 'latitude' => $coordinates['latitude'],
+ 'longitude' => $coordinates['longitude'],
+ 'iconURL' => "icon-marker-{$marker_type}-2x.png",
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $markers = apply_filters( 'wcc_get_map_markers', $markers );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $markers = apply_filters( 'wcc_get_map_markers', $markers );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cache_expiration = 'about' === $map_id ? WEEK_IN_SECONDS : DAY_IN_SECONDS;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_transient( $transient_key, $markers, $cache_expiration );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,29 +323,41 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters excerpt_more.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static function excerpt_more( $more ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function excerpt_more( $more ) {
</ins><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><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters nav_menu_css_class.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * Make sure Schedule is current-menu-item when viewing WordCamps.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- static function nav_menu_css_class( $classes, $item, $args ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function nav_menu_css_class( $classes, $item, $args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'wordcamp' == get_post_type() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( home_url( '/schedule/' ) == trailingslashit( $item->url ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'current-menu-item';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $remove = array( 'current-menu-item', 'current_page_parent', 'current_page_ancestor' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $remove as $class )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ foreach ( $remove as $class ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $classes = array_splice( $classes, array_search( $class, $classes ), 1 );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><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">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $classes;
</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">+ /**
+ * Add links to the footer menu.
+ *
+ * @param string $items HTML markup of all <li> elements.
+ * @param array $args The arguments that were passed to `wp_nav_menu()`.
+ *
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public static function add_links_to_footer_menu( $items, $args ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'menu-footer' == $args->container_class ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'menu-footer' === $args->container_class ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</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">@@ -348,6 +369,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $items .= ob_get_clean();
</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">@@ -355,7 +377,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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Get Session List
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Get Session List.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Uses the WordCamp post type to loop through the latest
</span><span class="cx" style="display: block; padding: 0 10px"> * WordCamps, if WordCamp URLs are valid network blogs, switches
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -362,54 +384,62 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * to blog and queries for Session.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses switch_to_blog, get_blog_details, wp_object_cache
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return assoc array with session and WC info
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return assoc array with session and WC info.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get_sessions( $count = 4 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! function_exists( 'wcpt_has_wordcamps' ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! function_exists( 'wcpt_has_wordcamps' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><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">- // Check cache
- if ( (bool) $sessions = wp_cache_get( 'wccentral_sessions_' . $count ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Check cache.
+ $sessions = (bool) wp_cache_get( 'wccentral_sessions_' . $count );
+ if ( $sessions ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $sessions;
</span><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">- // Take latest WordCamps
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Take latest WordCamps.
</ins><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => $count + 10,
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_key' => 'Start Date (YYYY-mm-dd)',
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'meta_value',
</span><span class="cx" style="display: block; padding: 0 10px"> 'order' => 'ASC',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'meta_query' => array( array(
- 'key' => 'Start Date (YYYY-mm-dd)',
- 'value' => strtotime( '-2 days' ),
- 'compare' => '>'
- ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ 'meta_query' => array(
+ array(
+ 'key' => 'Start Date (YYYY-mm-dd)',
+ 'value' => strtotime( '-2 days' ),
+ 'compare' => '>',
+ ),
+ ),
</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">- if ( ! wcpt_has_wordcamps( $args ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! wcpt_has_wordcamps( $args ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><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">- // We'll hold the sessions here
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // We'll hold the sessions here.
</ins><span class="cx" style="display: block; padding: 0 10px"> $sessions = 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">- // Loop through the latest WCs
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Loop through the latest WCs.
</ins><span class="cx" style="display: block; padding: 0 10px"> while ( wcpt_wordcamps() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wcpt_the_wordcamp();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Store WC data (will be unavailable after switch_to_blog)
- $domain = parse_url( wcpt_get_wordcamp_url(), PHP_URL_HOST );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Store WC data (will be unavailable after switch_to_blog).
+ $domain = wp_parse_url( wcpt_get_wordcamp_url(), PHP_URL_HOST );
</ins><span class="cx" style="display: block; padding: 0 10px"> $blog_details = get_blog_details( array( 'domain' => $domain ), 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">- $wordcamp_date = wcpt_get_wordcamp_start_date( 0, 'F ' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wordcamp_date = wcpt_get_wordcamp_start_date( 0, 'F ' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $wordcamp_date .= wcpt_get_wordcamp_start_date( 0, 'j' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( wcpt_get_wordcamp_end_date( 0, 'j' ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( wcpt_get_wordcamp_end_date( 0, 'j' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $wordcamp_date .= '-' . wcpt_get_wordcamp_end_date( 0, 'j' );
</span><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">- // Valid for all sessions in this WC
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Valid for all sessions in this WC.
</ins><span class="cx" style="display: block; padding: 0 10px"> $session = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'wordcamp_title' => wcpt_get_wordcamp_title(),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'wordcamp_title' => wcpt_get_wordcamp_title(),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'wordcamp_permalink' => wcpt_get_wordcamp_permalink(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'wordcamp_date' => $wordcamp_date,
- 'wordcamp_thumb' => get_the_post_thumbnail( get_the_ID(), 'wccentral-thumbnail-small' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'wordcamp_date' => $wordcamp_date,
+ 'wordcamp_thumb' => get_the_post_thumbnail( get_the_ID(), 'wccentral-thumbnail-small' ),
</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"> if ( isset( $blog_details->blog_id ) && $blog_details->blog_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -417,34 +447,38 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( $my_blog_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">- // Look through 5 sessions, store in $sessions array
- $sessions_query = new WP_Query( array( 'post_type' => 'wcb_session', 'posts_per_page' => 5, 'post_status' => 'publish' ) );
- while ( $sessions_query->have_posts() ) {
- $sessions_query->the_post();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Look through 5 sessions, store in $sessions array.
+ $sessions_query = new WP_Query( array(
+ 'post_type' => 'wcb_session',
+ 'posts_per_page' => 5,
+ 'post_status' => 'publish',
+ ) );
+ while ( $sessions_query->have_posts() ) {
+ $sessions_query->the_post();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Add the extra fields to $session and push to $sessions
- $sessions[] = array_merge( $session, array(
- 'name' => apply_filters( 'the_title', get_the_title() ),
- 'speakers' => get_post_meta( get_the_ID(), '_wcb_session_speakers', true ),
- 'permalink' => get_permalink( get_the_ID() ),
- ) );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add the extra fields to $session and push to $sessions.
+ $sessions[] = array_merge( $session, array(
+ 'name' => apply_filters( 'the_title', get_the_title() ),
+ 'speakers' => get_post_meta( get_the_ID(), '_wcb_session_speakers', true ),
+ 'permalink' => get_permalink( get_the_ID() ),
+ ) );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><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"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Randomize and pick $count
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Randomize and pick $count.
</ins><span class="cx" style="display: block; padding: 0 10px"> shuffle( $sessions );
</span><span class="cx" style="display: block; padding: 0 10px"> $sessions = array_slice( $sessions, 0, $count );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Cache in transients
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Cache in transients.
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( 'wccentral_sessions_' . $count, $sessions );
</span><span class="cx" style="display: block; padding: 0 10px"> return $sessions;
</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">- * Retrieve Subscription Status from $_REQUEST
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Retrieve Subscription Status from $_REQUEST.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get_subscription_status() {
</span><span class="cx" style="display: block; padding: 0 10px"> return isset( $_REQUEST['subscribe'] ) ? strtolower( $_REQUEST['subscribe'] ) : false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,8 +485,9 @@
</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">- * Subscription Check
- * Returns true if subscriptions are available
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Subscription Check.
+ *
+ * Returns true if subscriptions are available.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function can_subscribe() {
</span><span class="cx" style="display: block; padding: 0 10px"> return class_exists( 'Jetpack_Subscriptions' ) && is_callable( array( 'Jetpack_Subscriptions', 'subscribe' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -459,7 +494,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"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Fetch the latest tweets from the @WordCamp account
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Fetch the latest tweets from the @WordCamp account.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This is an AJAX callback returning JSON-formatted data.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,7 +556,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected static function sanitize_format_tweets( $tweets ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $whitelisted_fields = array( 'id_str' => '', 'text' => '', 'created_at' => '' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $whitelisted_fields = array(
+ 'id_str' => '',
+ 'text' => '',
+ 'created_at' => '',
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $tweets as & $tweet ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tweet = (object) shortcode_atts( $whitelisted_fields, $tweet );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -552,71 +591,99 @@
</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">- * Twenty Ten Comment
- * Overrides the twentyten_comment function in the parent theme.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Override `twentyten_comment()` in the parent theme.
+ *
+ * @param WP_Comment $comment
+ * @param array $args
+ * @param int $depth
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function twentyten_comment( $comment, $args, $depth ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['comment'] = $comment;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> switch ( $comment->comment_type ) :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case '' :
- ?>
- <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
- <div id="comment-<?php comment_ID(); ?>" class="comment-container">
- <div class="comment-author vcard">
- <?php echo get_avatar( $comment, 60 ); ?>
- <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
- </div><!-- .comment-author .vcard -->
- <?php if ( $comment->comment_approved == '0' ) : ?>
- <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
- <br />
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case '': ?>
+ <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
+ <div id="comment-<?php comment_ID(); ?>" class="comment-container">
+ <div class="comment-author vcard">
+ <?php echo get_avatar( $comment, 60 ); ?>
+ <?php printf(
+ __( '%s <span class="says">says:</span>', 'twentyten' ),
+ sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() )
+ ); ?>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
- <?php
- /* translators: 1: date, 2: time */
- printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
- ?>
- </div><!-- .comment-meta .commentmetadata -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( '0' == $comment->comment_approved ) : ?>
+ <em class="comment-awaiting-moderation">
+ <?php esc_html_e( 'Your comment is awaiting moderation.', 'twentyten' ); ?>
+ </em>
+ <br />
+ <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="comment-body"><?php comment_text(); ?></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
+ <?php
+ /* translators: 1: date, 2: time */
+ printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
+ ?>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="reply">
- <?php comment_reply_link( array_merge( $args,
- array(
- 'depth' => $depth,
- 'max_depth' => $args['max_depth'],
- 'reply_text' => '➥ Reply'
- )
- ) ); ?>
- </div><!-- .reply -->
- </div><!-- #comment-## -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="comment-body">
+ <?php comment_text(); ?>
+ </div>
</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
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="reply">
+ <?php comment_reply_link( array_merge( $args,
+ array(
+ 'depth' => $depth,
+ 'max_depth' => $args['max_depth'],
+ 'reply_text' => '➥ Reply',
+ )
+ ) ); ?>
+ </div>
+ </div> <!-- #comment-## -->
+
+ <?php
</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">- case 'pingback' :
- case 'trackback' :
- ?>
- <li class="post pingback">
- <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ case 'pingback':
+ case 'trackback': ?>
+ <li class="post pingback">
+ <p>
+ <?php esc_html_e( 'Pingback:', 'twentyten' ); ?>
+ <?php comment_author_link(); ?>
+ <?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?>
+ </p>
+ <?php
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> endswitch;
</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">+ /**
+ * Run the query to get upcoming WordCamps.
+ *
+ * @param int $count
+ *
+ * @return WP_Query
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public static function get_upcoming_wordcamps_query( $count = 10 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $query = new WP_Query( array(
- 'post_type' => WCPT_POST_TYPE_ID,
- 'post_status' => WordCamp_Loader::get_public_post_statuses(),
- 'posts_per_page' => $count,
- 'meta_key' => 'Start Date (YYYY-mm-dd)',
- 'orderby' => 'meta_value',
- 'order' => 'ASC',
- 'meta_query' => array( array(
- 'key' => 'Start Date (YYYY-mm-dd)',
- 'value' => strtotime( '-2 days' ),
- 'compare' => '>'
- ) )
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $query = new WP_Query(
+ array(
+ 'post_type' => WCPT_POST_TYPE_ID,
+ 'post_status' => WordCamp_Loader::get_public_post_statuses(),
+ 'posts_per_page' => $count,
+ 'meta_key' => 'Start Date (YYYY-mm-dd)',
+ 'orderby' => 'meta_value',
+ 'order' => 'ASC',
+
+ 'meta_query' => array(
+ array(
+ 'key' => 'Start Date (YYYY-mm-dd)',
+ 'value' => strtotime( '-2 days' ),
+ 'compare' => '>',
+ ),
+ ),
+ )
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $query;
</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">@@ -627,10 +694,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $show_year Optional. True to include the year in the date output.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function the_wordcamp_date( $wordcamp_id = 0, $show_year = false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $start_day = wcpt_get_wordcamp_start_date( $wordcamp_id, 'j' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $start_day = wcpt_get_wordcamp_start_date( $wordcamp_id, 'j' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $start_month = wcpt_get_wordcamp_start_date( $wordcamp_id, 'F' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $end_day = wcpt_get_wordcamp_end_date( $wordcamp_id, 'j' );
- $end_month = wcpt_get_wordcamp_end_date( $wordcamp_id, 'F' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $end_day = wcpt_get_wordcamp_end_date( $wordcamp_id, 'j' );
+ $end_month = wcpt_get_wordcamp_end_date( $wordcamp_id, 'F' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $show_year ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $start_year = wcpt_get_wordcamp_start_date( $wordcamp_id, 'Y' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -721,11 +788,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function shortcode_about_stats( $attributes ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Allow stat values to be overridden with shortcode attributes
- $map_stats = shortcode_atts( self::get_map_stats(), $attributes, 'wcc_about_stats' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Allow stat values to be overridden with shortcode attributes.
+ $map_stats = shortcode_atts( self::get_map_stats(), $attributes, 'wcc_about_stats' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Sanitize stat values
- $map_stats = array_map( 'absint', $map_stats );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Sanitize stat values.
+ $map_stats = array_map( 'absint', $map_stats );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ob_start();
</span><span class="cx" style="display: block; padding: 0 10px"> require( __DIR__ . '/shortcode-about-stats.php' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -742,8 +809,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected static function get_map_stats() {
</span><span class="cx" style="display: block; padding: 0 10px"> $transient_key = 'wcc_about_map_stats';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $map_stats = get_transient( $transient_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">- if ( ! $map_stats = get_transient( $transient_key ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $map_stats ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $cities = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $wordcamps = new WP_Query( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'wordcamp',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -751,20 +819,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => -1,
</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">- // Count the number of cities
- // @todo use _venue_city field since it'll be more accurate, but need to populate older camps first
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Count the number of cities.
+ // @todo use _venue_city field since it'll be more accurate, but need to populate older camps first.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $wordcamps->posts as $wordcamp ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = get_post_meta( $wordcamp->ID, 'URL', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = get_post_meta( $wordcamp->ID, 'URL', true );
+ $hostname = wp_parse_url( $url, PHP_URL_HOST );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $hostname = parse_url( $url, PHP_URL_HOST ) ) {
- $city = explode( '.', $hostname );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $hostname ) {
+ $city = explode( '.', $hostname );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cities[ $city[0] ] = true;
</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">- // @todo generate countries automatically from _venue_country_code field, but need to populate older camps first
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // @todo generate countries automatically from _venue_country_code field, but need to populate older camps first.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Compile the results
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Compile the results.
</ins><span class="cx" style="display: block; padding: 0 10px"> $map_stats = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wordcamps' => $wordcamps->found_posts,
</span><span class="cx" style="display: block; padding: 0 10px"> 'cities' => count( $cities ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,27 +869,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> private static function _get_tshirt_sizes( $wordcamp_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $wordcamp = get_post( $wordcamp_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sizes = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sizes = array();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wordcamp_site_id = absint( get_wordcamp_site_id( $wordcamp ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $wordcamp_site_id )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $wordcamp_site_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $sizes;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_suspend_cache_addition( true );
</span><span class="cx" style="display: block; padding: 0 10px"> switch_to_blog( $wordcamp_site_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $questions = get_posts( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_type' => 'tix_question',
- 'post_status' => 'publish',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_type' => 'tix_question',
+ 'post_status' => 'publish',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => 100,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'fields' => 'ids',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'fields' => 'ids',
</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"> // Aggregate only t-shirt questions.
</span><span class="cx" style="display: block; padding: 0 10px"> $tshirt_questions = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $questions as $question_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( get_post_meta( $question_id, 'tix_type', true ) != 'tshirt' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( get_post_meta( $question_id, 'tix_type', true ) !== 'tshirt' ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tshirt_questions[] = $question_id;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -827,20 +898,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $paged = 1;
</span><span class="cx" style="display: block; padding: 0 10px"> while ( $attendees = get_posts( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_type' => 'tix_attendee',
- 'post_status' => array( 'publish', 'pending' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_type' => 'tix_attendee',
+ 'post_status' => array( 'publish', 'pending' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => 200,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'paged' => $paged++,
- 'orderby' => 'ID',
- 'order' => 'ASC',
- 'fields' => 'ids',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'paged' => $paged++,
+ 'orderby' => 'ID',
+ 'order' => 'ASC',
+ 'fields' => 'ids',
</ins><span class="cx" style="display: block; padding: 0 10px"> ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $attendees as $attendee_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $answers = get_post_meta( $attendee_id, 'tix_questions', true );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $answers as $question_id => $answer ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( in_array( $question_id, $tshirt_questions ) ) {
- if ( ! isset( $sizes[ $answer ] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( in_array( $question_id, $tshirt_questions, true ) ) {
+ if ( ! isset( $sizes[ $answer ] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sizes[ $answer ] = 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sizes[ $answer ]++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -858,10 +930,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Load the theme class, this is where it all starts.
</span><span class="cx" style="display: block; padding: 0 10px"> WordCamp_Central_Theme::on_load();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// Override the parent's comment function with ours.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Override the parent's comment function with ours.
+ *
+ * @param WP_Comment $comment
+ * @param array $args
+ * @param int $depth
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> function twentyten_comment( $comment, $args, $depth ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return WordCamp_Central_Theme::twentyten_comment( $comment, $args, $depth );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ WordCamp_Central_Theme::twentyten_comment( $comment, $args, $depth );
</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">-// This class is used to kill header images and custom background added by 2010.
-class WordCamp_Central_Theme_Kill_Features { function init() { return false; } }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Class WordCamp_Central_Theme_Kill_Features
+ *
+ * This class is used to kill header images and custom background added by 2010.
+ */
+class WordCamp_Central_Theme_Kill_Features {
+ /**
+ * Disable theme features.
+ *
+ * @return bool
+ */
+ public function init() {
+ return false;
+ }
+}
</ins></span></pre>
</div>
</div>
</body>
</html>