14 | | if ( comments_open() ) : |
15 | | if ( filter_input( INPUT_GET, 'feedback_submitted' ) ) : ?> |
16 | | <h2 id="reply-title" class="comment-reply-title"> |
17 | | <?php esc_html_e( 'Thank you for your feedback', 'wporg-forums' ); ?> |
18 | | </h2> |
19 | | <p> |
20 | | <?php esc_html_e( 'We will review it as quickly as possible.', 'wporg-forums' ); ?> |
21 | | </p> |
22 | | <?php else : |
23 | | comment_form( |
24 | | array( |
25 | | 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', |
26 | | 'title_reply' => __( 'Was this article helpful? How could it be improved?', 'wporg-forums' ), |
27 | | 'title_reply_after' => '</h2>', |
28 | | 'must_log_in' => sprintf( |
29 | | '<p class="must-log-in">%s</p>', |
| 14 | if ( is_user_logged_in() ) : |
| 15 | if ( comments_open() ) : |
| 16 | if ( filter_input( INPUT_GET, 'feedback_submitted' ) ) : ?> |
| 17 | <h2 id="reply-title" class="comment-reply-title"> |
| 18 | <?php esc_html_e( 'Thank you for your feedback', 'wporg-forums' ); ?> |
| 19 | </h2> |
| 20 | <p> |
| 21 | <?php esc_html_e( 'We will review it as quickly as possible.', 'wporg-forums' ); ?> |
| 22 | </p> |
| 23 | <?php else : |
| 24 | comment_form( |
| 25 | array( |
| 26 | 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', |
| 27 | 'title_reply' => __( 'Was this article helpful?', 'wporg-forums' ), |
| 28 | 'title_reply_after' => '</h2><p>' . __( 'Suggest an improvement to this article.', 'wporg-forums' ) . '</p>', |
| 29 | 'must_log_in' => sprintf( |
| 30 | '<p class="must-log-in">%s</p>', |
| 31 | sprintf( |
| 32 | /* translators: %s: Login URL. */ |
| 33 | wp_kses_post( __( 'You must be <a href="%s">logged in</a> to submit feedback.', 'wporg-forums' ) ), |
| 34 | wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) |
| 35 | ) |
| 36 | ), |
| 37 | 'comment_field' => sprintf( |
| 38 | '<p class="comment-form-comment">%s %s</p>', |
| 39 | sprintf( |
| 40 | '<label for="comment" class="screen-reader-text">%s</label>', |
| 41 | _x( 'Feedback', 'noun', 'wporg-forums' ) |
| 42 | ), |
| 43 | '<textarea id="comment" name="comment" rows="6" maxlength="65525" required></textarea>' |
| 44 | ), |
| 45 | 'comment_notes_after' => |
31 | | wp_kses_post( __( 'You must be <a href="%s">logged in</a> to submit feedback.', 'wporg-forums' ) ), |
32 | | wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) |
33 | | ) |
34 | | ), |
35 | | 'comment_field' => sprintf( |
36 | | '<p class="comment-form-comment">%s %s</p>', |
37 | | sprintf( |
38 | | '<label for="comment" class="screen-reader-text">%s</label>', |
39 | | _x( 'Feedback', 'noun', 'wporg-forums' ) |
| 47 | /* translators: %s: Support forums link. */ |
| 48 | wp_kses_post( __( 'If this article did not help you and you need more support, then please post your question at <a href="%s">support forums</a>.', 'wporg-forums' ) ), |
| 49 | esc_url( __( 'https://wordpress.org/support/welcome/' ) ) |
41 | | '<textarea id="comment" name="comment" rows="6" maxlength="65525" required></textarea>' |
42 | | ), |
43 | | 'comment_notes_after' => esc_html__( 'Feedback you send to us will go only to the folks who maintain documentation. They may reach out in case there are questions or would like to followup feedback. But that too will stay behind the scenes.', 'wporg-forums' ), |
44 | | 'label_submit' => __( 'Submit Feedback', 'wporg-forums' ), |
| 51 | 'label_submit' => __( 'Submit Feedback', 'wporg-forums' ), |
| 52 | ) |
| 53 | ); |
| 54 | endif; // filter_input( INPUT_GET, 'feedback_submitted' ) |
| 55 | endif; // comments_open() |
| 56 | else : |
| 57 | ?> |
| 58 | <div class="comment-respond" id="respond"> |
| 59 | <h3 class="comment-reply-title"><?php _e( 'Was this article helpful?', 'wporg-forums' ); ?></h3> |
| 60 | <?php |
| 61 | printf( |
| 62 | '<p class="must-log-in">%s</p>', |
| 63 | sprintf( |
| 64 | /* translators: %s: Login URL. */ |
| 65 | wp_kses_post( __( 'You must be <a href="%s">logged in</a> to suggest an improvement to this article.', 'wporg-forums' ) ), |
| 66 | wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) |