I use this simple code to add a basic shortcode to my WordPress site:
function post_review25() {
return '<div class="review2-5">Rating:</div>';
}
add_shortcode('review 2.5', 'post_review25');
So by adding [review 2.5] in the visual editor, it should echo <div class="review2-5">Rating:</div>. However, the dot in the review 2.5 stops it from functioning – it echo’s the code for review 2 instead (I have a shortcode set for that too).
This means that anything past the dot is not recognized. How is it possible that I can add a dot there and have it functional?
The first parameter to
add_shortcode()should be tag-like with a few additional limitations:http://codex.wordpress.org/Shortcode_API