<!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>[8537] sites/trunk/wordcamp.org/public_html/wp-content: WordCamp: Applied coding standards for php</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/8537">8537</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/8537","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>vedjain</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-03-27 10:04:39 +0000 (Wed, 27 Mar 2019)</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: Applied coding standards for php</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksincludessessionsphp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/includes/sessions.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksincludessponsorsphp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/includes/sponsors.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksviewsharedfeaturedimagephp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/view/shared/featured-image.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksviewsharedgridlayoutphp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/view/shared/grid-layout.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypesincrestapiphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/inc/rest-api.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypeswcposttypesphp">sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksincludessessionsphp"></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/mu-plugins/blocks/includes/sessions.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/mu-plugins/blocks/includes/sessions.php 2019-03-27 00:15:38 UTC (rev 8536)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/includes/sessions.php 2019-03-27 10:04:39 UTC (rev 8537)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,15 +163,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'integer',
</span><span class="cx" style="display: block; padding: 0 10px"> 'minimum' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'maximum' => 4,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default' => 1
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'default' => 1,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'featured_image_height' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'integer',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default' => 150
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'default' => 150,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'featured_image_width' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'integer',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default' => 150
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'default' => 150,
</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></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksincludessponsorsphp"></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/mu-plugins/blocks/includes/sponsors.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/includes/sponsors.php 2019-03-27 00:15:38 UTC (rev 8536)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/includes/sponsors.php 2019-03-27 10:04:39 UTC (rev 8537)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Renders content of Sponsor block based on attributes.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param $attributes
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $attributes
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return false|string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,12 +54,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Return sponsor posts what will rendered based on attributes.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param $attributes
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $attributes
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_sponsor_posts( $attributes ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $attributes[ 'mode' ] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $attributes['mode'] ) ) {
</ins><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">
</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"> '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">- switch ( $attributes[ 'mode' ] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ( $attributes['mode'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'specific_posts':
</span><span class="cx" style="display: block; padding: 0 10px"> $post_args['post__in'] = $attributes['post_ids'];
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,12 +84,12 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch ( $attributes[ 'sort_by' ] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ( $attributes['sort_by'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'name_asc':
</span><span class="cx" style="display: block; padding: 0 10px"> $post_args['orderby'] = 'title';
</span><span class="cx" style="display: block; padding: 0 10px"> $post_args['order'] = 'asc';
</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 'name_desc' :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'name_desc':
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_args['orderby'] = 'title';
</span><span class="cx" style="display: block; padding: 0 10px"> $post_args['order'] = 'desc';
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts = get_posts( $post_args );
</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 ( 'sponsor_level' === $attributes[ 'sort_by' ] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'sponsor_level' === $attributes['sort_by'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> usort( $posts, sponsor_level_sort( $posts ) );
</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">@@ -110,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $posts Sponsor posts to sort.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return callable
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function sponsor_level_sort( $posts ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $sponsor_level_order = get_option( 'wcb_sponsor_level_order' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,60 +153,60 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function get_attributes_schema() {
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'mode' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'mode' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_ids' => array(
- 'type' => 'array',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_ids' => array(
+ 'type' => 'array',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'default' => array(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'items' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'items' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'integer',
</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">- 'term_ids' => array(
- 'type' => 'array',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'term_ids' => array(
+ 'type' => 'array',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'default' => array(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'items' => array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'items' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'integer',
</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">- 'sponsor_image_urls' => array(
- 'type' => 'string',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'sponsor_image_urls' => array(
+ 'type' => 'string',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'default' => '{}',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'show_name' => array(
- 'type' => 'bool',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'show_name' => array(
+ 'type' => 'bool',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'default' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'show_logo' => array(
- 'type' => 'bool',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'show_logo' => array(
+ 'type' => 'bool',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'default' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'show_desc' => array(
- 'type' => 'bool',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'show_desc' => array(
+ 'type' => 'bool',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'default' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'grid_columns' => array(
- 'type' => 'integer',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'grid_columns' => array(
+ 'type' => 'integer',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'minimum' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'maximum' => 4,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default' => 1
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'default' => 1,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'layout' => [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'layout' => array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'string',
</span><span class="cx" style="display: block; padding: 0 10px"> 'enum' => array( 'list', 'grid' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'default' => 'list',
</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"> 'featured_image_height' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'type' => 'integer',
- 'default' => 150
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'type' => 'integer',
+ 'default' => 150,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'featured_image_width' => array(
- 'type' => 'integer',
- 'default' => 150
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'featured_image_width' => array(
+ 'type' => 'integer',
+ 'default' => 150,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'sort_by' => array(
- 'type' => 'string',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'sort_by' => array(
+ 'type' => 'string',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'default' => 'name_asc',
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksviewsharedfeaturedimagephp"></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/mu-plugins/blocks/view/shared/featured-image.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/mu-plugins/blocks/view/shared/featured-image.php 2019-03-27 00:15:38 UTC (rev 8536)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/view/shared/featured-image.php 2019-03-27 10:04:39 UTC (rev 8537)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,9 +7,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $class_names Additional classes to add inside <img> tag.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param \WP_Post $post Current post object. This will be used to calculate srcset attribute.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $selected_image_url URL for selected sized image.
- * @param int $height Height of the image
- * @param int $width Width of the image
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $height Height of the image.
+ * @param int $width Width of the image.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Output markup for featured image.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksviewsharedgridlayoutphp"></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/mu-plugins/blocks/view/shared/grid-layout.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/mu-plugins/blocks/view/shared/grid-layout.php 2019-03-27 00:15:38 UTC (rev 8536)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/view/shared/grid-layout.php 2019-03-27 10:04:39 UTC (rev 8537)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,7 +31,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <ul class="<?php echo esc_attr( $container_classes ); ?>">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php foreach ( $children as $child ) { ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <li class="wordcamp-block-post-list-item wordcamp-grid-layout-item wordcamp-clearfix">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php echo $child ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php printf( wp_kses_post( $child ) ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php } ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypesincrestapiphp"></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/wc-post-types/inc/rest-api.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/wc-post-types/inc/rest-api.php 2019-03-27 00:15:38 UTC (rev 8536)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/inc/rest-api.php 2019-03-27 10:04:39 UTC (rev 8537)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,10 +159,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function get_avatar_urls_from_username_email( $post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = (object) $post;
</span><span class="cx" style="display: block; padding: 0 10px"> $avatar_urls = [];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $email = get_post_meta( $post->id, '_wcb_speaker_email', true );
+ $user_id = get_post_meta( $post->id, '_wcpt_user_id', 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">- if ( $email = get_post_meta( $post->id, '_wcb_speaker_email', true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $email ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $avatar_urls = rest_get_avatar_urls( $email );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $user_id = get_post_meta( $post->id, '_wcpt_user_id', true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( $user_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_by( 'id', $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $user ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,8 +189,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function register_fav_sessions_email() {
</span><span class="cx" style="display: block; padding: 0 10px"> register_rest_route(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'wc-post-types/v1', // REST namespace + API version
- '/email-fav-sessions/', // URL slug
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'wc-post-types/v1',
+ '/email-fav-sessions/',
</ins><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'methods' => WP_REST_Server::CREATABLE,
</span><span class="cx" style="display: block; padding: 0 10px"> 'callback' => 'send_favourite_sessions_email',
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentpluginswcposttypeswcposttypesphp"></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/wc-post-types/wc-post-types.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/wc-post-types/wc-post-types.php 2019-03-27 00:15:38 UTC (rev 8536)
+++ sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php 2019-03-27 10:04:39 UTC (rev 8537)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fired when plugin file is loaded.
</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 __construct() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function __construct() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->wcpt_permalinks = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'init', array( $this, 'register_post_types' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,7 +68,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'init', array( $this, 'rest_init' ), 9 );
</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 init() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Run and setup hooks for wc_post_types.
+ */
+ public function init() {
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'wcpt_back_compat_init' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_user_logged_in() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,8 +86,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'items' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'integer',
</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"> )
</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">@@ -93,7 +96,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Runs during admin_init.
</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_init() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function admin_init() {
</ins><span class="cx" style="display: block; padding: 0 10px"> add_action( 'pre_get_posts', array( $this, 'admin_pre_get_posts' ) );
</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">@@ -100,7 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Runs during init, because rest_api_init is too late.
</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 rest_init() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function rest_init() {
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once( 'inc/rest-api.php' );
</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">@@ -107,7 +110,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Runs during admin_menu
</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_menu() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function admin_menu() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $page = add_submenu_page( 'edit.php?post_type=wcb_sponsor', __( 'Order Sponsor Levels', 'wordcamporg' ), __( 'Order Sponsor Levels', 'wordcamporg' ), 'edit_posts', 'sponsor_levels', array( $this, 'render_order_sponsor_levels' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( "admin_print_scripts-$page", array( $this, 'enqueue_order_sponsor_levels_scripts' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,7 +119,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add custom image sizes
</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 add_image_sizes() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_image_sizes() {
</ins><span class="cx" style="display: block; padding: 0 10px"> add_image_size( 'wcb-sponsor-logo-horizontal-2x', 600, 220, false );
</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">@@ -123,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Enqueues scripts and styles for the render_order_sponsors_level admin page.
</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 enqueue_order_sponsor_levels_scripts() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function enqueue_order_sponsor_levels_scripts() {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'wcb-sponsor-order', plugins_url( '/js/order-sponsor-levels.js', __FILE__ ), array( 'jquery-ui-sortable' ), '20110212' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'wcb-sponsor-order', plugins_url( '/css/order-sponsor-levels.css', __FILE__ ), array(), '20110212' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -131,7 +134,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Renders the Order Sponsor Levels admin page.
</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 render_order_sponsor_levels() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function render_order_sponsor_levels() {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $_REQUEST['updated'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_REQUEST['updated'] = false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,17 +142,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $levels = $this->get_sponsor_levels();
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php screen_icon(); ?>
- <h1><?php _e( 'Order Sponsor Levels', 'wordcamporg' ); ?></h1>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <h1><?php esc_html_e( 'Order Sponsor Levels', 'wordcamporg' ); ?></h1>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( false !== $_REQUEST['updated'] ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="updated fade"><p><strong><?php _e( 'Options saved', 'wordcamporg' ); ?></strong></p></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="updated fade"><p><strong><?php esc_html_e( 'Options saved', 'wordcamporg' ); ?></strong></p></div>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <form method="post" action="options.php">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php settings_fields( 'wcb_sponsor_options' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="description sponsor-order-instructions">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php _e( 'Change the order of sponsor levels are displayed in the sponsors page template.', 'wordcamporg' ); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php esc_html_e( 'Change the order of sponsor levels are displayed in the sponsors page template.', 'wordcamporg' ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <ul class="sponsor-order">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php foreach ( $levels as $term ) : ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,7 +162,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="submit">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'wordcamporg' ); ?>" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Options', 'wordcamporg' ); ?>" />
</ins><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px"> </form>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,7 +172,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Runs when settings are updated for the sponsor level order page.
</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 validate_sponsor_options( $input ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function validate_sponsor_options( $input ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $input ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $input = null;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,7 +188,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Returns the sponsor level terms in set order.
</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 get_sponsor_levels() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_sponsor_levels() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $option = get_option( 'wcb_sponsor_level_order' );
</span><span class="cx" style="display: block; padding: 0 10px"> $term_objects = get_terms( 'wcb_sponsor_level', array( 'get' => 'all' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -215,7 +217,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Query $query
</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_pre_get_posts( $query ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function admin_pre_get_posts( $query ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_admin() || ! $query->is_main_query() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,7 +224,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $current_screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Order by session time
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Order by session time.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'edit-wcb_session' == $current_screen->id && $query->get( 'orderby' ) == '_wcpt_session_time' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $query->set( 'meta_key', '_wcpt_session_time' );
</span><span class="cx" style="display: block; padding: 0 10px"> $query->set( 'orderby', 'meta_value_num' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,10 +231,13 @@
</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">- function admin_enqueue_scripts() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Enqueues Scripts required for displaying settings.
+ */
+ public function admin_enqueue_scripts() {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post_type;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Register
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Register.
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_register_script(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb-spon', // Avoid "sponsor" since that's a trigger word for ad blockers.
</span><span class="cx" style="display: block; padding: 0 10px"> plugins_url( 'js/wcb-spon.js', __FILE__ ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,7 +258,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">- // Enqueues scripts and styles for session admin page
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Enqueues scripts and styles for session admin page.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'wcb_session' == $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'jquery-ui-datepicker' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'jquery-ui' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,19 +265,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'wp-datepicker-skins' );
</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">- // Enqueues scripts and styles for sponsors admin page
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Enqueues scripts and styles for sponsors admin page.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'wcb_sponsor' == $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'wcb-spon' );
</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">- /*
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Print our JavaScript
</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_print_scripts() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function admin_print_scripts() {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post_type;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // DatePicker for Session posts
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // DatePicker for Session posts.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'wcb_session' == $post_type ) :
</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">@@ -290,7 +295,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> endif;
</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 wp_enqueue_scripts() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Enqueue scripts.
+ */
+ public function wp_enqueue_scripts() {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'wcb_shortcodes', plugins_url( 'css/shortcodes.css', __FILE__ ), array(), 2 );
</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">@@ -301,7 +309,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses get_current_screen()
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses wp_enqueue_style()
</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_css() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function admin_css() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $screen->id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -320,20 +328,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The [speakers] shortcode handler.
</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 shortcode_speakers( $attr, $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function shortcode_speakers( $attr, $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Prepare the shortcode arguments
- $attr = shortcode_atts( array(
- 'show_avatars' => true,
- 'avatar_size' => 100,
- 'posts_per_page' => -1,
- 'orderby' => 'date',
- 'order' => 'desc',
- 'speaker_link' => '',
- 'track' => '',
- 'groups' => '',
- ), $attr );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Prepare the shortcode arguments.
+ $attr = shortcode_atts(
+ array(
+ 'show_avatars' => true,
+ 'avatar_size' => 100,
+ 'posts_per_page' => - 1,
+ 'orderby' => 'date',
+ 'order' => 'desc',
+ 'speaker_link' => '',
+ 'track' => '',
+ 'groups' => '',
+ ),
+ $attr
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'orderby', 'order', 'speaker_link' ) as $key_for_case_sensitive_value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $attr[ $key_for_case_sensitive_value ] = strtolower( $attr[ $key_for_case_sensitive_value ] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -346,7 +357,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attr['track'] = array_filter( explode( ',', $attr['track'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $attr['groups'] = array_filter( explode( ',', $attr['groups'] ) );
</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 all the relevant sessions
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Fetch all the relevant sessions.
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'wcb_session',
</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">@@ -364,14 +375,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sessions = get_posts( $session_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Parse the sessions
- $speaker_ids = $speakers_tracks = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Parse the sessions.
+ $speaker_ids = array();
+ $speakers_tracks = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sessions as $session ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Get the speaker IDs for all the sessions in the requested tracks
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Get the speaker IDs for all the sessions in the requested tracks.
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_speaker_ids = get_post_meta( $session->ID, '_wcpt_speaker_id' );
</span><span class="cx" style="display: block; padding: 0 10px"> $speaker_ids = array_merge( $speaker_ids, $session_speaker_ids );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Map speaker IDs to their corresponding tracks
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Map speaker IDs to their corresponding tracks.
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_terms = wp_get_object_terms( $session->ID, 'wcb_track' );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $session_speaker_ids as $speaker_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $speakers_tracks[ $speaker_id ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -382,13 +394,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Remove duplicate entries
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Remove duplicate entries.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_ids = array_unique( $speaker_ids );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $speakers_tracks as $speaker_id => $tracks ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $speakers_tracks[ $speaker_id ] = array_unique( $tracks );
</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 all specified speakers
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Fetch all specified speakers.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'wcb_speaker',
</span><span class="cx" style="display: block; padding: 0 10px"> 'posts_per_page' => intval( $attr['posts_per_page'] ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -416,7 +428,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Render the HTML for the shortcode
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Render the HTML for the shortcode.
</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">@@ -436,7 +448,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"> <!-- Organizers note: The id attribute is deprecated and only remains for backwards compatibility, please use the corresponding class to target individual speakers -->
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div id="wcorg-speaker-<?php echo sanitize_html_class( $post->post_name ); ?>" class="<?php echo implode( ' ', $speaker_classes ); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div id="wcorg-speaker-<?php echo sanitize_html_class( $post->post_name ); ?>" class="<?php echo( esc_attr( implode( ' ', $speaker_classes ) ) ); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px"> <h2>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( 'permalink' === $attr['speaker_link'] ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -470,15 +482,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The [organizers] shortcode callback.
</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 shortcode_organizers( $attr, $content ) {
- $attr = shortcode_atts( array(
- 'show_avatars' => true,
- 'avatar_size' => 100,
- 'posts_per_page' => -1,
- 'orderby' => 'date',
- 'order' => 'desc',
- 'teams' => '',
- ), $attr );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function shortcode_organizers( $attr, $content ) {
+ $attr = shortcode_atts(
+ array(
+ 'show_avatars' => true,
+ 'avatar_size' => 100,
+ 'posts_per_page' => - 1,
+ 'orderby' => 'date',
+ 'order' => 'desc',
+ 'teams' => '',
+ ),
+ $attr
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attr['show_avatars'] = $this->str_to_bool( $attr['show_avatars'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $attr['orderby'] = strtolower( $attr['orderby'] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -543,7 +558,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo maybe simplify $attr['custom']
</span><span class="cx" style="display: block; padding: 0 10px"> * @todo cleanup
</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 shortcode_schedule( $attr, $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function shortcode_schedule( $attr, $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->enqueue_schedule_shortcode_dependencies();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = preprocess_schedule_attributes( $attr );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,7 +591,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sessions as $time => $entry ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $skip_next = $colspan = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $skip_next = 0;
+ $colspan = 0;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $columns_html = '';
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $columns as $key => $term_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -599,7 +615,7 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Gather relevant data about the session
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Gather relevant data about the session.
</ins><span class="cx" style="display: block; padding: 0 10px"> $colspan = 1;
</span><span class="cx" style="display: block; padding: 0 10px"> $classes = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $session = get_post( $entry[ $term_id ] );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -625,7 +641,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">- // Add CSS classes to help with custom styles
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add CSS classes to help with custom styles.
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $speakers as $speaker ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'wcb-speaker-' . $speaker->post_name;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -650,13 +666,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content .= '<a class="fav-session-button"><span class="dashicons dashicons-star-filled"></span></a></div>';
</span><span class="cx" style="display: block; padding: 0 10px"> $content .= '<div class="wcb-session-cell-content">';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Determine the session title
- if ( 'permalink' == $attr['session_link'] && 'session' == $session_type )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Determine the session title.
+ if ( 'permalink' == $attr['session_link'] && 'session' == $session_type ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_title_html = sprintf( '<a class="wcpt-session-title" href="%s">%s</a>', esc_url( get_permalink( $session->ID ) ), $session_title );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- elseif ( 'anchor' == $attr['session_link'] && 'session' == $session_type )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( 'anchor' == $attr['session_link'] && 'session' == $session_type ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_title_html = sprintf( '<a class="wcpt-session-title" href="%s">%s</a>', esc_url( $this->get_wcpt_anchor_permalink( $session->ID ) ), $session_title );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- else
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_title_html = sprintf( '<span class="wcpt-session-title">%s</span>', $session_title );
</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"> $content .= $session_title_html;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,13 +682,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $speaker_name = apply_filters( 'the_title', $speaker->post_title );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'anchor' == $attr['speaker_link'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // speakers/#wcorg-speaker-slug
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // speakers/#wcorg-speaker-slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_permalink = $this->get_wcpt_anchor_permalink( $speaker->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'wporg' == $attr['speaker_link'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // profiles.wordpress.org/user
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // profiles.wordpress.org/user.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_permalink = $this->get_speaker_wporg_permalink( $speaker->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'permalink' == $attr['speaker_link'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // year.city.wordcamp.org/speakers/slug
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // year.city.wordcamp.org/speakers/slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_permalink = get_permalink( $speaker->ID );
</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">@@ -692,8 +709,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $columns_clone = $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">- // If the next element in the table is the same as the current one, use colspan
- if ( $key != key( array_slice( $columns, -1, 1, true ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If the next element in the table is the same as the current one, use colspan.
+ if ( key( array_slice( $columns, -1, 1, true ) ) != $key ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $columns_clone as $clonekey => $clonevalue ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $clonekey == $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -711,7 +728,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $columns_html .= sprintf( '<td colspan="%d" class="%s" data-track-title="%s" data-session-id="%s">%s</td>', $colspan, esc_attr( implode( ' ', $classes ) ), $session_track_titles, esc_attr( $session->ID ), $content );
</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">- $global_session = $colspan == count( $columns ) ? ' global-session' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $global_session = count( $columns ) == $colspan ? ' global-session' : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> $global_session_slug = $global_session ? ' ' . sanitize_html_class( sanitize_title_with_dashes( $session->post_title ) ) : '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $html .= sprintf( '<tr class="%s">', sanitize_html_class( 'wcpt-time-' . date( $time_format, $time ) ) . $global_session . $global_session_slug );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -729,7 +746,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Enqueue style and scripts needed for [schedule] shortcode.
</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 enqueue_schedule_shortcode_dependencies() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function enqueue_schedule_shortcode_dependencies() {
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'dashicons' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -764,7 +781,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string HTML code that represents the form to send emails and a link to show and hide it.
</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 fav_session_share_form() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function fav_session_share_form() {
</ins><span class="cx" style="display: block; padding: 0 10px"> static $share_form_count = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Skip share form if it was already added to document.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -838,24 +855,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Returns a speaker's WordPress.org profile url (if username set)
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param $speaker_id int The speaker's post id.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $speaker_id int The speaker's post id.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return NULL|string
</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 get_speaker_wporg_permalink( $speaker_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_speaker_wporg_permalink( $speaker_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $speaker_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $post->post_type != 'wcb_speaker' || $post->post_status != 'publish' ) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'wcb_speaker' != $post->post_type || 'publish' != $post->post_status ) {
+ return null;
</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"> $wporg_user_id = get_post_meta( $speaker_id, '_wcpt_user_id', true );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $wporg_user_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
</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"> $user = get_user_by( 'id', $wporg_user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
</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"> $permalink = sprintf( 'http://profiles.wordpress.org/%s', strtolower( $user->user_nicename ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -870,11 +887,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * If the current page contains the corresponding shortcode, we'll assume the user wants to link there.
</span><span class="cx" style="display: block; padding: 0 10px"> * Otherwise, we'll attempt to find another page that contains the shortcode.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param $target_id int The speaker/session's post ID.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param int $target_id The speaker/session's post ID.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</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 get_wcpt_anchor_permalink( $target_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_wcpt_anchor_permalink( $target_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px"> $anchor_target = get_post( $target_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -894,7 +911,8 @@
</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"> default:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $permalink = $anchor_id = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $permalink = false;
+ $anchor_id = false;
</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">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -920,7 +938,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return false | string
</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 get_wcpt_permalink( $type ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_wcpt_permalink( $type ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( $type, array( 'speakers', 'sessions', 'organizers' ) ) ) {
</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">@@ -952,11 +970,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Convert a string representation of a boolean to an actual boolean
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string|bool
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string|bool $value
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool
</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 str_to_bool( $value ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function str_to_bool( $value ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( true === $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -971,20 +989,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The [sessions] shortcode handler
</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 shortcode_sessions( $attr, $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function shortcode_sessions( $attr, $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $attr = shortcode_atts( array(
- 'date' => null,
- 'show_meta' => false,
- 'show_avatars' => false,
- 'avatar_size' => 100,
- 'track' => 'all',
- 'speaker_link' => 'wporg', // anchor|wporg|permalink|none
- 'posts_per_page' => -1,
- 'orderby' => 'date', // date|title|rand|session_time
- 'order' => 'desc', // asc|desc
- ), $attr );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $attr = shortcode_atts(
+ array(
+ 'date' => null,
+ 'show_meta' => false,
+ 'show_avatars' => false,
+ 'avatar_size' => 100,
+ 'track' => 'all',
+ 'speaker_link' => 'wporg', // anchor|wporg|permalink|none.
+ 'posts_per_page' => - 1,
+ 'orderby' => 'date', // date|title|rand|session_time.
+ 'order' => 'desc', // asc|desc.
+ ),
+ $attr
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Convert bools to real booleans.
</span><span class="cx" style="display: block; padding: 0 10px"> $bools = array( 'show_meta', 'show_avatars' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1000,7 +1021,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attr['avatar_size'] = absint( $attr['avatar_size'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( $attr['speaker_link'], array( 'anchor', 'wporg', 'permalink', 'none' ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $attr['speaker_link'] = 'anchor'; // todo this is inconsistent with the values passed to shortcode_atts, and probably not needed if the default above is changed to 'anchor'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $attr['speaker_link'] = 'anchor'; // todo this is inconsistent with the values passed to shortcode_atts, and probably not needed if the default above is changed to 'anchor'.
</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"> $attr['orderby'] = ( in_array( $attr['orderby'], array( 'date', 'title', 'rand', 'session_time' ) ) ) ? $attr['orderby'] : 'date';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1016,7 +1037,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => $attr['orderby'],
</span><span class="cx" style="display: block; padding: 0 10px"> 'order' => $attr['order'],
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Only ones marked "session" or where the meta key does
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Only ones marked "session" or where the meta key does.
</ins><span class="cx" style="display: block; padding: 0 10px"> // not exist, for backwards compatibility.
</span><span class="cx" style="display: block; padding: 0 10px"> 'meta_query' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'relation' => 'AND',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1113,13 +1134,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $speaker_name = apply_filters( 'the_title', $speaker->post_title );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'anchor' == $attr['speaker_link'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // speakers/#wcorg-speaker-slug
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // speakers/#wcorg-speaker-slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_permalink = $this->get_wcpt_anchor_permalink( $speaker->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'wporg' == $attr['speaker_link'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // profiles.wordpress.org/user
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // profiles.wordpress.org/user.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_permalink = $this->get_speaker_wporg_permalink( $speaker->ID );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'permalink' == $attr['speaker_link'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // year.city.wordcamp.org/speakers/slug
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // year.city.wordcamp.org/speakers/slug.
</ins><span class="cx" style="display: block; padding: 0 10px"> $speaker_permalink = get_permalink( $speaker->ID );
</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">@@ -1152,8 +1173,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">- // Gather data for list of links
- if ( $url = get_post_meta( $post->ID, '_wcpt_session_slides', true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Gather data for list of links.
+ $url = get_post_meta( $post->ID, '_wcpt_session_slides', true );
+ if ( $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $links['slides'] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'url' => $url,
</span><span class="cx" style="display: block; padding: 0 10px"> 'label' => __( 'Slides', 'wordcamporg' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1160,7 +1182,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $url = get_post_meta( $post->ID, '_wcpt_session_video', true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = get_post_meta( $post->ID, '_wcpt_session_video', true );
+ if ( $url ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $links['video'] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'url' => $url,
</span><span class="cx" style="display: block; padding: 0 10px"> 'label' => __( 'Video', 'wordcamporg' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1176,8 +1199,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wcorg-session-description">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php the_post_thumbnail(); ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php echo $session_meta; ?>
- <?php echo $speakers_avatars; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php echo wp_kses_post( $session_meta ); ?>
+ <?php echo wp_kses_post( $speakers_avatars ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php the_content(); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( $links ) : ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1208,15 +1231,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * The [sponsors] shortcode handler.
</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 shortcode_sponsors( $attr, $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function shortcode_sponsors( $attr, $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $attr = shortcode_atts( array(
- 'link' => 'none',
- 'title' => 'visible',
- 'content' => 'full',
- 'excerpt_length' => 55,
- ), $attr );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $attr = shortcode_atts(
+ array(
+ 'link' => 'none',
+ 'title' => 'visible',
+ 'content' => 'full',
+ 'excerpt_length' => 55,
+ ),
+ $attr
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $attr['link'] = strtolower( $attr['link'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $terms = $this->get_sponsor_levels();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1285,11 +1311,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( 'full' === $attr['content'] ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php the_content(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php elseif ( 'excerpt' === $attr['content'] ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php echo wpautop(
- wp_trim_words(
- get_the_content(),
- absint( $attr['excerpt_length'] ),
- apply_filters( 'excerpt_more', ' ' . '…' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php echo wp_kses_post(
+ wpautop(
+ wp_trim_words(
+ get_the_content(),
+ absint( $attr['excerpt_length'] ),
+ apply_filters( 'excerpt_more', ' …' )
+ )
</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"> <?php endif; ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1363,7 +1391,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</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 add_speaker_info_to_session_posts( $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_speaker_info_to_session_posts( $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px"> $enabled_site_ids = apply_filters( 'wcpt_session_post_speaker_info_enabled_site_ids', array( 364 ) ); // 2014.sf
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1399,9 +1427,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $speakers_html = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '<h2 class="session-speakers">%s</h2>',
</span><span class="cx" style="display: block; padding: 0 10px"> _n(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Speaker', 'wordcamporg' ),
- __( 'Speakers', 'wordcamporg' ),
- $speakers->post_count
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Speaker',
+ 'Speakers',
+ $speakers->post_count,
+ 'wordcamporg'
</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">@@ -1428,15 +1457,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</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 add_slides_info_to_session_posts( $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_slides_info_to_session_posts( $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $enabled_site_ids = apply_filters( 'wcpt_session_post_slides_info_enabled_site_ids', array(
- 206, // testing.wordcamp.org
- 648, // 2016.asheville
- 651, // 2016.kansascity
- 623, // 2016.tampa
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $enabled_site_ids = apply_filters(
+ 'wcpt_session_post_slides_info_enabled_site_ids',
+ array(
+ 206, // testing.wordcamp.org.
+ 648, // 2016.asheville.
+ 651, // 2016.kansascity.
+ 623, // 2016.tampa.
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_single_cpt_post( 'wcb_session' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $content;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1472,14 +1504,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</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 add_video_info_to_session_posts( $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_video_info_to_session_posts( $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $enabled_site_ids = apply_filters( 'wcpt_session_post_video_info_enabled_site_ids', array(
- 206, // testing.wordcamp.org
- 648, // 2016.asheville
- 623, // 2016.tampa
- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $enabled_site_ids = apply_filters(
+ 'wcpt_session_post_video_info_enabled_site_ids',
+ array(
+ 206, // testing.wordcamp.org .
+ 648, // 2016.asheville .
+ 623, // 2016.tampa .
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_single_cpt_post( 'wcb_session' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $content;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1511,7 +1546,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</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 add_session_categories_to_session_posts( $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_session_categories_to_session_posts( $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_single_cpt_post( 'wcb_session' ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1539,7 +1574,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 session_category_slugs_to_body_tag( $body_classes ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function session_category_slugs_to_body_tag( $body_classes ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'wcb_session' === get_post_type() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $session_categories = get_the_terms( get_post(), 'wcb_session_category' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1564,7 +1599,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</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 add_session_info_to_speaker_posts( $content ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_session_info_to_speaker_posts( $content ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px"> $enabled_site_ids = apply_filters( 'wcpt_speaker_post_session_info_enabled_site_ids', array( 364 ) ); // 2014.sf
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1595,9 +1630,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $sessions_html = sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '<h2 class="speaker-sessions">%s</h2>',
</span><span class="cx" style="display: block; padding: 0 10px"> _n(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- __( 'Session', 'wordcamporg' ),
- __( 'Sessions', 'wordcamporg' ),
- $sessions->post_count
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'Session',
+ 'Sessions',
+ $sessions->post_count,
+ 'wordcamporg'
</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">@@ -1616,7 +1652,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fired during add_meta_boxes, adds extra meta boxes to our custom post types.
</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 add_meta_boxes() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_meta_boxes() {
</ins><span class="cx" style="display: block; padding: 0 10px"> add_meta_box( 'speaker-info', __( 'Speaker Info', 'wordcamporg' ), array( $this, 'metabox_speaker_info' ), 'wcb_speaker', 'side' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_meta_box( 'organizer-info', __( 'Organizer Info', 'wordcamporg' ), array( $this, 'metabox_organizer_info' ), 'wcb_organizer', 'side' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_meta_box( 'speakers-list', __( 'Speakers', 'wordcamporg' ), array( $this, 'metabox_speakers_list' ), 'wcb_session', 'side' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1629,7 +1665,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by the Speakers post type
</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_speaker_info() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function metabox_speaker_info() {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px"> $email = get_post_meta( $post->ID, '_wcb_speaker_email', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1645,12 +1681,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_nonce_field( 'edit-speaker-info', 'wcpt-meta-speaker-info' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label for="wcpt-gravatar-email"><?php _e( 'Gravatar Email:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label for="wcpt-gravatar-email"><?php esc_html_e( 'Gravatar Email:', 'wordcamporg' ); ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px"> <input type="text" class="widefat" id="wcpt-gravatar-email" name="wcpt-gravatar-email" value="<?php echo esc_attr( $email ); ?>" />
</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"> <p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label for="wcpt-wporg-username"><?php _e( 'WordPress.org Username:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label for="wcpt-wporg-username"><?php esc_html_e( 'WordPress.org Username:', 'wordcamporg' ); ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px"> <input type="text" class="widefat" id="wcpt-wporg-username" name="wcpt-wporg-username" value="<?php echo esc_attr( $wporg_username ); ?>" />
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1660,7 +1696,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Rendered in the Organizer post type
</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_organizer_info() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function metabox_organizer_info() {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $wporg_username = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1675,7 +1711,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_nonce_field( 'edit-organizer-info', 'wcpt-meta-organizer-info' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label for="wcpt-wporg-username"><?php _e( 'WordPress.org Username:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label for="wcpt-wporg-username"><?php esc_html_e( 'WordPress.org Username:', 'wordcamporg' ); ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px"> <input type="text" class="widefat" id="wcpt-wporg-username" name="wcpt-wporg-username" value="<?php echo esc_attr( $wporg_username ); ?>" />
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1685,7 +1721,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Used by the Sessions post type, renders a text box for speakers input.
</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_speakers_list() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function metabox_speakers_list() {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $post;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $speakers = get_post_meta( $post->ID, '_wcb_session_speakers', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1716,7 +1752,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?></textarea>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="description">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php _e( 'A speaker entry must exist first. Separate multiple speakers with commas.', 'wordcamporg' ); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php esc_html_e( 'A speaker entry must exist first. Separate multiple speakers with commas.', 'wordcamporg' ); ?>
</ins><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"> <script>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1728,7 +1764,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> printf( "'%s', ", esc_js( $name ) );
</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">- printf( "'%s'", esc_js( $speakers_names_first ) ); // avoid the trailing comma
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ printf( "'%s'", esc_js( $speakers_names_first ) ); // avoid the trailing comma.
</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">@@ -1782,7 +1818,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</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 metabox_session_info() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Renders session info metabox.
+ */
+ public function metabox_session_info() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><span class="cx" style="display: block; padding: 0 10px"> $session_time = absint( get_post_meta( $post->ID, '_wcpt_session_time', true ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $session_date = ( $session_time ) ? date( 'Y-m-d', $session_time ) : date( 'Y-m-d' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1797,11 +1836,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_nonce_field( 'edit-session-info', 'wcpt-meta-session-info' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label for="wcpt-session-date"><?php _e( 'Date:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label for="wcpt-session-date"><?php esc_html_e( 'Date:', 'wordcamporg' ); ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px"> <input type="text" id="wcpt-session-date" data-date="<?php echo esc_attr( $session_date ); ?>" name="wcpt-session-date" value="<?php echo esc_attr( $session_date ); ?>" /><br />
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label><?php _e( 'Time:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label><?php esc_html_e( 'Time:', 'wordcamporg' ); ?></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">- <select name="wcpt-session-hour" aria-label="<?php _e( 'Session Start Hour', 'wordcamporg' ); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <select name="wcpt-session-hour" aria-label="<?php esc_html_e( 'Session Start Hour', 'wordcamporg' ); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php for ( $i = 1; $i <= 12; $i++ ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, $session_hours ); ?>>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php echo esc_html( $i ); ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1809,7 +1848,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endfor; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </select> :
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <select name="wcpt-session-minutes" aria-label="<?php _e( 'Session Start Minutes', 'wordcamporg' ); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <select name="wcpt-session-minutes" aria-label="<?php esc_html_e( 'Session Start Minutes', 'wordcamporg' ); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php for ( $i = '00'; (int) $i <= 55; $i = sprintf( '%02d', (int) $i + 5 ) ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, $session_minutes ); ?>>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php echo esc_html( $i ); ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1817,7 +1856,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endfor; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </select>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <select name="wcpt-session-meridiem" aria-label="<?php _e( 'Session Meridiem', 'wordcamporg' ); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <select name="wcpt-session-meridiem" aria-label="<?php esc_html_e( 'Session Meridiem', 'wordcamporg' ); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px"> <option value="am" <?php selected( 'am', $session_meridiem ); ?>>am</option>
</span><span class="cx" style="display: block; padding: 0 10px"> <option value="pm" <?php selected( 'pm', $session_meridiem ); ?>>pm</option>
</span><span class="cx" style="display: block; padding: 0 10px"> </select>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1824,20 +1863,20 @@
</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"> <p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label for="wcpt-session-type"><?php _e( 'Type:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label for="wcpt-session-type"><?php esc_html_e( 'Type:', 'wordcamporg' ); ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px"> <select id="wcpt-session-type" name="wcpt-session-type">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <option value="session" <?php selected( $session_type, 'session' ); ?>><?php _e( 'Regular Session', 'wordcamporg' ); ?></option>
- <option value="custom" <?php selected( $session_type, 'custom' ); ?>><?php _e( 'Break, Lunch, etc.', 'wordcamporg' ); ?></option>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <option value="session" <?php selected( $session_type, 'session' ); ?>><?php esc_html_e( 'Regular Session', 'wordcamporg' ); ?></option>
+ <option value="custom" <?php selected( $session_type, 'custom' ); ?>><?php esc_html_e( 'Break, Lunch, etc.', 'wordcamporg' ); ?></option>
</ins><span class="cx" style="display: block; padding: 0 10px"> </select>
</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"> <p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label for="wcpt-session-slides"><?php _e( 'Slides URL:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label for="wcpt-session-slides"><?php esc_html_e( 'Slides URL:', 'wordcamporg' ); ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px"> <input type="text" class="widefat" id="wcpt-session-slides" name="wcpt-session-slides" value="<?php echo esc_url( $session_slides ); ?>" />
</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"> <p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label for="wcpt-session-video"><?php _e( 'WordPress.TV URL:', 'wordcamporg' ); ?></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <label for="wcpt-session-video"><?php esc_html_e( 'WordPress.TV URL:', 'wordcamporg' ); ?></label>
</ins><span class="cx" style="display: block; padding: 0 10px"> <input type="text" class="widefat" id="wcpt-session-video" name="wcpt-session-video" value="<?php echo esc_url( $session_video ); ?>" />
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1849,7 +1888,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $sponsor
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function metabox_sponsor_info( $sponsor ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function metabox_sponsor_info( $sponsor ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $company_name = get_post_meta( $sponsor->ID, '_wcpt_sponsor_company_name', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $website = get_post_meta( $sponsor->ID, '_wcpt_sponsor_website', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $first_name = get_post_meta( $sponsor->ID, '_wcpt_sponsor_first_name', true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1892,7 +1931,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $sponsor
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function metabox_sponsor_agreement( $sponsor ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function metabox_sponsor_agreement( $sponsor ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $agreement_id = get_post_meta( $sponsor->ID, '_wcpt_sponsor_agreement', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $agreement_url = wp_get_attachment_url( $agreement_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1899,7 +1938,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $mes_id = get_post_meta( $sponsor->ID, '_mes_id', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $mes_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch_to_blog( BLOG_ID_CURRENT_SITE ); // central.wordcamp.org
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch_to_blog( BLOG_ID_CURRENT_SITE ); // central.wordcamp.org .
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mes_agreement_id = get_post_meta( $mes_id, 'mes_sponsor_agreement', true );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $mes_agreement_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1919,7 +1958,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Post $sponsor
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function metabox_invoice_sponsor( $sponsor ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function metabox_invoice_sponsor( $sponsor ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $current_screen = get_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $existing_invoices = get_posts( array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1949,8 +1988,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fired when a post is saved, makes sure additional metadata is also updated.
</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 save_post_speaker( $post_id, $post ) {
- if ( wp_is_post_revision( $post_id ) || $post->post_type != 'wcb_speaker' || ! current_user_can( 'edit_post', $post_id ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function save_post_speaker( $post_id, $post ) {
+ if ( wp_is_post_revision( $post_id ) || 'wcb_speaker' != $post->post_type || ! current_user_can( 'edit_post', $post_id ) ) {
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -1976,8 +2015,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * When an Organizer post is saved, update some meta data.
</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 save_post_organizer( $post_id, $post ) {
- if ( wp_is_post_revision( $post_id ) || $post->post_type != 'wcb_organizer' || ! current_user_can( 'edit_post', $post_id ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function save_post_organizer( $post_id, $post ) {
+ if ( wp_is_post_revision( $post_id ) || 'wcb_organizer' != $post->post_type || ! current_user_can( 'edit_post', $post_id ) ) {
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -1996,8 +2035,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fired when a post is saved, updates additional sessions metadada.
</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 save_post_session( $post_id, $post ) {
- if ( wp_is_post_revision( $post_id ) || $post->post_type != 'wcb_session' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function save_post_session( $post_id, $post ) {
+ if ( wp_is_post_revision( $post_id ) || 'wcb_session' != $post->post_type ) {
</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="lines" style="display: block; padding: 0 10px; color: #888">@@ -2009,7 +2048,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"> if ( isset( $_POST['wcpt-meta-session-info'] ) && wp_verify_nonce( $_POST['wcpt-meta-session-info'], 'edit-session-info' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Update session time
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update session time.
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_time = strtotime( sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> '%s %d:%02d %s',
</span><span class="cx" style="display: block; padding: 0 10px"> sanitize_text_field( $_POST['wcpt-session-date'] ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2019,7 +2058,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wcpt_session_time', $session_time );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Update session type
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update session type.
</ins><span class="cx" style="display: block; padding: 0 10px"> $session_type = sanitize_text_field( $_POST['wcpt-session-type'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( $session_type, array( 'session', 'custom' ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $session_type = 'session';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2027,16 +2066,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wcpt_session_type', $session_type );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Update session slides link
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update session slides link.
</ins><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wcpt_session_slides', esc_url_raw( $_POST['wcpt-session-slides'] ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Update session video link
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Update session video link.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'wordpress.tv' == str_replace( 'www.', '', strtolower( parse_url( $_POST['wcpt-session-video'], PHP_URL_HOST ) ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> update_post_meta( $post_id, '_wcpt_session_video', esc_url_raw( $_POST['wcpt-session-video'] ) );
</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">- // Allowed outside of $_POST. If anything updates a session, make sure
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Allowed outside of $_POST. If anything updates a session, make sure.
</ins><span class="cx" style="display: block; padding: 0 10px"> // we parse the list of speakers and add the references to speakers.
</span><span class="cx" style="display: block; padding: 0 10px"> $speakers_list = get_post_meta( $post_id, '_wcb_session_speakers', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $speakers_list = explode( ',', $speakers_list );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2075,14 +2114,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $post_id, '_wcpt_speaker_id', $speaker_id );
</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">- // Set the speaker as the author of the session post, so the single
- // view doesn't confuse users who see "posted by [organizer name]"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Set the speaker as the author of the session post, so the single.
+ // view doesn't confuse users who see "posted by [organizer name]".
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $speaker_ids as $speaker_post ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $wporg_user_id = get_post_meta( $speaker_post, '_wcpt_user_id', true );
</span><span class="cx" style="display: block; padding: 0 10px"> $user = get_user_by( 'id', $wporg_user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- remove_action( 'save_post', array( $this, 'save_post_session' ), 10 ); // avoid infinite recursion
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ remove_action( 'save_post', array( $this, 'save_post_session' ), 10 ); // avoid infinite recursion.
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_update_post( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'ID' => $post_id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_author' => $user->ID,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2097,15 +2136,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Save meta data for Sponsor posts
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function save_post_sponsor( $post_id, $post ) {
- if ( wp_is_post_revision( $post_id ) || $post->post_type != 'wcb_sponsor' || ! current_user_can( 'edit_post', $post_id ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function save_post_sponsor( $post_id, $post ) {
+ if ( wp_is_post_revision( $post_id ) || 'wcb_sponsor' != $post->post_type || ! current_user_can( 'edit_post', $post_id ) ) {
</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"> if ( wp_verify_nonce( filter_input( INPUT_POST, 'wcpt-meta-sponsor-info' ), 'edit-sponsor-info' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $text_values = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'company_name', 'first_name', 'last_name', 'email_address', 'phone_number', 'vat_number', 'twitter_handle',
- 'street_address1', 'street_address2', 'city', 'state', 'zip_code', 'country'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'company_name',
+ 'first_name',
+ 'last_name',
+ 'email_address',
+ 'phone_number',
+ 'vat_number',
+ 'twitter_handle',
+ 'street_address1',
+ 'street_address2',
+ 'city',
+ 'state',
+ 'zip_code',
+ 'country',
</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"> foreach ( $text_values as $id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2117,7 +2167,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"> $values['website'] = esc_url_raw( filter_input( INPUT_POST, '_wcpt_sponsor_website' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // TODO: maybe only allows links to home page, depending on outcome of http://make.wordpress.org/community/2013/12/31/irs-rules-for-corporate-sponsorship-of-wordcamp/
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // TODO: maybe only allows links to home page, depending on outcome of http://make.wordpress.org/community/2013/12/31/irs-rules-for-corporate-sponsorship-of-wordcamp/ .
</ins><span class="cx" style="display: block; padding: 0 10px"> $values['first_name'] = ucfirst( $values['first_name'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $values['last_name'] = ucfirst( $values['last_name'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $values['agreement'] = filter_input( INPUT_POST, '_wcpt_sponsor_agreement', FILTER_SANITIZE_NUMBER_INT );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2137,7 +2187,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Registers the custom post types, runs during init.
</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 register_post_types() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function register_post_types() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Speaker post type labels.
</span><span class="cx" style="display: block; padding: 0 10px"> $labels = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => __( 'Speakers', 'wordcamporg' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2160,7 +2210,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_speaker',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'labels' => $labels,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'rewrite' => array( 'slug' => 'speaker', 'with_front' => true, ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'rewrite' => array(
+ 'slug' => 'speaker',
+ 'with_front' => true,
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'revisions', 'comments', 'custom-fields' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_position' => 20,
</span><span class="cx" style="display: block; padding: 0 10px"> 'public' => true,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2197,7 +2250,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_session',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'labels' => $labels,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'rewrite' => array( 'slug' => 'session', 'with_front' => false, ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'rewrite' => array(
+ 'slug' => 'session',
+ 'with_front' => false,
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'revisions', 'thumbnail', 'custom-fields' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_position' => 21,
</span><span class="cx" style="display: block; padding: 0 10px"> 'public' => true,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2234,7 +2290,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_sponsor',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'labels' => $labels,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'rewrite' => array( 'slug' => 'sponsor', 'with_front' => false, ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'rewrite' => array(
+ 'slug' => 'sponsor',
+ 'with_front' => false,
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'supports' => array( 'title', 'editor', 'revisions', 'thumbnail', 'custom-fields' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_position' => 21,
</span><span class="cx" style="display: block; padding: 0 10px"> 'public' => true,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2271,11 +2330,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_organizer',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'labels' => $labels,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'rewrite' => array( 'slug' => 'organizer', 'with_front' => false, ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'rewrite' => array(
+ 'slug' => 'organizer',
+ 'with_front' => false,
+ ),
</ins><span class="cx" style="display: block; padding: 0 10px"> 'supports' => array( 'title', 'editor', 'excerpt', 'revisions' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'menu_position' => 22,
</span><span class="cx" style="display: block; padding: 0 10px"> 'public' => false,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // todo public or publicly_queryable = true, so consistent with others? at the very least set show_in_json = true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // todo public or publicly_queryable = true, so consistent with others? at the very least set show_in_json = true.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'show_ui' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'can_export' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'capability_type' => 'post',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2291,7 +2353,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Registers custom taxonomies to post types.
</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 register_taxonomies() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function register_taxonomies() {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Labels for tracks.
</span><span class="cx" style="display: block; padding: 0 10px"> $labels = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => __( 'Tracks', 'wordcamporg' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2363,7 +2425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'new_item_name' => __( 'New Sponsor Level', 'wordcamporg' ),
</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">- // Register sponsor level taxonomy
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Register sponsor level taxonomy.
</ins><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_sponsor_level',
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_sponsor',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2392,7 +2454,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'new_item_name' => __( 'New Team', 'wordcamporg' ),
</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">- // Register organizer teams taxonomy
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Register organizer teams taxonomy.
</ins><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_organizer_team',
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_organizer',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2421,7 +2483,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'new_item_name' => __( 'New Group', 'wordcamporg' ),
</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">- // Register speaker groups taxonomy
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Register speaker groups taxonomy.
</ins><span class="cx" style="display: block; padding: 0 10px"> register_taxonomy(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_speaker_group',
</span><span class="cx" style="display: block; padding: 0 10px"> 'wcb_speaker',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2446,7 +2508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @uses current_filter()
</span><span class="cx" style="display: block; padding: 0 10px"> * @see __construct()
</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 manage_post_types_columns( $columns ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function manage_post_types_columns( $columns ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $current_filter = current_filter();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $current_filter ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2486,7 +2548,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see manage_post_types_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 manage_post_types_columns_output( $column, $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function manage_post_types_columns_output( $column, $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> switch ( $column ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'wcb_organizer_avatar':
</span><span class="cx" style="display: block; padding: 0 10px"> edit_post_link( get_avatar( absint( get_post_meta( get_the_ID(), '_wcpt_user_id', true ) ), 32 ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2528,7 +2590,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $output[] = sprintf( '<a href="%s">%s</a>', esc_url( get_edit_post_link( $speaker->ID ) ), esc_html( apply_filters( 'the_title', $speaker->post_title ) ) );
</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">- echo implode( ', ', $output );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo( esc_html( implode( ', ', $output ) ) );
</ins><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><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2545,7 +2607,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Additional sortable columns for WP_Posts_List_Table
</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 manage_sortable_columns( $sortable ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function manage_sortable_columns( $sortable ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $current_filter = current_filter();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'manage_edit-wcb_session_sortable_columns' == $current_filter ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2558,7 +2620,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Display an additional post label if needed.
</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 display_post_states( $states ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function display_post_states( $states ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post = get_post();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'wcb_session' != $post->post_type ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2582,7 +2644,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Register some widgets.
</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 register_widgets() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function register_widgets() {
</ins><span class="cx" style="display: block; padding: 0 10px"> require_once( 'inc/widgets.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> register_widget( 'WCB_Widget_Sponsors' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2594,7 +2656,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Add post types to 'At a Glance' dashboard widget
</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 glance_items( $items = array() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function glance_items( $items = array() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_types = array( 'wcb_speaker', 'wcb_session', 'wcb_sponsor' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_types as $post_type ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2610,13 +2672,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $post_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'wcb_speaker':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $text = $text = _n( '%s Speaker', '%s Speakers', $num_posts->publish );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $text = _n( '%s Speaker', '%s Speakers', $num_posts->publish );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'wcb_session':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $text = $text = _n( '%s Session', '%s Sessions', $num_posts->publish );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $text = _n( '%s Session', '%s Sessions', $num_posts->publish );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'wcb_sponsor':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $text = $text = _n( '%s Sponsor', '%s Sponsors', $num_posts->publish );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $text = _n( '%s Sponsor', '%s Sponsors', $num_posts->publish );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2642,7 +2704,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function default_comment_ping_status( $status ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $screen = get_current_screen();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $screen->post_type ) && $screen->post_type == 'wcb_speaker' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $screen->post_type ) && 'wcb_speaker' == $screen->post_type ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $status = 'closed';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>