@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | if ( ! empty( $field ) ) { |
| 94 | 94 | |
| 95 | - $comment_fields['comment'] = '<div id="preview-wrapper"></div>' . $comment_fields['comment']; |
|
| 95 | + $comment_fields[ 'comment' ] = '<div id="preview-wrapper"></div>' . $comment_fields[ 'comment' ]; |
|
| 96 | 96 | |
| 97 | - $comment_fields['comment'] .= $field; |
|
| 97 | + $comment_fields[ 'comment' ] .= $field; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | return $comment_fields; |
@@ -165,37 +165,37 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $response = array(); |
| 167 | 167 | |
| 168 | - if ( ! empty( $request['author'] ) ) { |
|
| 169 | - $response['author'] = esc_html( $request['author'] ); |
|
| 168 | + if ( ! empty( $request[ 'author' ] ) ) { |
|
| 169 | + $response[ 'author' ] = esc_html( $request[ 'author' ] ); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | $user_id = ( ( is_user_logged_in() ) ? get_current_user_id() : 0 ); |
| 173 | 173 | |
| 174 | - if ( ! empty( $user_id ) && empty( $response['author'] ) ) { |
|
| 174 | + if ( ! empty( $user_id ) && empty( $response[ 'author' ] ) ) { |
|
| 175 | 175 | |
| 176 | 176 | $user = get_userdata( $user_id ); |
| 177 | 177 | |
| 178 | 178 | if ( $user ) { |
| 179 | 179 | |
| 180 | - $response['author'] = $user->data->display_name; |
|
| 180 | + $response[ 'author' ] = $user->data->display_name; |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - $response['gravatar'] = get_avatar_url( $user_id, array( 'size' => 50 ) ); |
|
| 184 | + $response[ 'gravatar' ] = get_avatar_url( $user_id, array( 'size' => 50 ) ); |
|
| 185 | 185 | |
| 186 | - $response['date'] = current_time( get_option( 'date_format' ) . ' \a\t ' . get_option( 'time_format' ) ); |
|
| 186 | + $response[ 'date' ] = current_time( get_option( 'date_format' ) . ' \a\t ' . get_option( 'time_format' ) ); |
|
| 187 | 187 | |
| 188 | - if ( ! empty( $request['comment'] ) && isset( $request['format'] ) ) { |
|
| 189 | - if ( 'text' === $request['format'] ) { |
|
| 190 | - $comment = wp_kses_data( $request['comment'] ); |
|
| 188 | + if ( ! empty( $request[ 'comment' ] ) && isset( $request[ 'format' ] ) ) { |
|
| 189 | + if ( 'text' === $request[ 'format' ] ) { |
|
| 190 | + $comment = wp_kses_data( $request[ 'comment' ] ); |
|
| 191 | 191 | } else { |
| 192 | - $comment = apply_filters( 'pre_comment_content', $request['comment'] ); |
|
| 192 | + $comment = apply_filters( 'pre_comment_content', $request[ 'comment' ] ); |
|
| 193 | 193 | } |
| 194 | 194 | } else { |
| 195 | 195 | $comment = ''; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - $response['comment'] = $comment; |
|
| 198 | + $response[ 'comment' ] = $comment; |
|
| 199 | 199 | |
| 200 | 200 | return $response; |
| 201 | 201 | } |