Skip to content

Commit

Permalink
Merge pull request #171 from skaut/widget-icon-fix
Browse files Browse the repository at this point in the history
Fixed error with widget icons for plugin widgets
  • Loading branch information
marekdedic authored Apr 25, 2020
2 parents d623e00 + 0cd0020 commit 65fbb59
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/php/frontend/widget-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function enqueue() {
* @SuppressWarnings(PHPMD.ShortVariable)
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
function add_icon( string $title, array $_, string $id_base ) {
function add_icon( string $title, array $_ = array(), string $id_base = '' ) {
switch ( $id_base ) {
case 'text':
$icon = 'message';
Expand All @@ -51,10 +51,7 @@ function add_icon( string $title, array $_, string $id_base ) {
$icon = 'box';
break;
default:
$icon = '';
return $title;
}
if ( '' !== $icon ) {
$icon = '<span class="icon dripicons-' . $icon . ' crdm-modern-inline-icon"></span>';
}
return $icon . $title;
return '<span class="icon dripicons-' . $icon . ' crdm-modern-inline-icon"></span>' . $title;
}

0 comments on commit 65fbb59

Please sign in to comment.