I'm creating my own shortcode, and within that function I'm calling a different shortcode through do_shortcode. I'm trying to call a substr after the do_shortcode call, but I'm not getting expected results. It seems like substr is being called before do_shortcode can resolve. Example:
function my_shortcode_function() {
$string = "";
$string = do_shortcode('[different_shortcode]');
$string = substr($string, 4);
return $string;
}
add_shortcode( 'my_shortcode', 'my_shortcode_function' );
This is returning "ferent_shortcode]" and not returning a string that should be resolved through the do_shortcode.
What am I doing wrong?