2 replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
source | link

Register a new shortcode handler depending on the attribute value:

function wrapper_shortcode_handler ( $atts, $content ) {

    if ( "apple" === $atts["snack"] )
        add_shortcode( "flavor", "healthy_callback" );

    if ( "donut" === $atts["snack"] )
        add_shortcode( "flavor", "fatty_callback" );

    return do_shortcode( $content );
}

See also http://wordpress.stackexchange.com/questions/74503/execute-shortcode-only-in-another-shortcodeExecute shortcode only in another shortcode

Register a new shortcode handler depending on the attribute value:

function wrapper_shortcode_handler ( $atts, $content ) {

    if ( "apple" === $atts["snack"] )
        add_shortcode( "flavor", "healthy_callback" );

    if ( "donut" === $atts["snack"] )
        add_shortcode( "flavor", "fatty_callback" );

    return do_shortcode( $content );
}

See also http://wordpress.stackexchange.com/questions/74503/execute-shortcode-only-in-another-shortcode

Register a new shortcode handler depending on the attribute value:

function wrapper_shortcode_handler ( $atts, $content ) {

    if ( "apple" === $atts["snack"] )
        add_shortcode( "flavor", "healthy_callback" );

    if ( "donut" === $atts["snack"] )
        add_shortcode( "flavor", "fatty_callback" );

    return do_shortcode( $content );
}

See also Execute shortcode only in another shortcode

1
source | link

Register a new shortcode handler depending on the attribute value:

function wrapper_shortcode_handler ( $atts, $content ) {

    if ( "apple" === $atts["snack"] )
        add_shortcode( "flavor", "healthy_callback" );

    if ( "donut" === $atts["snack"] )
        add_shortcode( "flavor", "fatty_callback" );

    return do_shortcode( $content );
}

See also http://wordpress.stackexchange.com/questions/74503/execute-shortcode-only-in-another-shortcode