Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit a363b8d

Browse files
committed
fixed indents
1 parent 4fdad8e commit a363b8d

File tree

2 files changed

+97
-97
lines changed

2 files changed

+97
-97
lines changed

includes/class-linkbacks-handler.php

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -71,37 +71,37 @@ public static function show_mentions() {
7171
*/
7272
public static function register_meta() {
7373
$args = array(
74-
'sanitize_callback' => 'esc_url_raw',
75-
'type' => 'string',
76-
'description' => 'Author URL',
77-
'single' => true,
78-
'show_in_rest' => true,
74+
'sanitize_callback' => 'esc_url_raw',
75+
'type' => 'string',
76+
'description' => 'Author URL',
77+
'single' => true,
78+
'show_in_rest' => true,
7979
);
8080
register_meta( 'comment', 'semantic_linkbacks_author_url', $args );
8181

8282
$args = array(
83-
'sanitize_callback' => 'esc_url_raw',
84-
'type' => 'string',
85-
'description' => 'Avatar URL',
86-
'single' => true,
87-
'show_in_rest' => true,
83+
'sanitize_callback' => 'esc_url_raw',
84+
'type' => 'string',
85+
'description' => 'Avatar URL',
86+
'single' => true,
87+
'show_in_rest' => true,
8888
);
8989
register_meta( 'comment', 'semantic_linkbacks_avatar', $args );
9090

9191
$args = array(
92-
'sanitize_callback' => 'esc_url_raw',
93-
'type' => 'string',
94-
'description' => 'Canonical URL',
95-
'single' => true,
96-
'show_in_rest' => true,
92+
'sanitize_callback' => 'esc_url_raw',
93+
'type' => 'string',
94+
'description' => 'Canonical URL',
95+
'single' => true,
96+
'show_in_rest' => true,
9797
);
9898
register_meta( 'comment', 'semantic_linkbacks_canonical', $args );
9999

100100
$args = array(
101-
'type' => 'string',
102-
'description' => 'Linkbacks Type',
103-
'single' => true,
104-
'show_in_rest' => true,
101+
'type' => 'string',
102+
'description' => 'Linkbacks Type',
103+
'single' => true,
104+
'show_in_rest' => true,
105105
);
106106
register_meta( 'comment', 'semantic_linkbacks_type', $args );
107107
}
@@ -160,10 +160,10 @@ public static function retrieve( $url ) {
160160
global $wp_version;
161161
$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) );
162162
$args = array(
163-
'timeout' => 100,
164-
'limit_response_size' => 1048576,
165-
'redirection' => 20,
166-
'user-agent' => "$user_agent; verifying linkback",
163+
'timeout' => 100,
164+
'limit_response_size' => 1048576,
165+
'redirection' => 20,
166+
'user-agent' => "$user_agent; verifying linkback",
167167
);
168168
return wp_safe_remote_get( $url, $args );
169169
}
@@ -191,20 +191,20 @@ public static function update_meta( $comment_id, $commentdata ) {
191191
*/
192192
public static function get_comment_type_excerpts() {
193193
$strings = array(
194-
// special case. any value that evals to false will be considered standard
195-
'mention' => __( '%1$s mentioned %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
196-
197-
'reply' => __( '%1$s replied to %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
198-
'repost' => __( '%1$s reposted %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
199-
'like' => __( '%1$s liked %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
200-
'favorite' => __( '%1$s favorited %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
201-
'tag' => __( '%1$s tagged %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
202-
'bookmark' => __( '%1$s bookmarked %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
203-
'rsvp:yes' => __( '%1$s is <strong>attending</strong>.', 'semantic-linkbacks' ),
204-
'rsvp:no' => __( '%1$s is <strong>not attending</strong>.', 'semantic-linkbacks' ),
205-
'rsvp:maybe' => __( 'Maybe %1$s will be <strong>attending</strong>.', 'semantic-linkbacks' ),
206-
'rsvp:invited' => __( '%1$s is <strong>invited</strong>.', 'semantic-linkbacks' ),
207-
'rsvp:tracking' => __( '%1$s <strong>tracks</strong> this event.', 'semantic-linkbacks' ),
194+
// special case. any value that evals to false will be considered standard
195+
'mention' => __( '%1$s mentioned %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
196+
197+
'reply' => __( '%1$s replied to %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
198+
'repost' => __( '%1$s reposted %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
199+
'like' => __( '%1$s liked %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
200+
'favorite' => __( '%1$s favorited %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
201+
'tag' => __( '%1$s tagged %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
202+
'bookmark' => __( '%1$s bookmarked %2$s on <a href="%3$s">%4$s</a>.', 'semantic-linkbacks' ),
203+
'rsvp:yes' => __( '%1$s is <strong>attending</strong>.', 'semantic-linkbacks' ),
204+
'rsvp:no' => __( '%1$s is <strong>not attending</strong>.', 'semantic-linkbacks' ),
205+
'rsvp:maybe' => __( 'Maybe %1$s will be <strong>attending</strong>.', 'semantic-linkbacks' ),
206+
'rsvp:invited' => __( '%1$s is <strong>invited</strong>.', 'semantic-linkbacks' ),
207+
'rsvp:tracking' => __( '%1$s <strong>tracks</strong> this event.', 'semantic-linkbacks' ),
208208
);
209209

210210
return $strings;
@@ -217,20 +217,20 @@ public static function get_comment_type_excerpts() {
217217
*/
218218
public static function get_comment_type_strings() {
219219
$strings = array(
220-
// Special case. any value that evals to false will be considered standard
221-
'mention' => __( 'Mention', 'semantic-linkbacks' ),
222-
223-
'reply' => __( 'Reply', 'semantic-linkbacks' ),
224-
'repost' => __( 'Repost', 'semantic-linkbacks' ),
225-
'like' => __( 'Like', 'semantic-linkbacks' ),
226-
'favorite' => __( 'Favorite', 'semantic-linkbacks' ),
227-
'tag' => __( 'Tag', 'semantic-linkbacks' ),
228-
'bookmark' => __( 'Bookmark', 'semantic-linkbacks' ),
229-
'rsvp:yes' => __( 'RSVP', 'semantic-linkbacks' ),
230-
'rsvp:no' => __( 'RSVP', 'semantic-linkbacks' ),
231-
'rsvp:invited' => __( 'RSVP', 'semantic-linkbacks' ),
232-
'rsvp:maybe' => __( 'RSVP', 'semantic-linkbacks' ),
233-
'rsvp:tracking' => __( 'RSVP', 'semantic-linkbacks' ),
220+
// Special case. any value that evals to false will be considered standard
221+
'mention' => __( 'Mention', 'semantic-linkbacks' ),
222+
223+
'reply' => __( 'Reply', 'semantic-linkbacks' ),
224+
'repost' => __( 'Repost', 'semantic-linkbacks' ),
225+
'like' => __( 'Like', 'semantic-linkbacks' ),
226+
'favorite' => __( 'Favorite', 'semantic-linkbacks' ),
227+
'tag' => __( 'Tag', 'semantic-linkbacks' ),
228+
'bookmark' => __( 'Bookmark', 'semantic-linkbacks' ),
229+
'rsvp:yes' => __( 'RSVP', 'semantic-linkbacks' ),
230+
'rsvp:no' => __( 'RSVP', 'semantic-linkbacks' ),
231+
'rsvp:invited' => __( 'RSVP', 'semantic-linkbacks' ),
232+
'rsvp:maybe' => __( 'RSVP', 'semantic-linkbacks' ),
233+
'rsvp:tracking' => __( 'RSVP', 'semantic-linkbacks' ),
234234
);
235235

236236
return $strings;
@@ -243,18 +243,18 @@ public static function get_comment_type_strings() {
243243
*/
244244
public static function get_post_format_strings() {
245245
$strings = array(
246-
// Special case. any value that evals to false will be considered standard
247-
'standard' => __( 'this Article', 'semantic-linkbacks' ),
248-
249-
'aside' => __( 'this Aside', 'semantic-linkbacks' ),
250-
'chat' => __( 'this Chat', 'semantic-linkbacks' ),
251-
'gallery' => __( 'this Gallery', 'semantic-linkbacks' ),
252-
'link' => __( 'this Link', 'semantic-linkbacks' ),
253-
'image' => __( 'this Image', 'semantic-linkbacks' ),
254-
'quote' => __( 'this Quote', 'semantic-linkbacks' ),
255-
'status' => __( 'this Status', 'semantic-linkbacks' ),
256-
'video' => __( 'this Video', 'semantic-linkbacks' ),
257-
'audio' => __( 'this Audio', 'semantic-linkbacks' ),
246+
// Special case. any value that evals to false will be considered standard
247+
'standard' => __( 'this Article', 'semantic-linkbacks' ),
248+
249+
'aside' => __( 'this Aside', 'semantic-linkbacks' ),
250+
'chat' => __( 'this Chat', 'semantic-linkbacks' ),
251+
'gallery' => __( 'this Gallery', 'semantic-linkbacks' ),
252+
'link' => __( 'this Link', 'semantic-linkbacks' ),
253+
'image' => __( 'this Image', 'semantic-linkbacks' ),
254+
'quote' => __( 'this Quote', 'semantic-linkbacks' ),
255+
'status' => __( 'this Status', 'semantic-linkbacks' ),
256+
'video' => __( 'this Video', 'semantic-linkbacks' ),
257+
'audio' => __( 'this Audio', 'semantic-linkbacks' ),
258258
);
259259

260260
return $strings;
@@ -351,8 +351,8 @@ public static function comment_text_add_cite( $text, $comment = null, $args = ar
351351

352352
// only change text for "real" comments (replys)
353353
if ( ! $semantic_linkbacks_type ||
354-
'' != $comment->comment_type ||
355-
'reply' != $semantic_linkbacks_type ) {
354+
'' != $comment->comment_type ||
355+
'reply' != $semantic_linkbacks_type ) {
356356
return $text;
357357
}
358358

@@ -391,8 +391,8 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
391391

392392
// only change text for pingbacks/trackbacks/webmentions
393393
if ( '' == $comment->comment_type ||
394-
! $semantic_linkbacks_type ||
395-
'reply' == $semantic_linkbacks_type ) {
394+
! $semantic_linkbacks_type ||
395+
'reply' == $semantic_linkbacks_type ) {
396396
return $text;
397397
}
398398

@@ -411,28 +411,28 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
411411
}
412412
}
413413

414-
// get post type
415-
$post_formatstrings = self::get_post_format_strings();
416-
$post_type = $post_formatstrings[ $post_format ];
414+
// get post type
415+
$post_formatstrings = self::get_post_format_strings();
416+
$post_type = $post_formatstrings[ $post_format ];
417417

418-
$post_type = apply_filters( 'semantic_linkbacks_post_type', $post_type, $comment->comment_post_ID );
418+
$post_type = apply_filters( 'semantic_linkbacks_post_type', $post_type, $comment->comment_post_ID );
419419

420-
// get all the excerpts
421-
$comment_type_excerpts = self::get_comment_type_excerpts();
420+
// get all the excerpts
421+
$comment_type_excerpts = self::get_comment_type_excerpts();
422422

423-
$url = self::get_url( $comment );
423+
$url = self::get_url( $comment );
424424

425-
// parse host
426-
$host = wp_parse_url( $url, PHP_URL_HOST );
427-
// strip leading www, if any
428-
$host = preg_replace( '/^www\./', '', $host );
425+
// parse host
426+
$host = wp_parse_url( $url, PHP_URL_HOST );
427+
// strip leading www, if any
428+
$host = preg_replace( '/^www\./', '', $host );
429429

430-
// generate output. use full content if it's small enough, otherwise use excerpt.
430+
// generate output. use full content if it's small enough, otherwise use excerpt.
431431
if ( ! ( 'mention' == $semantic_linkbacks_type && strlen( wp_strip_all_tags( $text ) ) <= MAX_INLINE_MENTION_LENGTH ) ) {
432432
$text = sprintf( $comment_type_excerpts[ $semantic_linkbacks_type ], get_comment_author_link( $comment->comment_ID ), $post_type, $url, $host );
433433
}
434434

435-
return apply_filters( 'semantic_linkbacks_excerpt', $text );
435+
return apply_filters( 'semantic_linkbacks_excerpt', $text );
436436
}
437437

438438
/**
@@ -460,8 +460,8 @@ public static function get_avatar_url( $comment ) {
460460
*/
461461
public static function pre_get_avatar_data( $args, $id_or_email ) {
462462
if ( ! $id_or_email instanceof WP_Comment ||
463-
! isset( $id_or_email->comment_type ) ||
464-
$id_or_email->user_id ) {
463+
! isset( $id_or_email->comment_type ) ||
464+
$id_or_email->user_id ) {
465465
return $args;
466466
}
467467

@@ -530,19 +530,19 @@ public static function comment_class( $classes, $class, $comment_id, $post_id )
530530

531531
// "comment type to class" mapper
532532
$class_mapping = array(
533-
'mention' => array( 'h-as-mention' ),
534-
535-
'reply' => array( 'h-as-reply' ),
536-
'repost' => array( 'h-as-repost', 'p-repost' ),
537-
'like' => array( 'h-as-like', 'p-like' ),
538-
'favorite' => array( 'h-as-favorite', 'p-favorite' ),
539-
'tag' => array( 'h-as-tag', 'p-tag' ),
540-
'bookmark' => array( 'h-as-bookmark', 'p-bookmark' ),
541-
'rsvp:yes' => array( 'h-as-rsvp' ),
542-
'rsvp:no' => array( 'h-as-rsvp' ),
543-
'rsvp:maybe' => array( 'h-as-rsvp' ),
544-
'rsvp:invited' => array( 'h-as-rsvp' ),
545-
'rsvp:tracking' => array( 'h-as-rsvp' ),
533+
'mention' => array( 'h-as-mention' ),
534+
535+
'reply' => array( 'h-as-reply' ),
536+
'repost' => array( 'h-as-repost', 'p-repost' ),
537+
'like' => array( 'h-as-like', 'p-like' ),
538+
'favorite' => array( 'h-as-favorite', 'p-favorite' ),
539+
'tag' => array( 'h-as-tag', 'p-tag' ),
540+
'bookmark' => array( 'h-as-bookmark', 'p-bookmark' ),
541+
'rsvp:yes' => array( 'h-as-rsvp' ),
542+
'rsvp:no' => array( 'h-as-rsvp' ),
543+
'rsvp:maybe' => array( 'h-as-rsvp' ),
544+
'rsvp:invited' => array( 'h-as-rsvp' ),
545+
'rsvp:tracking' => array( 'h-as-rsvp' ),
546546
);
547547

548548
$semantic_linkbacks_type = self::get_type( $comment );

includes/class-linkbacks-mf2-handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ public static function convert_time( $time ) {
290290
public static function get_property( $key, $properties ) {
291291
if ( isset( $properties[ $key ] ) && isset( $properties[ $key ][0] ) ) {
292292
if ( is_array( $properties[ $key ] ) ) {
293-
$properties[ $key ] = array_unique( $properties[ $key ] );
293+
$properties[ $key ] = array_unique( $properties[ $key ] );
294294
}
295295
if ( 1 === count( $properties[ $key ] ) ) {
296-
return $properties[ $key ][0];
296+
return $properties[ $key ][0];
297297
}
298298
return $properties[ $key ];
299299
}

0 commit comments

Comments
 (0)