BytesCo / wpsmartcrop

GNU General Public License v2.0
21 stars 13 forks source link

Undefined array key "class" #14

Closed y2keeper closed 1 year ago

y2keeper commented 1 year ago

I am getting the following error after updating:

Undefined array key "class" in wp-smartcrop.php line 453

Seems to occur when the figure image doesn't have a class attribute as a result of last week's changes.

As a side-note: When the figure image does have a class attribute it is having the tag class added without separating space on that same line (453).

The following would fix both those issues:

if(false === empty($img_tag['attributes']['class'])) {
    $img_tag['attributes']['class'] .= ' ' . $tag['attributes']['class'];
}
aaronsilber commented 1 year ago

@y2keeper Thanks for the issue report and suggested solution. We are reviewing this and will seek to address this in an upcoming release.