From a8ccd1cd24bb37c273fd1877452b8116b8109ae3 Mon Sep 17 00:00:00 2001 From: scossar Date: Wed, 30 May 2018 17:49:44 -0700 Subject: [PATCH] Changes for WordPress coding standards --- css/comments.css | 2 +- lib/discourse-comment-formatter.php | 4 ++-- lib/template-functions.php | 4 ++-- templates/html-templates.php | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/css/comments.css b/css/comments.css index ed5178f..01bb406 100644 --- a/css/comments.css +++ b/css/comments.css @@ -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'; } diff --git a/lib/discourse-comment-formatter.php b/lib/discourse-comment-formatter.php index 4093cd4..efa0f60 100644 --- a/lib/discourse-comment-formatter.php +++ b/lib/discourse-comment-formatter.php @@ -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() ); diff --git a/lib/template-functions.php b/lib/template-functions.php index 8c241cb..33cc01d 100644 --- a/lib/template-functions.php +++ b/lib/template-functions.php @@ -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 ); diff --git a/templates/html-templates.php b/templates/html-templates.php index 7e873b0..831bef6 100644 --- a/templates/html-templates.php +++ b/templates/html-templates.php @@ -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 */