Skip to content

Commit

Permalink
Fix file extension stripping code.
Browse files Browse the repository at this point in the history
  • Loading branch information
strarsis committed Jan 25, 2018
1 parent 0cca69f commit 0ccb18c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ function get_icon_path_abs($icon) {
return trailingslashit(get_svg_path()) . $icon . '.svg';
}

/**
* Returns a path without file extension
*
* @param string $icon
* @return string
*/
function strip_file_ext($path)
{
$parts = pathinfo($path);
return trailingslashit($parts['dirname']) . $parts['filename'];
}

/**
* Returns path to icon in a sage theme
*
Expand All @@ -83,7 +71,7 @@ function get_icon_sage_path($icon)
$icon_path_rel = RelPath::getRelativePath($icon_path_abs, get_svg_path());

// 6. Final icon path without extension expected
$icon_imgpath_noext = strip_file_ext($icon_path_rel);
$icon_imgpath_noext = pathinfo($icon_path_rel, PATHINFO_FILENAME);

return $icon_imgpath_noext;
}
Expand Down

0 comments on commit 0ccb18c

Please sign in to comment.