Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Transform spaces to underscores when scaffolding a child theme #40
Thanks for the pull request @eliseferguson
Out of curiosity, why'd you use
preg_replace() here when
str_replace() also accepts an array as its first argument?
Also, it looks like you may have used spaces for indentation instead of tabs. Can you fix?
Lastly, can you include a test case reflecting this change?
You could use
Okay so here's an attempt at a test case:
Scenario: Scaffold theme tests parent theme with space in directory
changed the title from
Update str_replace to preg_replace and to include spaces when creatin…
Transform spaces to underscores when scaffolding a child theme
Aug 22, 2017
I can understand we should use
preg_replace, but in this case I feel
preg_replace is better, because we should replace all chars which are not allowed to use as a name of the function like following.
preg_replace( '/\W/', '_', $data['parent_theme'] )