How to include spaces in WordPress shortcode arguments

Here's how to include a half-width space within the string of a convenient WordPress "shortcode" argument.
If you insert it as is
[addr name=東京都 千代田区]
In this way, "Chiyoda-ku" will be recognized as the second key.
$atts['name']->東京都
$atts['千代田区']->null
Enclose with quotation marks
Enclose the value with double quotation marks " or single quotation marks '.
[addr name="東京都 千代田区"]
Then you should be able to retrieve it successfully.
$atts['name']->東京都 千代田区
Comments
If you found "It was different in my environment!" or anything else, please feel free to comment.




If this was helpful, we'd appreciate your support!
Your support will be used for childcare.
Or support us by buying something from the buttons below
(You don't have to buy the linked product.)
Amazon
楽天市場
Yahoo!ショッピング
PR