Do you mean a shortcode that would generate an HTML comment? It doesn’t exist currently – it looks like that could be included in the HTML blocks module.
Just curious, is there an advantage to using a shortcode instead of direct HTML? I guess to make the comments visible in the visual editor?
I have a situation where I wanted to add a comment before the main shortcode using the visual editor to make things clear for the person editing the post.
I’m imagining something like:
[-- your comment here /--]
That’s using the fact that -
is a valid character for a shortcode name.
Would that work for you?
Hello, I added this feature in the newest update. It works like this:
[*] Your comment here [/*]
The shortcode doesn’t display anything on the frontend, so you can leave comments inside the visual editor.
Hello,
I had to change this shortcode to make it compatible with the visual editor in WP 4.3. Using [*]
was nice and short, but it’s not a valid character for shortcodes anymore. Please use [note]
instead.
[note] Your comment here [/note]