fix possible PHP Warning

This commit is contained in:
Matthias Pfefferle 2024-10-15 13:01:41 +02:00
parent f0d72c9c57
commit 12ab7768d4

View file

@ -123,9 +123,14 @@ class Extra_Fields {
'type' => 'Link',
'name' => \get_the_title( $post ),
'href' => \esc_url( $tags->get_attribute( 'href' ) ),
'rel' => explode( ' ', $tags->get_attribute( 'rel' ) ),
);
$rel = $tags->get_attribute( 'rel' );
if ( $rel && \is_string( $rel ) ) {
$attachment['rel'] = \explode( ' ', $rel );
}
$link_added = true;
}
}