(I thought this would be a much harder problem, but it was actually pretty easy.)
I realized that any time a slug with 's needed to be replaced it was ALSO followed by a ( i.e. slug_name_function and never just slug_name). So replacing old_slug_ with new_slug_ was the answer.
The order of replacement (replacing slugs with 's first) had to be changed to make sure that when cloning a theme without 's in the slug that the functions were correctly changed.
Fixes #228
To Test:
Using the CBT interface in the Editor
Create a Blank theme with a name that contains spaces, dashes and/or underscores
Clone a theme with a name spaces, dashes and/or underscores
Observe that the new theme has the correct textdomain and it is used correctly throughout the theme (especially in PHP files with functions that use the theme slug such as functions.php).
This change allows spaces in theme slugs.
(I thought this would be a much harder problem, but it was actually pretty easy.)
I realized that any time a slug with 's needed to be replaced it was ALSO followed by a ( i.e. slug_name_function and never just slug_name). So replacing
old_slug_
withnew_slug_
was the answer.The order of replacement (replacing slugs with 's first) had to be changed to make sure that when cloning a theme without 's in the slug that the functions were correctly changed.
Fixes #228
To Test:
Observe that the new theme has the correct textdomain and it is used correctly throughout the theme (especially in PHP files with functions that use the theme slug such as
functions.php
).