Skip to content

Commit

Permalink
v1.1.2
Browse files Browse the repository at this point in the history
* Use `Collection::put()` instead of `Collection::replace()` to maintain backwards compatibility.
  • Loading branch information
Log1x committed Aug 7, 2019
1 parent 08624f7 commit 0f6752c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.1.2 (08-07-2019)

### Bug fixes
- Use `Collection::put()` instead of `Collection::replace()` to maintain backwards compatibility.

## v1.1.1 (08-07-2019)

### Enhancements
Expand Down
12 changes: 3 additions & 9 deletions src/Directives/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,21 +290,15 @@
! is_numeric($image) &&
$image = Util::field($image)
) {
$expression = $expression->replace([
0 => is_array($image) && ! empty($image['id']) ? $image['id'] : $image
]);
$expression = $expression->put(0, is_array($image) && ! empty($image['id']) ? $image['id'] : $image);
}

if (! empty($expression->get(3))) {
$expression = $expression->replace([
2 => Util::clean($expression->slice(2)->all())
]);
$expression = $expression->put(2, Util::clean($expression->slice(2)->all()));
}

if (! empty($expression->get(2)) && ! Util::isArray($expression->get(2))) {
$expression = $expression->replace([
2 => Util::toString(['alt' => $expression->get(2)])
]);
$expression = $expression->put(2, Util::toString(['alt' => $expression->get(2)]));
}

if ($expression->get(1)) {
Expand Down

0 comments on commit 0f6752c

Please sign in to comment.