generator icon indicating copy to clipboard operation
generator copied to clipboard

Plugin name with whitespaces does not become a slug separated by hyphens

Open tomonic-x opened this issue 2 years ago • 2 comments

{
  "plugin": {
    "name": "Good Plugin Name"
  }
}

Expected WPBP_PLUGIN_SLUG is good-plugin-name. Actual WPBP_PLUGIN_SLUG is goodpluginname.

https://github.com/WPBP/generator/blob/master/generator/init.php#L37

tomonic-x avatar Feb 15 '23 09:02 tomonic-x

You are right, this shouldn't happen, probably is the preg_replace in the line you mentioned that strip the whitespace so the next function is not executed.

I will work on this ASAP.

Mte90 avatar Feb 15 '23 09:02 Mte90

So I checked the behaviour of the generator and it was always in that way. I think that it wasn't right as usually space is always replaced with a dash. I am releasing now a new version with the fix.

Mte90 avatar Feb 17 '23 16:02 Mte90