<!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>[1724] sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2: WordPress.tv: Give credit to video producers.</title>
</head>
<body>

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

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordPress.tv: Give credit to video producers.

Fixes <a href="http://meta.trac.wordpress.org/ticket/986">#986</a>
Props BrashRebel</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2anonuploadtemplatephp">sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/anon-upload-template.php</a></li>
<li><a href="#sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2functionsphp">sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php</a></li>
<li><a href="#sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2pluginswordpresstvanonuploadanonuploadphp">sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php</a></li>
<li><a href="#sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2sidebarsinglephp">sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/sidebar-single.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2anonuploadtemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/anon-upload-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/anon-upload-template.php     2015-07-10 17:39:29 UTC (rev 1723)
+++ sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/anon-upload-template.php       2015-07-10 20:32:01 UTC (rev 1724)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -61,6 +61,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        .video-upload p {
</span><span class="cx" style="display: block; padding: 0 10px">                margin: 16px 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                overflow: auto;
</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">        .video-upload h3 {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,6 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        switch ( $message ) {
</span><span class="cx" style="display: block; padding: 0 10px">                case 1:
</span><span class="cx" style="display: block; padding: 0 10px">                        $message = 'Error: pleas select a video file.';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        // todo fix all the 'pleas' typos
</ins><span class="cx" style="display: block; padding: 0 10px">                         break;
</span><span class="cx" style="display: block; padding: 0 10px">                case 2:
</span><span class="cx" style="display: block; padding: 0 10px">                        $message = 'Error: invalid file type.';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,6 +204,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                case 13:
</span><span class="cx" style="display: block; padding: 0 10px">                        $message = "Error: please leave the first field empty. (It helps us know you're not a spammer.)";
</span><span class="cx" style="display: block; padding: 0 10px">                        break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                case 14:
+                       $message = "Error: please enter a valid WordPress.org username for the producer, or leave the field empty.";
+                       break;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px">        $message = '<div class="error"><p>' . $message . '</p></div>';
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( !empty($_REQUEST['success']) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,8 +307,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        </div>
</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="wptv_video_producer"><?php esc_html_e( 'Video producer' ); ?></label>
-               <input type="text" id="wptv_video_producer" name="wptv_video_producer" value="" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <label for="wptv_producer_username"><?php esc_html_e( 'Producer WordPress.org Username' ); ?></label>
+               <input type="text" id="wptv_producer_username" name="wptv_producer_username" value="" />
</ins><span class="cx" style="display: block; padding: 0 10px">         </p>
</span><span class="cx" style="display: block; padding: 0 10px">        <p>
</span><span class="cx" style="display: block; padding: 0 10px">                <label for="wptv_speakers"><?php esc_html_e( 'Speakers' ); ?></label>
</span></span></pre></div>
<a id="sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2functionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php        2015-07-10 17:39:29 UTC (rev 1723)
+++ sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php  2015-07-10 20:32:01 UTC (rev 1724)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,6 +78,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'rewrite'  => array( 'slug' => 'producer' ),
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                register_taxonomy( 'producer-username', array( 'post' ), array(
+                       'label'    => __( 'Producer Username', 'wptv' ),
+                       'template' => __( 'Producer: %l.', 'wptv' ),
+                       'helps'    => __( 'Separate producer usernames with commas.', 'wptv' ),
+                       'sort'     => true,
+                       'args'     => array( 'orderby' => 'term_order' ),
+                       'rewrite'  => array( 'slug' => 'producer-username' ),
+               ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 register_taxonomy( 'speakers', array( 'post' ), array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'label'    => __( 'Speakers', 'wptv' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'template' => __( 'Speakers: %l.', 'wptv' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -818,3 +827,27 @@
</span><span class="cx" style="display: block; padding: 0 10px">        return $excerpt;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'get_the_excerpt', 'wptv_excerpt_slides' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * Checks if the given username exists on WordPress.org
+ *
+ * grav-redirect.php will redirect to a Gravatar image URL. If the WordPress.org username exists, the `d` parameter
+ * will be 'retro', and if it doesn't it'll be 'mm'.
+ *
+ * @param string $username
+ *
+ * @return bool
+ */
+function wporg_username_exists( $username ) {
+       $username_exists = false;
+       $validator_url   = add_query_arg( 'user', $username, 'https://wordpress.org/grav-redirect.php' );
+       $response        = wp_remote_retrieve_headers( wp_remote_get( $validator_url, array( 'redirection' => 0 ) ) );
+
+       if ( array_key_exists( 'location', $response ) ) {
+               if ( false === strpos( $response['location'], 'd=mm' ) ) {
+                       $username_exists = true;
+               }
+       }
+
+       return $username_exists;
+}
</ins></span></pre></div>
<a id="sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2pluginswordpresstvanonuploadanonuploadphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php      2015-07-10 17:39:29 UTC (rev 1723)
+++ sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-anon-upload/anon-upload.php        2015-07-10 20:32:01 UTC (rev 1724)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,7 +47,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        function validate() {
</span><span class="cx" style="display: block; padding: 0 10px">                $text_fields = array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'wptv_video_title',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'wptv_video_producer',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'wptv_producer_username',
</ins><span class="cx" style="display: block; padding: 0 10px">                         'wptv_speakers',
</span><span class="cx" style="display: block; padding: 0 10px">                        'wptv_event',
</span><span class="cx" style="display: block; padding: 0 10px">                        'wptv_slides_url'
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,6 +62,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return $this->error( 13 );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                if ( ! empty( $_POST['wptv_producer_username'] ) && ! wporg_username_exists( $_POST['wptv_producer_username'] ) ) {
+                       return $this->error( 14 );
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( ! is_user_logged_in() ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( empty( $_POST['wptv_uploaded_by'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                return $this->error( 10 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,13 +263,14 @@
</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">                $video_title    = $this->sanitize_text( $_posted['wptv_video_title'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $video_producer = $this->sanitize_text( $_posted['wptv_video_producer'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $producer_username = $this->sanitize_text( $_posted['wptv_producer_username'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 $speakers       = $this->sanitize_text( $_posted['wptv_speakers'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $event          = $this->sanitize_text( $_posted['wptv_event'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $description    = $this->sanitize_text( $_posted['wptv_video_description'], false );
</span><span class="cx" style="display: block; padding: 0 10px">                $language       = $this->sanitize_text( $_posted['wptv_language'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $slides         = $this->sanitize_text( $_posted['wptv_slides_url'] );
</span><span class="cx" style="display: block; padding: 0 10px">                $ip             = $_SERVER['REMOTE_ADDR'];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // todo realign in separate commit
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $categories = '';
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! empty( $_posted['post_category'] ) && is_array( $_posted['post_category'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -282,7 +287,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'submitted_by'    => $anon_author,
</span><span class="cx" style="display: block; padding: 0 10px">                        'submitted_email' => $anon_author_email,
</span><span class="cx" style="display: block; padding: 0 10px">                        'title'           => $video_title,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'producer'        => $video_producer,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'producer_username' => $producer_username,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'speakers'        => $speakers,
</span><span class="cx" style="display: block; padding: 0 10px">                        'event'           => $event,
</span><span class="cx" style="display: block; padding: 0 10px">                        'language'        => $language,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -290,6 +295,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'description'     => $description,
</span><span class="cx" style="display: block; padding: 0 10px">                        'slides'          => $slides,
</span><span class="cx" style="display: block; padding: 0 10px">                        'ip'              => $ip,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        // todo realign in separate commit
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $post_meta['video_guid'] = $video_data->guid;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,9 +330,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $embed_args['blog_id'] = get_current_blog_id();
</span><span class="cx" style="display: block; padding: 0 10px">                $embed_args['post_id'] = $meta['attachment_id'];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // Add slides index to meta (necessary for posts that were uploaded before the field was added)
-               if ( ! array_key_exists( 'slides', $meta ) ) {
-                       $meta['slides'] = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // Add missing indexes to $meta (necessary for posts that were uploaded before the fields were added)
+               $new_fields = array( 'slides', 'producer_username' );
+               foreach ( $new_fields as $field ) {
+                       if ( ! array_key_exists( $field, $meta ) ) {
+                               $meta[ $field ] = '';
+                       }
</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">@@ -460,10 +469,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                        <div class="row">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                <p class="label">Producer:</p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                         <p class="label">Producer WordPress.org Username:</p>
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 <p class="data">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                                        <input type="text" value="<?php echo esc_attr( $meta['producer'] ); ?>"/>
-                                                       <a class="button-secondary anon-approve" href="#new-tag-producer">Approve</a>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                                 <input type="text" value="<?php echo esc_attr( $meta['producer_username'] ); ?>"/>
+                                                       <a class="button-secondary anon-approve" href="#new-tag-producer-username">Approve</a>
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 </p>
</span><span class="cx" style="display: block; padding: 0 10px">                                        </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordpresstvpublic_htmlwpcontentthemeswptv2sidebarsinglephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/sidebar-single.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/sidebar-single.php   2015-07-10 17:39:29 UTC (rev 1723)
+++ sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/sidebar-single.php     2015-07-10 20:32:01 UTC (rev 1724)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,5 +81,38 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                printf( '<a href="%s">Subtitle this video &rarr;</a>', esc_url( add_query_arg( 'video', $video->post_id, home_url( 'subtitle/' ) ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       /*
+                        * Credit video producer with link to their WordPress.org profile
+                        *
+                        * In most cases we'll either have the producer name, or the username, but not both.
+                        */
+                       $producer_name     = get_the_terms( get_the_ID(), 'producer' );
+                       $producer_username = get_the_terms( get_the_ID(), 'producer-username' );
</ins><span class="cx" style="display: block; padding: 0 10px">                         ?>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       <?php if ( $producer_name || $producer_username ) : ?>
+                               <h5>Producer</h5>
+
+                               <div class="video-producer">
+                                       <?php if ( $producer_username ) : ?>
+
+                                               <a href="<?php echo esc_url( 'https://profiles.wordpress.org/' . rawurlencode( $producer_username[0]->name ) ); ?>">
+                                                       <?php if ( $producer_name ) : ?>
+                                                               <?php echo esc_html( $producer_name[0]->name ); ?>
+                                                       <?php else : ?>
+                                                               <?php echo esc_html( $producer_username[0]->name ); ?>
+                                                       <?php endif; ?>
+                                               </a>
+
+                                       <?php else : ?>
+
+                                               <a href="<?php echo esc_url( get_term_link( $producer_name[0] ) ); ?>">
+                                                       <?php echo esc_html( $producer_name[0]->name ); ?>
+                                               </a>
+
+                                       <?php endif; ?>
+                               </div>
+                       <?php endif; ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> </div><!-- .secondary-content -->
</span></span></pre>
</div>
</div>

</body>
</html>