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

Commit fb040c3

Browse files
authored
changed $post_format check
1 parent 96124dd commit fb040c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

includes/class-linkbacks-handler.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,21 +419,22 @@ 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_typestrings = self::get_post_type_strings();
423422
$post_format = 'post';
424423
if ( 'page' === get_post_type( $post_id ) ) {
425424
$post_format = 'page';
426425
}
427426
if ( current_theme_supports( 'post-formats' ) ) {
427+
$post_typestrings = self::get_post_type_strings();
428428
$post_format = get_post_format( $post_id );
429+
429430
// add "standard" as default for post format enabled types
430-
if ( ! $post_format || ! in_array( $post_format, array_keys( $post_typestrings ), true ) ) {
431-
$post_format = 'standard';
431+
if ( $post_format && in_array( $post_format, array_keys( $post_typestrings ), true ) ) {
432+
$post_type = $post_typestrings[ $post_format ];
432433
}
434+
435+
$post_format = 'standard';
433436
}
434437

435-
$post_type = $post_typestrings[ $post_format ];
436-
437438
// If this is the page homepages are redirected to then use the site name
438439
if ( $post_id === get_option( 'webmention_home_mentions', 0 ) ) {
439440
$post_type = get_bloginfo( 'name' );

0 commit comments

Comments
 (0)