How to filter $content in shortcode function

I would like to filter the $content in my shortcode function so that all I get is the shortcode. I am trying to nest one shortcode inside another dynamically.

Here is my code

function add_slider ($atts, $content='') {

    $atts = shortcode_atts(array (
        'align' => 'center',
        'width' => '50%',
        'height' => 'auto'
    ), $atts);

  /*  foreach($videos as $video) :
             $return.='<li><a href="'.get_permalink().'">'.the_title("","",false).'</a></li>';
  if( has_shortcode( $content, 'video' ) ) {
            $content = do_shortcode($content);
       return '<ul class="bxslider">' . $content . ' </ul>';

else {
    return '<ul class="bxslider"> <li> No Videos Found In Slider </li> </ul>';
add_shortcode('slider','add_slider' );

Read more here: How to filter $content in shortcode function

Leave a Reply

Your email address will not be published. Required fields are marked *