Index: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php
===================================================================
--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php	(revision 4004)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php	(working copy)
@@ -32,19 +32,21 @@
 		<?php endif; // check for comment navigation ?>
 
 		<ol class="comment-list">
-			<?php
-				/* Loop through and list the comments. Tell wp_list_comments()
-				 * to use wporg_developer_comment() to format the comments.
+			<?php 
+				$feedback_editor = false;
+
+				/* Loop through and list the comments. Use wporg_developer_list_notes() to format the comments.
 				 * If you want to override this in a child theme, then you can
-				 * define wporg_developer_comment() and that will be used instead.
-				 * See wporg_developer_comment() in inc/template-tags.php for more.
+				 * define wporg_developer_list_notes() and that will be used instead.
+				 * See wporg_developer_list_notes() in inc/template-tags.php for more.
 				 */
 				if ( is_singular( 'post' ) ) {
 					wp_list_comments();
 				} else {
 					$ordered_comments = wporg_developer_get_ordered_notes();
 					if ( $ordered_comments ) {
-						wp_list_comments( array( 'callback' => 'wporg_developer_user_note' ), $ordered_comments );
+						$feedback_editor = array_filter(  wp_list_pluck( $ordered_comments, 'show_editor') );
+						wporg_developer_list_notes( $ordered_comments, array('avatar_size' => 32) ); 
 					}
 				}
 			?>
@@ -62,13 +64,13 @@
 
 	<?php if ( \DevHub\is_parsed_post_type() && DevHub\can_user_post_note( true, get_the_ID() ) ) : ?>
 
-		<p id="add-user-note" style="display:none;"><a href=""><?php _e( 'Have a note or feedback to contribute?', 'wporg' ); ?></a></p>
+		<?php 
+		$add_note_style = !empty( $feedback_editor ) ? '' : 'display:none;'; ?>
+		<p id="add-user-note" style="<?php echo $add_note_style; ?>"><a href="<?php echo user_trailingslashit( get_permalink() ) . '#respond'; ?>"><?php _e( 'Have a note or feedback to contribute?', 'wporg' ); ?></a></p>
 
-		<?php comment_form( array(
-			'class_form'          => 'comment-form tab-container',
-			'comment_field'       => DevHub_User_Submitted_Content::wp_editor_comments(),
-			'comment_notes_after' => DevHub_Note_Preview::comment_preview() .
-			 	'<p>' .
+		<?php 
+		$args = array(
+			'comment_notes_after' => '<p>' .
 				__( 'Notes should supplement code reference entries, for example examples, tips, explanations, use-cases, and best practices.', 'wporg' ) .
 				'</p><p>' .
 				__( 'Feedback can be to report errors or omissions with the documentation on this page. Such feedback will not be publicly posted.', 'wporg' ) . 
@@ -82,13 +84,29 @@
 				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' ) .
 				'</p>',
 			'label_submit'        => __( 'Add Note or Feedback', 'wporg' ),
+			'cancel_reply_link'   => '',
 			'must_log_in'         => '<p>' . sprintf(
 				__( 'You must <a href="%s">log in</a> before being able to contribute a note or feedback.', 'wporg' ),
 				'https://wordpress.org/support/bb-login.php?redirect_to=' . urlencode( get_comments_link() )
 			) . '</p>',
-			'title_reply'         =>  '', //'Add Example'
-		) ); ?>
+			'title_reply'         => '', //'Add Example'
+			'title_reply_to'      => '',
+		);
+		
+		if ( class_exists( 'DevHub_Note_Preview' ) ) {
+			$args['comment_notes_after'] = DevHub_Note_Preview::comment_preview() . $args['comment_notes_after'];
+			$args['class_form']          = 'comment-form tab-container';
+		}
 
+		if( class_exists( 'DevHub_User_Submitted_Content') ) {
+			$args['comment_field'] = DevHub_User_Submitted_Content::wp_editor_comments();
+		}
+		
+		// Insert comment form if feedback form is not already used
+		if( empty( $feedback_editor ) ) {
+			comment_form( $args );
+		} 	
+		?>
 	<?php endif; ?>
 
 	<?php if ( ! \DevHub\is_parsed_post_type() && comments_open() ) : ?>
Index: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
===================================================================
--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php	(revision 4004)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php	(working copy)
@@ -75,11 +75,12 @@
 	if ( ! function_exists( 'wporg_developer_get_ordered_notes' ) ) :
 		/**
 		 * Get contibuted notes ordered by vote
-		 * 
-		 * By default only top level comments are returned.
-		 * If child notes are included use wp_list_comments() or a custom walker for display. 
-		 * unapproved notes for the current user are included.
 		 *
+		 * Only the parent notes are ordered by vote count.
+		 * Child notes are added to to the parent note 'child_notes' property.
+		 * Unapproved notes for the current user are included.
+		 * Use wporg_developer_list_notes() to display the notes.
+		 *
 		 * @param integer $post_id Optional. Post id to get comments for
 		 * @param array $args Arguments used for get_comments().
 		 * @return array Array with comment objects
@@ -92,31 +93,63 @@
 				$post_id = get_the_ID();
 			}
 
-			$order    = array();
 			$defaults = array(
 				'post__in'           => array( $post_id ),
 				'type'               => 'comment',
 				'status'             => 'approve',
 				'include_unapproved' => array_filter( array( get_current_user_id() ) ),
-				'parent'             => false,
 			);
 
 			if ( is_super_admin() ) {
 				$defaults['status'] = 'all';
 			}
 
-			$args = wp_parse_args( $args, $defaults ); 
+			$args     = wp_parse_args( $args, $defaults );
+			$comments = get_comments( $args );
 
-			$comments = get_comments( $args );
-		
 			if ( ! $comments ) {
 				return;
 			}
 
+			// Check if the current page is a reply to a note.
+			$reply_id = 0;
+			if ( isset( $_GET['replytocom'] ) && $_GET['replytocom'] ) {
+				$reply_id = absint( $_GET['replytocom'] );
+			}
+
+			$order = $children = array();
+			$voting = class_exists( 'DevHub_User_Contributed_Notes_Voting' );
+
+			// Remove child notes and add the vote count order for parent notes
 			foreach ( $comments as $key => $comment ) {
-				$order[ $key ] = (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' );
+				if ( 0 === (int) $comment->comment_parent ) {
+					$vote_count    = $voting ? (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ) : 0;
+					$order[ $key ] = $vote_count;
+				} else {
+					unset( $comments[ $key ] );
+					$children[ $comment->comment_parent ][] = $comment;
+				}
 			}
 
+			$show_editor = false;
+
+			// Add children notes to their parents.
+			foreach ( $comments as $key => $comment ) {
+				$comments[ $key ]->child_notes = array();
+				$comments[ $key ]->show_editor = false;
+
+
+				if ( array_key_exists( $comment->comment_ID, $children ) ) {
+					$comments[ $key ]->child_notes = array_reverse( $children[ $comment->comment_ID ] );
+				}
+
+				if ( !$show_editor && ( $reply_id && ( $reply_id === (int) $comment->comment_ID ) ) ) {
+					// Show the editor when replying to this parent comment
+					$comments[ $key ]->show_editor = true;
+					$show_editor = true;
+				}
+			}
+
 			// sort the posts by votes
 			array_multisort( $order, SORT_DESC, $comments );
 
@@ -124,98 +157,200 @@
 		}
 	endif;
 
+	if ( !function_exists( 'wporg_developer_list_notes' ) ) :
+		/**
+		 * List user contributed notes.
+		 *
+		 * @param array   $comments Array with comment objects.
+		 * @param array   $args Comment display arguments.
+		 * @return void
+		 */
+		function wporg_developer_list_notes( $comments, $args ) {
+			$is_user_logged_in  = is_user_logged_in();
+			$can_user_post_note = DevHub\can_user_post_note( true, get_the_ID() );
+			$user_content       = class_exists( 'DevHub_User_Submitted_Content' );
+			$display_editor     = $is_user_logged_in && $can_user_post_note && $user_content;
+
+			foreach ( $comments as $comment ) {
+
+				$comment_id = $comment->comment_ID;
+
+				// Display parent comment.
+				wporg_developer_user_note( $comment, $args, 1 );
+
+				// Show or hide feedback notes.
+				$class = $comment->show_editor ? '' : ' hide-if-js';
+				echo "<section id='feedback-{$comment_id}' class='feedback{$class}'>\n";
+
+				// Display child comments.
+				if ( !empty( $comment->child_notes ) ) {
+
+					echo "<h4 class='feedback-title'>Feedback</h4>\n";
+					echo "<ul class='children'>\n";
+					foreach ( $comment->child_notes as $child_note ) {
+						wporg_developer_user_note( $child_note, $args, 2, $comment->show_editor );
+					}
+					echo "</ul>\n";
+				}
+
+				// Add a feedback form for logged in users.
+				if ( $display_editor ) {
+					// Show or hide the editor depending if we're replying to a note.
+					$display = $comment->show_editor ? 'show' : 'hide';
+					echo DevHub_User_Submitted_Content::wp_editor_feedback( $comment, $display );
+				}
+				echo "</section><!-- .feedback -->\n";
+
+				// Feedback links to log in, add feedback or show feedback.
+				echo "<footer class='feedback-links' >\n";
+				if ( $can_user_post_note ) {
+					$feedback_link = trailingslashit( get_permalink() ) . "?replytocom={$comment_id}#feedback-editor-{$comment_id}";
+					$display       = '';
+					$aria          = '';
+					if ( !$is_user_logged_in ) {
+						$class         = 'login';
+						$feedback_text = __( 'Log in to add feedback', 'wporg' );
+						$feedback_link = 'https://wordpress.org/support/bb-login.php?redirect_to=' . urlencode( $feedback_link );
+					} else {
+						$class         ='add';
+						$feedback_text = __( 'Add feedback to this note', 'wporg' );
+						$aria          = " aria-expanded='false' aria_controls='feedback-editor-{$comment_id}' aria-label='" . esc_attr( $feedback_text ) . "'";
+
+						// Hide 'add feedback' link if editor is displayed.
+						$display = $display_editor && $comment->show_editor ? ' style="display:none"' : '';
+					}
+					echo '<a class="feedback-' . $class . '" href="' . esc_url( $feedback_link ) . '"' . $display . $aria .' rel="nofollow">' . $feedback_text . '</a>';
+				}
+
+				// close parent list item
+				echo "</footer>\n</article><!-- .comment-body -->\n</li>\n";
+			}
+		}
+	endif;
+
 	if ( ! function_exists( 'wporg_developer_user_note' ) ) :
 		/**
 		 * Template for user contributed notes.
+		 *
+		 * @param object $comment Comment object.
+		 * @param array $args Arguments.
+		 * @param int $depth Nested comment depth.
+		 * @return void
 		 */
 		function wporg_developer_user_note( $comment, $args, $depth ) {
-			$GLOBALS['comment'] = $comment;
-			$count = (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' );
-			$curr_user_note = DevHub_User_Contributed_Notes_Voting::is_current_user_note( $comment->comment_ID );
+			$GLOBALS['comment']       = $comment;
+			$GLOBALS['comment_depth'] = $depth;
 
+			$approved       = ( 0 < (int) $comment->comment_approved ) ? true : false;
+			$is_parent      = ( 0 === (int) $comment->comment_parent ) ? true : false;
+			$is_voting      = class_exists( 'DevHub_User_Contributed_Notes_Voting' );
+			$count          = $is_voting ? (int)  DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ) : 0;
+			$curr_user_note = $is_voting ? (bool) DevHub_User_Contributed_Notes_Voting::is_current_user_note( $comment->comment_ID ) : false;
+
+			// Classes
 			$comment_class = array();
+
 			if ( -1 > $count ) {
 				$comment_class[] = 'bad-note';
 			}
+
 			if ( $curr_user_note ) {
 				$comment_class[] = 'user-submitted-note';
 			}
+
+			if ( !$approved ) {
+				$comment_class[] = 'user-note-moderated';
+			}
+
+			// This would all be moot if core passed the $comment context for 'get_comment_author_link' filter
+			if ( $comment->user_id ) {
+				$commenter = get_user_by( 'id', $comment->user_id );
+				$url = 'https://profiles.wordpress.org/' . esc_attr( $commenter->user_nicename ) . '/';
+				$author = get_the_author_meta( 'display_name', $comment->user_id );
+			} else {
+				$url = $comment->comment_author_url;
+				$author = $comment->comment_author;
+			}
+
+			$comment_author_link = $author;
+			if ( $url ) {
+				$comment_author_link = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
+			}
+
+			$date = sprintf( _x( '%1$s ago', '%1$s = human-readable time difference', 'wporg' ),
+				human_time_diff( get_comment_time( 'U' ),
+					current_time( 'timestamp' ) )
+			);
 			?>
+			<li id="comment-<?php comment_ID(); ?>" data-comment-id="<?php echo $comment->comment_ID;  ?>" <?php comment_class( implode( ' ', $comment_class ) ); ?>>
+			<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
 
-			<li id="comment-<?php comment_ID(); ?>" <?php comment_class( implode( ' ', $comment_class ) ); ?>>
-			<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
-				<a href="#comment-content-<?php echo $comment->comment_ID; ?>" class="screen-reader-text"><?php _e( 'Skip to note content', 'wporg' ); ?></a> 
+			<?php if ( $is_parent ) : ?>
+				<a href="#comment-content-<?php echo $comment->comment_ID; ?>" class="screen-reader-text"><?php _e( 'Skip to note content', 'wporg' ); ?></a>
 				<header class="comment-meta">
-					<?php DevHub_User_Contributed_Notes_Voting::show_voting(); ?>
+
+				<?php
+				if ( $is_voting ) {
+					DevHub_User_Contributed_Notes_Voting::show_voting();
+				}
+				?>
 					<div class="comment-author vcard">
 						<span class="comment-author-attribution">
-						<?php if ( 0 != $args['avatar_size'] ) {
-								echo get_avatar( $comment, $args['avatar_size'] );
-						} ?>
-
 						<?php
-							// This would all be moot if core passed the $comment context for 'get_comment_author_link' filter
-							if ( $comment->user_id ) {
-								$commenter = get_user_by( 'id', $comment->user_id );
-								$url = 'https://profiles.wordpress.org/' . esc_attr( $commenter->user_nicename ) . '/';
-								$author = get_the_author_meta( 'display_name', $comment->user_id );
-							} else {
-								$url = $comment->comment_author_url;
-								$author = $comment->comment_author;
-							}
+						if ( 0 != $args['avatar_size'] ) {
+							echo get_avatar( $comment, $args['avatar_size'] );
+						}
 
-							$comment_author_link = '';
-							if ( $url ) {
-								$comment_author_link = "<a href='$url' rel='external nofollow' class='url'>";
-							}
-							$comment_author_link .= $author;
-							if ( $url ) {
-								$comment_author_link .= '</a>';
-							}
-
-							printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) );
+						printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) );
 						?>
 
 						</span>
 						&mdash;
 						<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
 							<time datetime="<?php comment_time( 'c' ); ?>">
-							<?php 
-								printf( _x( '%1$s ago', '%1$s = human-readable time difference', 'wporg' ),
-									human_time_diff( get_comment_time( 'U' ),
-									current_time( 'timestamp' ) )
-								);
-							?>
+							<?php echo $date;  ?>
 							</time>
 						</a>
-						<?php edit_comment_link( __( 'Edit', 'wporg' ), '<span class="edit-link">&mdash; ', '</span>' ); ?>
+						<?php edit_comment_link( __( 'Edit', 'wporg' ), '<span class="edit-link">&mdash; ', '</span> ' ); ?>
+						<?php if ( !$approved ) : ?>
+							&mdash; <span class="comment-awaiting-moderation"><?php _e( 'awaiting moderation', 'wporg' ); ?></span>
+						<?php endif; ?>
+
 					</div>
 				</header>
 				<!-- .comment-metadata -->
+			<?php endif; ?>
 
 				<div class="comment-content" id="comment-content-<?php echo $comment->comment_ID; ?>">
-					<?php comment_text(); ?>
-				</div>
-				<!-- .comment-content -->
+				<?php
+				if ( $is_parent ) {
+					comment_text();
+				} else {
 
-				<?php if ( '0' == $comment->comment_approved ) : ?>
-					<footer class="comment-footer">
-						<p class="comment-awaiting-moderation"><?php _e( 'Your note is awaiting moderation.', 'wporg' ); ?></p>
-					</footer>
-					<!-- .comment-footer -->
-				<?php endif; ?>
+					$text = get_comment_text()  . ' &mdash; ';
+					$text .= sprintf( __( 'By %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) ) . ' &mdash; ';
+					$text .= ' <a href="'. esc_url( get_comment_link( $comment->comment_ID ) ) . '">';
+					$text .= '<time datetime="' . get_comment_time( 'c' ) . '">' . $date . '</time></a>';
 
-				<?php
-					comment_reply_link( array_merge( $args, array(
-						'add_below' => 'div-comment',
-						'depth'     => $depth,
-						'max_depth' => $args['max_depth'],
-						'before'    => '<div class="reply">',
-						'after'     => '</div>',
-					) ) );
+					if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
+						$text .= ' &mdash; <a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) .'">';
+						$text .= __( 'Edit', 'wporg' ) . '</a>';
+					}
+
+					if ( !$approved ) {
+						$text .= ' &mdash; <span class="comment-awaiting-moderation">' . __( 'awaiting moderation', 'wporg' ) . '</span>';
+					}
+
+					echo apply_filters( 'comment_text', $text );
+				}
 				?>
-			</article><!-- .comment-body -->
-			<?php
+				</div><!-- .comment-content -->
+
+			<?php if ( !$is_parent ) : ?>
+			</article>
+			</li>
+			<?php endif; ?>
+		<?php		
 		}
 	endif; // ends check for wporg_developer_user_note()
 
Index: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php
===================================================================
--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php	(revision 4004)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php	(working copy)
@@ -40,6 +40,9 @@
 		// Remove reply to link
 		add_filter( 'comment_reply_link',              '__return_empty_string' );
 
+		// Remove cancel reply link
+		add_filter( 'cancel_comment_reply_link',       '__return_empty_string' );
+
 		// Disable smilie conversion
 		remove_filter( 'comment_text',                 'convert_smilies',    20 );
 
@@ -58,6 +61,12 @@
 		// Tweak code contained in shortcode
 		add_filter( 'syntaxhighlighter_precode',       array( __CLASS__, 'syntaxhighlighter_precode' ) );
 
+		// Allowed HTML for a new child comment
+		add_filter( 'preprocess_comment', array( __CLASS__, 'comment_new_allowed_html' ) );
+
+		// Allowed HTML for an edited child comment (There is no decent hook to filter child comments only)
+		add_action( 'edit_comment', array( __CLASS__, 'comment_edit_allowed_html' ) );
+
 	}
 
 	/**
@@ -79,6 +88,72 @@
 	}
 
 	/**
+	 * Updates edited child comments with allowed HTML.
+	 * Allowed html is <strong>, <em>, <code> and <a>.
+	 *
+	 * @param int $comment_ID Comment ID.
+	 */
+	public static function comment_edit_allowed_html( $comment_ID ) {
+
+		// Get the edited comment.
+		$comment = get_comment( $comment_ID, ARRAY_A );
+		if ( empty( $comment ) ) {
+			return;
+		}
+
+		if ( ( 0 === (int) $comment['comment_parent'] ) || empty( $comment['comment_content'] ) ) {
+			return;
+		}
+
+		$content = $comment['comment_content'];
+		$data    = self::comment_new_allowed_html( $comment );
+
+		if ( $data['comment_content'] !== $content ) {
+			$commentarr = array(
+				'comment_ID' => $data['comment_ID'],
+				'comment_content' => $data['comment_content']
+			);
+
+			// Update comment content.
+			wp_update_comment( $commentarr );
+		}
+	}
+
+	/**
+	 * Filter new child comments content with allowed HTML.
+	 * Allowed html is <strong>, <em>, <code> and <a>.
+	 *
+	 * @param array $commentdata Array with comment data.
+	 * @return array Array with filtered comment data.
+	 */
+	public static function comment_new_allowed_html( $commentdata ) {
+		$comment_parent = isset( $commentdata['comment_parent'] ) ? absint( $commentdata['comment_parent'] ) : 0;
+		$comment_content = isset( $commentdata['comment_content'] ) ? trim( $commentdata['comment_content'] ) : '';
+
+		if ( ( $comment_parent === 0 ) || !$comment_content ) {
+			return $commentdata;
+		}
+
+		$allowed_html = array(
+			'a'      => array(
+				'href'   => true,
+				'rel'    => true,
+				'target' => true,
+			),
+			'em'     => array(),
+			'strong' => array(),
+			'code'   => array(),
+		);
+
+		$allowed_protocols = array( 'http', 'https' );
+
+		$comment_content = wp_kses( $comment_content, $allowed_html, $allowed_protocols );
+		$commentdata['comment_content'] = preg_replace( '/\r?\n|\r/', '', $comment_content );
+
+		return $commentdata;
+	}
+
+	/**
 	 * Enqueues scripts and styles.
 	 */
 	public static function scripts_and_styles() {
@@ -87,10 +162,12 @@
 			wp_enqueue_style( 'syntaxhighlighter-core' );
 			wp_enqueue_style( 'syntaxhighlighter-theme-default' );
 
-			wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'quicktags' ), '20160824', true );
-			if ( get_option( 'thread_comments' ) ) {
-				wp_enqueue_script( 'comment-reply' );
-			}
+			wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'jquery', 'quicktags' ), '20160809', true );
+			wp_enqueue_script( 'wporg-developer-user-notes-feedback', get_template_directory_uri() . '/js/user-notes-feedback.js', array( 'jquery', 'quicktags' ), '20160809', true );
+			wp_localize_script( 'wporg-developer-user-notes-feedback', 'wporg_note_feedback', array(
+				'show'        => __( 'Show Feedback', 'wporg' ),
+				'hide'        => __( 'Hide Feedback', 'wporg' ),
+			) );
 		}
 	}
 
@@ -154,6 +231,65 @@
 		return ob_get_clean();
 	}
 
+	/**
+	 * Capture an {@see wp_editor()} instance as the 'User Contributed Notes' feedback form.
+	 *
+	 * Uses output buffering to capture the editor instance.
+	 *
+	 * @return string HTML output for the wp_editor-ized feedback form.
+	 */
+	public static function wp_editor_feedback( $comment, $display = 'show', $content = '' ) {
+
+		if ( !( isset( $comment->comment_ID ) && absint( $comment->comment_ID ) ) ) {
+			return '';
+		}
+
+		$comment_id = absint( $comment->comment_ID );
+
+		static $instance = 0;
+		$instance++;
+
+		$display = ( 'hide' === $display ) ? ' style="display: none;"' : '';
+		$title = __( 'Add feedback to this note', 'wporg' );
+		$form_type = '';
+		$button_text = __( 'Add Feedback', 'wporg' );
+
+		if ( !empty( $content ) ) {
+			$title = __( 'Edit feedback', 'wporg' );
+			$form_type = '-edit';
+			$button_text = __( 'Edit Feedback', 'wporg' );
+		}
+
+		$allowed_tags = '';
+		foreach ( array( '<strong>', '<em>', '<code>', '<a>' ) as $tag ) {
+			$allowed_tags .= '<code>' . htmlentities( $tag ) . '</code>, ';
+		}
+
+		ob_start();
+		echo "<div id='feedback-editor-{$comment_id}' class='feedback-editor'{$display}>\n";
+		echo "<p class='feedback-editor-title'>{$title}</p>\n";
+		echo '<form id="feedback-form-' . $instance . $form_type . '" class="feedback-form" method="post" action="' . site_url( '/wp-comments-post.php' ) . '" name="feedback-form-' . $instance ."\">\n";
+
+		wp_editor( '', 'feedback-' . $instance, array(
+			'media_buttons' => false,
+			'textarea_name' => 'comment',
+			'textarea_rows' => 3,
+			'quicktags'     => array(
+				'buttons' => 'strong,em'
+			),
+			'teeny'         => true,
+			'tinymce'       => false,
+		) );
+
+		echo '<p><strong>' . __( 'Note', 'wporg' ) . '</strong>: ' . __( 'No newlines allowed', 'wporg' ) . '. ';
+		printf( __( 'Allowed tags: %s', 'wporg' ), trim( $allowed_tags, ', ' ) ) . "</p>\n";
+		echo "<p><input id='submit-{$instance}' class='submit' type='submit' value='Add Feedback' name='submit-{$instance}'>\n";
+		echo "<input type='hidden' name='comment_post_ID' value='" . get_the_ID() . "' id='comment_post_ID-{$instance}' />\n";
+		echo "<input type='hidden' name='comment_parent' id='comment_parent-{$instance}' value='{$comment_id}' />\n";
+		echo "</p>\n</form>\n</div><!-- #feedback-editor-{$comment_id} -->\n";
+		return ob_get_clean();
+	}
+
 } // DevHub_User_Submitted_Content
 
 DevHub_User_Submitted_Content::init();
Index: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-feedback.js
===================================================================
--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-feedback.js	(revision 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-feedback.js	(working copy)
@@ -0,0 +1,204 @@
+( function( $ ) {
+
+	if ( undefined === wporg_note_feedback ) {
+		return;
+	}
+
+	var options        = wporg_note_feedback;
+	var wpAdminBar     = $('#page.admin-bar').length ? 32 : 0;
+	var feedbackToggle = $( '<a class="feedback-toggle" href="#">' + options.show + '</a>' );
+	var hash           = window.location.hash;
+
+	// Check if the fragment identifier is a comment ID (e.g. #comment-63)
+	if ( !hash.match( /#comment\-[0-9]+$/ ) ) {
+		hash = '';
+	}
+	
+	$( '.feedback-editor' ).each( function() {
+
+		// Hide hidden editor with 'hide-if-js' class.
+		if( 'none' === $(this).css('display') ) {
+			$( this ).show().addClass( 'hide-if-js' );
+		}
+
+		// Add quicktag 'inline code' button to editor. 
+		var id = $( this ).find( 'textarea' ).attr( 'id' );
+		if ( id.length ) {
+			QTags.addButton( 'inline-code', 'inline code', '<code>', '</code>', '', '', '', id );
+		}
+	} );
+
+	// Loop through feedback notes
+	$( '.comment' ).each( function() {
+		var feedbackLinks = $( this ).find( '.feedback-links' );
+		var childComments = $( this ).find( 'ul.children' );
+		
+		if ( childComments.length && feedbackLinks.length ) {
+			var feedback = $( this ).find( '.feedback' );
+			var toggle = feedbackToggle.clone();
+
+			toggle.attr( {
+				'aria-expanded': 'false',
+				'aria-controls': 'feedback-' + getCommentID( $(this) )
+			} );
+
+			// Set text to 'Hide Feedback' if feedback is displayed
+			if ( !feedback.hasClass( 'hide-if-js' ) ) {
+				toggle.text( options.hide );
+			}
+
+			feedbackLinks.find( '.feedback-add' ).show();
+			feedbackLinks.append( toggle );
+		}
+
+		if ( feedbackLinks.length ) {
+			// Move feedback links before feedback.
+			var clonedElements = feedbackLinks.clone().children();
+			var feedbackLinksTop = $( '<div class="feedback-links"></div>' ).append( clonedElements );
+			$( this ).find( '.feedback' ).first().before( feedbackLinksTop );
+			feedbackLinks.addClass( 'bottom hide-if-js' );
+		}
+	} );
+
+	// Returns comment ID from data attribute.
+	function getCommentID( el ) {
+		return $(el).is("[data-comment-id]") ? el.data( 'comment-id' ) : 0;
+	}
+
+	// Removes added elements 
+	function resetComment( el ) {
+
+		var children = el.find( 'ul.children' );
+		if ( !children.length ) {
+			el.find( '.feedback-toggle' ).remove();
+		}
+
+		el.find( '.feedback-links.bottom' ).addClass( 'hide-if-js' );
+	}
+
+	// Show hidden child comments if the fragment identifier is a comment ID (e.g. #comment-63).  
+	$( document ).ready( function() {
+
+		var childComments = $( '.comment' ).find( 'ul.children' );
+
+		if ( !( hash.length && childComments.length ) ) {
+			return;
+		}
+
+		var hashComment = childComments.find( hash ).first();
+		if ( hashComment.length ) {
+			// Child comment exists.
+
+			var parent = hashComment.closest( '.comment.depth-1' );
+			if ( parent.find( '.feedback' ).hasClass( 'hide-if-js' ) ) {
+				// Show child comments.
+				parent.find( '.feedback-toggle' ).first().trigger( 'click' );
+			}
+
+			// Scroll to the child comment.
+			var pos = hashComment.offset();
+			$( 'html,body' ).animate( {
+				scrollTop: pos.top - wpAdminBar
+			}, 1 );
+		}
+	} );
+
+	// Show/Hide feedback toggle link.
+	$( document ).on( 'click', '.feedback-toggle', function( e ) {
+		e.preventDefault();
+
+		var parent = $( this ).closest( '.comment.depth-1' );
+		if ( !parent.length ) {
+			return;
+		}
+
+		resetComment( parent );
+		var feedback = parent.find( '.feedback' );
+		var toggleLinks = parent.find( '.feedback-toggle' );
+
+		if ( feedback.hasClass( 'hide-if-js' ) ) {
+			// Feedback is hidden.
+
+			// Show feedback.
+			toggleLinks.text( options.hide );
+			feedback.removeClass( 'hide-if-js' );
+			toggleLinks.attr( 'aria-expanded', 'true' );
+
+			// Go to the clicked feedback toggle link.
+			var pos = $( this ).offset();
+			$( 'html,body' ).animate( {
+				scrollTop: pos.top - wpAdminBar
+			}, 1000 );
+
+			// Add feedback links at the bottom if there are over 3 feedback notes.
+			var children = parent.find( 'ul.children > li' );
+			if ( 3 < children.length ) {
+				var feedbackLinks = parent.find( '.feedback-links.bottom' );
+				feedbackLinks.removeClass( 'hide-if-js' );
+			}
+
+		} else {
+			// Hide feedback.
+			toggleLinks.text( options.show );
+			feedback.addClass( 'hide-if-js' );
+			toggleLinks.attr( 'aria-expanded', 'false' );
+
+			// Hide editor.
+			var editor = feedback.find( '.feedback-editor' );
+			editor.addClass( 'hide-if-js' );
+
+			parent.find( '.feedback-add' ).attr( 'aria-expanded', 'false' );
+		}
+	} );
+
+	// Show editor when the add feedback link is clicked.
+	$( document ).on( 'click', '.feedback-add', function( e ) {
+		e.preventDefault();
+
+		var parent = $( this ).closest( '.comment.depth-1' );
+		if ( !parent.length ) {
+			return;
+		}
+
+		resetComment( parent );
+
+		var feedback = parent.find( '.feedback' );
+		var children = parent.find( 'ul.children' );
+		var feedbackLinks = parent.find( '.feedback-add' );
+
+		// Show feedback.
+		feedback.removeClass( 'hide-if-js' );
+		feedbackLinks.attr( 'aria-expanded', 'true' );
+
+		// Show the feedback editor.
+		var editor = feedback.find( '.feedback-editor' );
+		editor.removeClass( 'hide-if-js' );
+
+		// Change the toggle link text to 'Hide Feedback'.
+		var toggleLinks = parent.find( '.feedback-toggle' );
+		if ( toggleLinks.length ) {
+			toggleLinks.attr( 'aria-expanded', 'true' );
+			toggleLinks.text( options.hide );
+		}
+
+		// If there are no child comments add a 'Hide Feedback' link.
+		if ( !children.length ) {
+			var hide = feedbackToggle.clone();
+			hide.text( options.hide );
+			hide.attr( {
+				'aria-expanded': 'true',
+				'aria-controls': 'feedback-' + getCommentID( parent )
+			} );
+			parent.find( '.feedback-links' ).append( hide );
+		}
+
+		// Go to the feedback editor and give it focus.
+		var pos = editor.offset();
+		$( 'html,body' ).animate( {
+			scrollTop: pos.top - wpAdminBar
+		}, 1000, function() {
+			editor.find( 'textarea' ).focus();
+		} );
+	} );
+
+} )( jQuery );
\ No newline at end of file
Index: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js
===================================================================
--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js	(revision 4004)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js	(working copy)
@@ -13,14 +13,15 @@
 
 	function showCommentForm() {
 		$( '#respond' ).show();
-		$( '#add-user-note').hide();
+		$( '#add-user-note' ).hide();
 
-		var target = $( '#commentform #add-note-or-feedback' );
+		var wpAdminBar = $('#page.admin-bar').length ? 32 : 0;
+		var target     = $( '#commentform #add-note-or-feedback' );
 		if ( target.length ) {
 			var pos = target.offset();
 
 			$( 'html,body' ).animate( {
-				scrollTop: pos.top
+				scrollTop: pos.top - wpAdminBar
 			}, 1000 );
 		}
 	}
@@ -37,9 +38,9 @@
 	}
 
 	// Add php and js buttons to QuickTags.
-	QTags.addButton( 'php', 'php', '[php]', '[/php]' );
-	QTags.addButton( 'js', 'js', '[js]', '[/js]' );
-	QTags.addButton( 'inline-code', 'inline code', '<code>', '</code>' );
+	QTags.addButton( 'php', 'php', '[php]', '[/php]', '', '', '', 'comment' );
+	QTags.addButton( 'js', 'js', '[js]', '[/js]', '', '', '', 'comment' );
+	QTags.addButton( 'inline-code', 'inline code', '<code>', '</code>', '', '', '', 'comment' );
 
 	// Override tab within user notes textarea to actually insert a tab character.
 	// Copied from code within core's wp-admin/js/common.js.
Index: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
===================================================================
--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss	(revision 4004)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss	(working copy)
@@ -1216,6 +1216,18 @@
 			opacity: 1;
 		}
 
+		.comment-awaiting-moderation {
+			background-color: #fff8e5;
+			padding: .2em .5em;
+			border-radius: 3px;
+			border: 1px solid #ffb900;
+		}
+
+		.depth-2 .comment-awaiting-moderation {
+			display: inline-block;
+			margin: 2px 0;
+		}
+
 		.comment-list,
 		.comment-list ol {
 			list-style: none;
@@ -1225,17 +1237,70 @@
 
 		.comment-list li,
 		#comment-preview {
-			margin-top: 2.5rem;
+			margin-top: 3rem;
 			background: #fff;
 			overflow: auto;
-			border: 1px solid #dfdfdf;
-			border-radius: 0 2px 2px 2px;
 
 			article {
 				overflow: auto;
 			}
 		}
 
+		.comment-list li.depth-1,
+		#comment-preview {
+			border: 1px solid #dfdfdf;
+			border-radius: 2px;
+		}
+
+		/* Feedback */
+		.comment-list li.depth-2 {
+			border-top: 1px solid #dfdfdf;
+			padding: 0;
+			margin: 0;
+
+			.comment-content {
+				padding: .9em 0;
+			}
+			.comment-content p {
+				margin-bottom: 0;
+				font-size: .9em;
+			}
+		}
+
+		.comment ul.children {
+			margin: 0 0 1.5em 0;
+			border-bottom: 1px solid #dfdfdf;
+		}
+
+		.feedback {
+			width: 90%;
+			float: right;
+			margin-right: 1.5rem; 
+		}
+
+		.feedback-links {
+			margin: 0 1.5rem  1em 1.5rem;
+			font-size: 0.9em;
+			clear:both;
+		}
+
+		.feedback-editor-title,
+		.feedback-title {			
+			font-size: 1.8rem;
+    		font-weight: 300;
+    		line-height: 2.2rem;
+    		margin-bottom: 1em;
+		}
+
+		.feedback-toggle {
+			margin: 0 0 0 1.5rem;
+			display: inline-block;
+		}
+
+		#wp-feedback-wrap {
+			padding-bottom: 1em;
+		}
+
 		#comment-preview,
 		.js & .comment-form-comment {
 			margin-top: 0;
@@ -1304,21 +1369,6 @@
 			padding: 2rem 1.5rem .5rem;
 		}
 
-		.comment-footer {
-			margin: 0 1em;
-			padding: 0 0 1em 0;
-			position: relative;
-			overflow: auto;
-
-			a {
-				float: right;
-			}
-
-			p {
-				margin-bottom: 0;
-			}
-		}
-
 		.comment-content ol {
 			list-style: decimal inside;
 			margin: 0 0 1.5em 0;
Index: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css
===================================================================
--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css	(revision 4004)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css	(working copy)
@@ -1582,6 +1582,10 @@
   word-wrap: break-word;
 }
 
+.devhub-wrap.single-wp-parser-function, .devhub-wrap.single-wp-parser-method, .devhub-wrap.single-wp-parser-hook, .devhub-wrap.single-wp-parser-class {
+  /* Feedback */
+}
+
 .devhub-wrap.single-wp-parser-function .bad-note .comment-content, .devhub-wrap.single-wp-parser-method .bad-note .comment-content, .devhub-wrap.single-wp-parser-hook .bad-note .comment-content, .devhub-wrap.single-wp-parser-class .bad-note .comment-content {
   opacity: .6;
 }
@@ -1590,6 +1594,18 @@
   opacity: 1;
 }
 
+.devhub-wrap.single-wp-parser-function .comment-awaiting-moderation, .devhub-wrap.single-wp-parser-method .comment-awaiting-moderation, .devhub-wrap.single-wp-parser-hook .comment-awaiting-moderation, .devhub-wrap.single-wp-parser-class .comment-awaiting-moderation {
+  background-color: #fff8e5;
+  padding: .2em .5em;
+  border-radius: 3px;
+  border: 1px solid #ffb900;
+}
+
+.devhub-wrap.single-wp-parser-function .depth-2 .comment-awaiting-moderation, .devhub-wrap.single-wp-parser-method .depth-2 .comment-awaiting-moderation, .devhub-wrap.single-wp-parser-hook .depth-2 .comment-awaiting-moderation, .devhub-wrap.single-wp-parser-class .depth-2 .comment-awaiting-moderation {
+  display: inline-block;
+  margin: 2px 0;
+}
+
 .devhub-wrap.single-wp-parser-function .comment-list,
 .devhub-wrap.single-wp-parser-function .comment-list ol, .devhub-wrap.single-wp-parser-method .comment-list,
 .devhub-wrap.single-wp-parser-method .comment-list ol, .devhub-wrap.single-wp-parser-hook .comment-list,
@@ -1605,11 +1621,9 @@
 .devhub-wrap.single-wp-parser-method #comment-preview, .devhub-wrap.single-wp-parser-hook .comment-list li,
 .devhub-wrap.single-wp-parser-hook #comment-preview, .devhub-wrap.single-wp-parser-class .comment-list li,
 .devhub-wrap.single-wp-parser-class #comment-preview {
-  margin-top: 2.5rem;
+  margin-top: 3rem;
   background: #fff;
   overflow: auto;
-  border: 1px solid #dfdfdf;
-  border-radius: 0 2px 2px 2px;
 }
 
 .devhub-wrap.single-wp-parser-function .comment-list li article,
@@ -1620,6 +1634,67 @@
   overflow: auto;
 }
 
+.devhub-wrap.single-wp-parser-function .comment-list li.depth-1,
+.devhub-wrap.single-wp-parser-function #comment-preview, .devhub-wrap.single-wp-parser-method .comment-list li.depth-1,
+.devhub-wrap.single-wp-parser-method #comment-preview, .devhub-wrap.single-wp-parser-hook .comment-list li.depth-1,
+.devhub-wrap.single-wp-parser-hook #comment-preview, .devhub-wrap.single-wp-parser-class .comment-list li.depth-1,
+.devhub-wrap.single-wp-parser-class #comment-preview {
+  border: 1px solid #dfdfdf;
+  border-radius: 2px;
+}
+
+.devhub-wrap.single-wp-parser-function .comment-list li.depth-2, .devhub-wrap.single-wp-parser-method .comment-list li.depth-2, .devhub-wrap.single-wp-parser-hook .comment-list li.depth-2, .devhub-wrap.single-wp-parser-class .comment-list li.depth-2 {
+  border-top: 1px solid #dfdfdf;
+  padding: 0;
+  margin: 0;
+}
+
+.devhub-wrap.single-wp-parser-function .comment-list li.depth-2 .comment-content, .devhub-wrap.single-wp-parser-method .comment-list li.depth-2 .comment-content, .devhub-wrap.single-wp-parser-hook .comment-list li.depth-2 .comment-content, .devhub-wrap.single-wp-parser-class .comment-list li.depth-2 .comment-content {
+  padding: .9em 0;
+}
+
+.devhub-wrap.single-wp-parser-function .comment-list li.depth-2 .comment-content p, .devhub-wrap.single-wp-parser-method .comment-list li.depth-2 .comment-content p, .devhub-wrap.single-wp-parser-hook .comment-list li.depth-2 .comment-content p, .devhub-wrap.single-wp-parser-class .comment-list li.depth-2 .comment-content p {
+  margin-bottom: 0;
+  font-size: .9em;
+}
+
+.devhub-wrap.single-wp-parser-function .comment ul.children, .devhub-wrap.single-wp-parser-method .comment ul.children, .devhub-wrap.single-wp-parser-hook .comment ul.children, .devhub-wrap.single-wp-parser-class .comment ul.children {
+  margin: 0 0 1.5em 0;
+  border-bottom: 1px solid #dfdfdf;
+}
+
+.devhub-wrap.single-wp-parser-function .feedback, .devhub-wrap.single-wp-parser-method .feedback, .devhub-wrap.single-wp-parser-hook .feedback, .devhub-wrap.single-wp-parser-class .feedback {
+  width: 90%;
+  float: right;
+  margin-right: 1.5rem;
+}
+
+.devhub-wrap.single-wp-parser-function .feedback-links, .devhub-wrap.single-wp-parser-method .feedback-links, .devhub-wrap.single-wp-parser-hook .feedback-links, .devhub-wrap.single-wp-parser-class .feedback-links {
+  margin: 0 1.5rem  1em 1.5rem;
+  font-size: 0.9em;
+  clear: both;
+}
+
+.devhub-wrap.single-wp-parser-function .feedback-editor-title,
+.devhub-wrap.single-wp-parser-function .feedback-title, .devhub-wrap.single-wp-parser-method .feedback-editor-title,
+.devhub-wrap.single-wp-parser-method .feedback-title, .devhub-wrap.single-wp-parser-hook .feedback-editor-title,
+.devhub-wrap.single-wp-parser-hook .feedback-title, .devhub-wrap.single-wp-parser-class .feedback-editor-title,
+.devhub-wrap.single-wp-parser-class .feedback-title {
+  font-size: 1.8rem;
+  font-weight: 300;
+  line-height: 2.2rem;
+  margin-bottom: 1em;
+}
+
+.devhub-wrap.single-wp-parser-function .feedback-toggle, .devhub-wrap.single-wp-parser-method .feedback-toggle, .devhub-wrap.single-wp-parser-hook .feedback-toggle, .devhub-wrap.single-wp-parser-class .feedback-toggle {
+  margin: 0 0 0 1.5rem;
+  display: inline-block;
+}
+
+.devhub-wrap.single-wp-parser-function #wp-feedback-wrap, .devhub-wrap.single-wp-parser-method #wp-feedback-wrap, .devhub-wrap.single-wp-parser-hook #wp-feedback-wrap, .devhub-wrap.single-wp-parser-class #wp-feedback-wrap {
+  padding-bottom: 1em;
+}
+
 .devhub-wrap.single-wp-parser-function #comment-preview,
 .js .devhub-wrap.single-wp-parser-function .comment-form-comment, .devhub-wrap.single-wp-parser-method #comment-preview,
 .js .devhub-wrap.single-wp-parser-method .comment-form-comment, .devhub-wrap.single-wp-parser-hook #comment-preview,
@@ -1684,21 +1759,6 @@
   padding: 2rem 1.5rem .5rem;
 }
 
-.devhub-wrap.single-wp-parser-function .comment-footer, .devhub-wrap.single-wp-parser-method .comment-footer, .devhub-wrap.single-wp-parser-hook .comment-footer, .devhub-wrap.single-wp-parser-class .comment-footer {
-  margin: 0 1em;
-  padding: 0 0 1em 0;
-  position: relative;
-  overflow: auto;
-}
-
-.devhub-wrap.single-wp-parser-function .comment-footer a, .devhub-wrap.single-wp-parser-method .comment-footer a, .devhub-wrap.single-wp-parser-hook .comment-footer a, .devhub-wrap.single-wp-parser-class .comment-footer a {
-  float: right;
-}
-
-.devhub-wrap.single-wp-parser-function .comment-footer p, .devhub-wrap.single-wp-parser-method .comment-footer p, .devhub-wrap.single-wp-parser-hook .comment-footer p, .devhub-wrap.single-wp-parser-class .comment-footer p {
-  margin-bottom: 0;
-}
-
 .devhub-wrap.single-wp-parser-function .comment-content ol, .devhub-wrap.single-wp-parser-method .comment-content ol, .devhub-wrap.single-wp-parser-hook .comment-content ol, .devhub-wrap.single-wp-parser-class .comment-content ol {
   list-style: decimal inside;
   margin: 0 0 1.5em 0;
