Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Namespaces in functions.php can lead to fatal error #733

Open
Retrofitterdk opened this issue Oct 1, 2024 · 1 comment
Open

PHP Namespaces in functions.php can lead to fatal error #733

Retrofitterdk opened this issue Oct 1, 2024 · 1 comment

Comments

@Retrofitterdk
Copy link

I’m not sure whether this should actually be characterised as a bug in create-block-theme, but cloning a theme that uses a PHP Namespace in functions.php can lead to fatal error.

If you want to clone eg. Ollie theme, which uses

namespace Ollie;

in the functions.php file.

And you chose to give the new, cloned theme a name with a space like "My Theme", then the namespace in functions.php in the cloned theme will be set to

namespace My Theme;

This will immediately cause a fatal php error and make the site inaccessible and you would need to switch theme by making a change in the database.

Thanks a lot for all the hard work with create-block-theme - it really brings a huge amount of value to the community.

@Retrofitterdk
Copy link
Author

Retrofitterdk commented Oct 1, 2024

This will immediately cause a fatal php error and make the site inaccessible and you would need to switch theme by making a change in the database.

Obviously removing spaces from the one line of code in functions.php will also fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant