<!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>[868] sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer: Code Reference: rename 'Examples' to 'User Contributed Notes' in an appropriate fashion wherever present</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/868">868</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/868","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>coffee2code</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-09-23 18:30:18 +0000 (Tue, 23 Sep 2014)</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'>Code Reference: rename 'Examples' to 'User Contributed Notes' in an appropriate fashion wherever present</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercommentsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentreferencephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentwpparserhookphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperinctemplatetagsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperincusercontentphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsusernotesjs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjscodeexamplejs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/code-example.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercommentsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php 2014-09-23 18:25:23 UTC (rev 867)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * define wporg_developer_comment() and that will be used instead.
</span><span class="cx" style="display: block; padding: 0 10px"> * See wporg_developer_comment() in inc/template-tags.php for more.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_list_comments( array( 'callback' => 'wporg_developer_example' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_list_comments( array( 'callback' => 'wporg_developer_user_note' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </ol><!-- .comment-list -->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -53,19 +53,23 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; // have_comments() ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( DevHub\can_user_post_example( false, get_the_ID() ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( DevHub\can_user_post_note( false, get_the_ID() ) ) : ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p id="add-example" style="display:none;"><a href=""><?php _e( 'Have an example to add?', 'wporg' ); ?></a></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p id="add-user-note" style="display:none;"><a href=""><?php _e( 'Have a note to contribute?', 'wporg' ); ?></a></p>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php comment_form( array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Add Example', 'noun', 'wporg' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
- 'comment_notes_after' => '<p class="examples-are-gpl">' .
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Add Note', 'noun', 'wporg' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
+ 'comment_notes_after' => '<p>' .
+ __( 'Notes should supplement code reference entries, for example examples, tips, explanations, use-cases, and best practices.', 'wporg' ) .
+ '</p><p>' .
+ __( 'Do not use this form for support requests, discussions, spam, bug reports, complaints, or self-promotion. Entries of this nature will be deleted.', 'wporg' ) .
+ '</p><p>' .
+ sprintf( __( 'You can enter text and code. Code should be wrapped in the %s shortcode.', 'wporg' ), '[code][/code]' ) .
+ '</p><p class="user-notes-are-gpl">' .
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf( __( '<strong>NOTE:</strong> All contributions are licensed under <a href="%s">GFDL</a> and are moderated before appearing on the site.', 'wporg' ), 'https://gnu.org/licenses/fdl.html' ) .
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '</p><p>' .
- __( 'The entirety of your submission is considered a code example. Any included non-code text should be formatted as code comments.', 'wporg' ) .
</del><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_submit' => __( 'Add Example', 'wporg' ),
- 'must_log_in' => '<p>' . sprintf( __( 'You must <a href="%s">log in</a> before being able to submit an example.', 'wporg' ), 'https://wordpress.org/support/bb-login.php' ) . '</p>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'label_submit' => __( 'Add Note', 'wporg' ),
+ 'must_log_in' => '<p>' . sprintf( __( 'You must <a href="%s">log in</a> before being able to contribute a note.', 'wporg' ), 'https://wordpress.org/support/bb-login.php' ) . '</p>',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'title_reply' => '', //'Add Example'
</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="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentreferencephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php 2014-09-23 18:25:23 UTC (rev 867)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,9 +151,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( comments_open() || '0' != get_comments_number() ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <hr/>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <section class="examples">
- <h2><?php _e( 'Examples', 'wporg' ); ?></h2>
- <?php comments_template(); /* TODO: add '/examples.php' */ ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <section class="user-notes">
+ <h2><?php _e( 'User Contributed Notes', 'wporg' ); ?></h2>
+ <?php comments_template(); /* TODO: add '/user-notes.php' */ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </section>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentwpparserhookphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php 2014-09-23 18:25:23 UTC (rev 867)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,9 +94,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( comments_open() || '0' != get_comments_number() ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <hr/>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <section class="examples">
- <h2><?php _e( 'Examples', 'wporg' ); ?></h2>
- <?php comments_template(); /* TODO: add '/examples.php' */ ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <section class="user-notes">
+ <h2><?php _e( 'User Contributed Notes', 'wporg' ); ?></h2>
+ <?php comments_template(); /* TODO: add '/user-notes.php' */ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </section>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php 2014-09-23 18:25:23 UTC (rev 867)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +36,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">- * User-submitted content (comments, examples, etc).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * User-submitted content (comments, notes, etc).
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> require __DIR__ . '/inc/user-content.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperinctemplatetagsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php 2014-09-23 18:25:23 UTC (rev 867)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,13 +72,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> endif;
</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 ( ! function_exists( 'wporg_developer_example' ) ) :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! function_exists( 'wporg_developer_user_note' ) ) :
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Template for examples.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Template for user contributed notes.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Used as a callback by wp_list_comments() for displaying the examples.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Used as a callback by wp_list_comments() for displaying the notes.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function wporg_developer_example( $comment, $args, $depth ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function wporg_developer_user_note( $comment, $args, $depth ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['comment'] = $comment;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) : ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,7 +129,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- .comment-metadata -->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( '0' == $comment->comment_approved ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p class="comment-awaiting-moderation"><?php _e( 'Your example is awaiting moderation.', 'wporg' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p class="comment-awaiting-moderation"><?php _e( 'Your note is awaiting moderation.', 'wporg' ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </footer>
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- .comment-meta -->
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,7 +148,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> endif;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- endif; // ends check for wporg_developer_comment()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ endif; // ends check for wporg_developer_user_note()
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! function_exists( 'wporg_developer_posted_on' ) ) :
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,11 +225,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <article id="comment-<?php comment_ID(); ?>" class="comment">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( $comment->comment_approved == '0' ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <em class="comment-awaiting-moderation"><?php _e( 'Your example is awaiting moderation.', 'wporg' ); ?></em>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <em class="comment-awaiting-moderation"><?php _e( 'Your note is awaiting moderation.', 'wporg' ); ?></em>
</ins><span class="cx" style="display: block; padding: 0 10px"> <br />
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <pre class="example-content"><?php echo htmlentities( get_comment_text() ); ?></pre>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <pre class="user-note-content"><?php echo htmlentities( get_comment_text() ); ?></pre>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <footer class="comment-meta">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="comment-author vcard">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -715,13 +715,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">- * Does the post type support having examples?
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Does the post type support having user notes?
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string Optional. The post type name. If blank, assumes current post type.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return 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">- function post_type_supports_examples( $post_type = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function post_type_supports_user_notes( $post_type = null ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_type = $post_type ? $post_type : get_post_type();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return ( 0 === strpos( $post_type, 'wp-parser-' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -811,37 +811,37 @@
</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">- * Indicates if the current user can post an example.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Indicates if the current user can post a user contibuted note.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * This only affects post types wp-parser-* as they are the only things
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * that can have examples.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * that can have user contributed notes.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * A custom check can be performed by hooking the filter
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * 'wporg_devhub-can_user_post_example' and returning a
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * 'wporg_devhub-can_user_post_note' and returning a
</ins><span class="cx" style="display: block; padding: 0 10px"> * value other than null.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * By default, the ability to post examples is restricted to members of the
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * By default, the ability to post notes is restricted to members of the
</ins><span class="cx" style="display: block; padding: 0 10px"> * blog.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id The post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool True if the user can post an example.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool True if the user can post a note.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function can_user_post_example( $open, $post_id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function can_user_post_note( $open, $post_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Only proceed if the post type is one that has examples.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Only proceed if the post type is one that has user contributed notes.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 0 !== strpos( get_post_type( (int) $post_id ), 'wp-parser-' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Temporarily disable commenting that isn't for an example since various
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Temporarily disable commenting that isn't for a note since various
</ins><span class="cx" style="display: block; padding: 0 10px"> // changes need to take place to enable regular commenting.
</span><span class="cx" style="display: block; padding: 0 10px"> return false; //$open;
</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"> // Permit default logic to be overridden via filter that returns value other than null.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( null !== ( $can = apply_filters( 'wporg_devhub-can_user_post_example', null, $post_id ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( null !== ( $can = apply_filters( 'wporg_devhub-can_user_post_note', null, $post_id ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $can;
</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">- // Default to limiting ability to post examples to members of the blog.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Default to limiting ability to post notes to members of the blog.
</ins><span class="cx" style="display: block; padding: 0 10px"> return is_user_member_of_blog();
</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="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperincusercontentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php 2014-09-23 18:25:23 UTC (rev 867)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,6 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Code Reference user submitted content (comments, examples, etc).
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Code Reference user submitted content (comments, notes, etc).
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @package wporg-developer
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,19 +18,15 @@
</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">- * Handles adding/removing hooks to enable comments as examples.
- *
- * Mostly gives users greater permissions in terms of comment content.
- *
- * In order to submit code examples, users must be able to post with less restrictions.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Handles adding/removing hooks to enable comments as user contributed notes.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function do_init() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Restricts commenting to logged in users.
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'comments_open', array( __CLASS__, 'prevent_invalid_comment_submissions' ), 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Sets whether submitting examples is open for the user
- add_filter( 'comments_open', '\DevHub\\can_user_post_example', 10, 2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Sets whether submitting notes is open for the user
+ add_filter( 'comments_open', '\DevHub\\can_user_post_note', 10, 2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Enqueue scripts and styles
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_enqueue_scripts', array( __CLASS__, 'scripts_and_styles' ), 11 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'syntaxhighlighter-core' );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'syntaxhighlighter-theme-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">- wp_enqueue_script( 'wporg-developer-code-examples', get_template_directory_uri() . '/js/code-example.js', array(), '20140423', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array(), '20140912', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( get_option( 'thread_comments' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_script( 'comment-reply' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjscodeexamplejs"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/code-example.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/code-example.js 2014-09-23 18:25:23 UTC (rev 867)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/code-example.js 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,23 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * Comments as examples dynamic functionality.
- *
- */
-
-( function( $ ) {
- $( '#respond, #add-example' ).toggle();
- $( '#add-example' ).click( function( e ) {
- e.preventDefault();
- $( '#respond, #add-example' ).toggle();
-
- if ( pos = $( '#submit' ).position() ) {
- if ( pos.top < $(window).scrollTop() ) {
- // Scroll up
- $( 'html,body' ).animate( {scrollTop:pos.top}, 1000 );
- }
- else if ( pos.top + jQuery("selector").height() > $(window).scrollTop() + (window.innerHeight || document.documentElement.clientHeight) ){
- // Scroll down
- $( 'html,body' ).animate( {scrollTop:pos.top - (window.innerHeight || document.documentElement.clientHeight) + $( '#submit' ).height() + 30}, 1000 );
- }
- }
- } );
-} )( jQuery );
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsusernotesjsfromrev866sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjscodeexamplejs"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js (from rev 866, sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/code-example.js)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js 2014-09-23 18:30:18 UTC (rev 868)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,23 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Dynamic functionality for comments as user submitted notes.
+ *
+ */
+
+( function( $ ) {
+ $( '#respond, #add-user-note' ).toggle();
+ $( '#add-user-note' ).click( function( e ) {
+ e.preventDefault();
+ $( '#respond, #add-user-note' ).toggle();
+
+ if ( pos = $( '#submit' ).position() ) {
+ if ( pos.top < $(window).scrollTop() ) {
+ // Scroll up
+ $( 'html,body' ).animate( {scrollTop:pos.top}, 1000 );
+ }
+ else if ( pos.top + jQuery("selector").height() > $(window).scrollTop() + (window.innerHeight || document.documentElement.clientHeight) ){
+ // Scroll down
+ $( 'html,body' ).animate( {scrollTop:pos.top - (window.innerHeight || document.documentElement.clientHeight) + $( '#submit' ).height() + 30}, 1000 );
+ }
+ }
+ } );
+} )( jQuery );
</ins></span></pre>
</div>
</div>
</body>
</html>