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

Commit ca8cce0

Browse files
authored
finally fixed format/type stuff
1 parent c5f8590 commit ca8cce0

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,20 +419,21 @@ 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_type = 'post';
422+
$post_format = 'post';
423423
if ( 'page' === get_post_type( $post_id ) ) {
424-
$post_type = 'page';
424+
$post_format = 'page';
425425
}
426426
if ( current_theme_supports( 'post-formats' ) ) {
427427
$post_typestrings = self::get_post_type_strings();
428428
$post_format = get_post_format( $post_id );
429-
$post_type = 'standard';
430429

431430
// add "standard" as default for post format enabled types
432-
if ( $post_format && in_array( $post_format, array_keys( $post_typestrings ), true ) ) {
433-
$post_type = $post_typestrings[ $post_format ];
431+
if ( ! $post_format || ! in_array( $post_format, array_keys( $post_typestrings ), true ) ) {
432+
$post_format = 'standard';
434433
}
435434
}
435+
436+
$post_type = $post_typestrings[ $post_format ];
436437

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 ) ) {

0 commit comments

Comments
 (0)