How to handle a shortcode function directly?

Shortcode handler function receives two arguments array $attr and string $content. So to pass attributes to shortcode handler function, just pass it as array:

$image = route_thumb_function( array( 'id' => $post_id ) );

Leave a Comment