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

Use underscores instead of hyphens in shortcode names #26

Open
joostthehost opened this issue Mar 1, 2017 · 0 comments
Open

Use underscores instead of hyphens in shortcode names #26

joostthehost opened this issue Mar 1, 2017 · 0 comments

Comments

@joostthehost
Copy link

According to Wordpress:

"Shortcode names should be all lowercase and use all letters, but numbers and underscores should work fine too. Be wary of using hyphens (dashes), you'll be better off not using them. "
https://codex.wordpress.org/Shortcode_API

The use of the dash in the shortcodes can throw issues with other plugins and potential custom code that sees it as an invalid shortcode (the widely used Visual Composer for example, doesn't accept shortcode names with hypens in them. It blocks users from adding those shortcodes to their setup).
More info on what exactly can go wrong when using hyphens:
https://codex.wordpress.org/Shortcode_API#Hyphens

I'm aware this change would not be backwards compatible, and would thus be a breaking change for existing installations. An option to overcome this is to do a search and replace on the database to update existing shortcodes to the new style, and displaying a message in the admin interface to notify editors of the updated shortcodes.

@joostthehost joostthehost changed the title Use underscore instead of dash in shortcode names Use underscore instead of hyphens in shortcode names Mar 1, 2017
@joostthehost joostthehost changed the title Use underscore instead of hyphens in shortcode names Use underscores instead of hyphens in shortcode names Mar 1, 2017
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