2
0
Fork 0
mirror of https://github.com/discourse/wp-discourse.git synced 2025-10-03 08:59:21 +08:00

Changes for WordPress coding standards

This commit is contained in:
scossar 2018-05-30 17:49:44 -07:00
parent 6127889c9f
commit a8ccd1cd24
4 changed files with 7 additions and 6 deletions

View file

@ -130,6 +130,6 @@ span.badge-category-bg {
display: inline-block;
width: 1em;
margin-right: 0.2em;
text-aligh: center;
text-align: center;
content: '\e800';
}

View file

@ -96,7 +96,7 @@ class DiscourseCommentFormatter {
if ( count( $posts ) > 0 ) {
$displayed_comment_number = 0;
foreach ( $posts as $post ) {
$even = 0 === $displayed_comment_number % 2;
$even = 0 === $displayed_comment_number % 2;
$post_url = esc_url( $permalink . '/' . $post->post_number );
$comment_html = wp_kses_post( Templates::comment_html( $even ) );
$comment_html = str_replace( '{discourse_url}', $discourse_url, $comment_html );
@ -116,7 +116,7 @@ class DiscourseCommentFormatter {
$comment_html = str_replace( '{comment_body}', $comment_body, $comment_html );
$comment_html = str_replace( '{comment_created_at}', $this->format_date( $post->created_at, $datetime_format ), $comment_html );
$comments_html .= $comment_html;
$displayed_comment_number += 1;
$displayed_comment_number++;
}
foreach ( $participants as $participant ) {
$participant_html = wp_kses_post( Templates::participant_html() );

View file

@ -28,7 +28,7 @@ trait TemplateFunctions {
* Substitutes the value for `$size` into the template.
*
* @param string $template The avatar template.
* @param int $size The size of the avarar.
* @param int $size The size of the avarar.
*
* @return mixed
*/
@ -141,7 +141,7 @@ trait TemplateFunctions {
$link = $doc->createElement( 'a' );
$link->setAttribute( 'class', 'wpdc-poll-link' );
$link->setAttribute( 'href', $url );
$link_text = $doc->createTextNode( 'View Poll' );
$link_text = $doc->createTextNode( __( 'View Poll', 'wp-discourse' ) );
$link->appendChild( $link_text );

$poll->parentNode->replaceChild( $link, $poll );

View file

@ -91,7 +91,7 @@ class HTMLTemplates {
*
* Available tags:
* {comments}, {discourse_url}, {discourse_url_name}, {topic_url}
*
*
* @param null/string $discourse_comments_number The number of comments that are displayed on Discourse.
* @static
* @return mixed|void
@ -151,6 +151,7 @@ class HTMLTemplates {
* {avatar_url}, {user_url}, {username}, {fullname},
* {comment_body}, {comment_created_at}, {comment_url}
*
* @param bool $even Whether it's an even comment number.
* @static
* @return mixed|void
*/