IMO you need to create individual shortcodes for UL, OL and LI to make it sample.
Shortcode for UL.
function shortcode_ul( $atts , $content = null )
{
return '<ul>' . do_shortcode( $content ) .'</ul>';
}
add_shortcode( 'ul', 'shortcode_ul' );
Shortcode for LI
function shortcode_li( $atts , $content = null )
{
return '<li>' . do_shortcode( $content ) .'</li>';
}
add_shortcode( 'li', 'shortcode_li' );
Use
[ul] [li]Unordered[/li] [/ul]
It should output
<ul><li>Unordered</li></ul>
Note: Add attributes as per requirement. E.g for CSS class <li>
use attribute class
. It’ll be more flexible and extendable.