Skip to content

Commit

Permalink
fix(widget): Fix missing widget slug
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Mar 13, 2020
1 parent ee52b63 commit 6b18d33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function compose($callback = null)
return;
}

if (empty($this->slug)) {
$this->slug = Str::slug($this->name);
}

parent::compose(function () {
$this->widget = (object) collect(
Arr::get($GLOBALS, 'wp_registered_widgets')
Expand Down

0 comments on commit 6b18d33

Please sign in to comment.