Nested shortcodes, shortcodes in attributes

Important note
This article is rather a bad example and was published here because very many users wonder how to create nested shortcodes. I do not recommend to use approaches described in this article, unless it is really necessary. Besides, I would like to mention that the same behaviour is not guaranteed in all shortcodes.

Some plugin shortcodes can be nested. For example:

[box]
	Hello, [username]
[/box]

Nested shortcodes with the same tag names #

Shortcodes with the same nanes cannot be nested into each other. For example, the structure presented below will not work:

[box]
	[box] This will NOT work [/box]
[/box]

If you want to nest shortcodes with the same names anyway, then you should use underscore character (_) before the name of nested shortcode, e.g.:

[spoiler]
	[_spoiler] Content [/_spoiler]
	[_spoiler] Content [/_spoiler]
[/spoiler]

Use of shortcodes inside the attributes of other shortcodes #

Some plugin shortcodes allow to use other shortcodes in their attributes.

Just replace square brackets by curly brackets to use shortcodes inside attributes of the other shortcodes. Besides, you should replace "double quotes" of the nested shortcode attributes by 'single quotes'. Example:

[spoiler title="{user field='display_name'}"] Content [/spoiler]