Created
July 19, 2012 14:05
-
-
Save kovshenin/3144162 to your computer and use it in GitHub Desktop.
Here's why you should not use dashes in WordPress shortcodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Shortcodes | |
add_shortcode( 'my', function() { return 'my'; } ); | |
add_shortcode( 'my-shortcode', function() { return 'my-shortcode'; } ); | |
add_shortcode( 'my_shortcode', function() { return 'my_shortcode'; } ); | |
/** | |
* Results: | |
* | |
* [my] - my | |
* [my-shortcode] - my (didn't expect it, did you?) | |
* [my_shortcode] - my_shortcode | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more info see http://core.trac.wordpress.org/ticket/17657