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

Commit 06f0f0a

Browse files
authored
finally fixed namings
and prevented duplicate checks
1 parent ca8cce0 commit 06f0f0a

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

includes/class-linkbacks-handler.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -419,25 +419,23 @@ public static function comment_text_add_cite( $text, $comment = null, $args = ar
419419
* @return string the post type
420420
*/
421421
public static function get_post_type( $post_id ) {
422-
$post_format = 'post';
423-
if ( 'page' === get_post_type( $post_id ) ) {
424-
$post_format = 'page';
425-
}
426-
if ( current_theme_supports( 'post-formats' ) ) {
427-
$post_typestrings = self::get_post_type_strings();
422+
$post_typestrings = self::get_post_type_strings();
423+
$post_type = $post_typestrings[ 'post' ];
424+
425+
// If this is the page homepages are redirected to then use the site name
426+
if ( $post_id === get_option( 'webmention_home_mentions', 0 ) ) {
427+
$post_type = get_bloginfo( 'name' );
428+
} else if ( 'page' === get_post_type( $post_id ) ) {
429+
$post_type = $post_typestrings[ 'page' ];
430+
} else if ( current_theme_supports( 'post-formats' ) ) {
428431
$post_format = get_post_format( $post_id );
429432

430433
// add "standard" as default for post format enabled types
431434
if ( ! $post_format || ! in_array( $post_format, array_keys( $post_typestrings ), true ) ) {
432435
$post_format = 'standard';
433436
}
434-
}
435-
436-
$post_type = $post_typestrings[ $post_format ];
437-
438-
// If this is the page homepages are redirected to then use the site name
439-
if ( $post_id === get_option( 'webmention_home_mentions', 0 ) ) {
440-
$post_type = get_bloginfo( 'name' );
437+
438+
$post_type = $post_typestrings[ $post_format ];
441439
}
442440

443441
return apply_filters( 'semantic_linkbacks_post_type', $post_type, $post_id );

0 commit comments

Comments
 (0)