[WordPress]ショートコード#1

function sc_get_template($atts) {
    $param = shortcode_atts( array(
        'file' => '',
    ), $atts );
    $param['file'] = ltrim($param['file'],'/.');
    $file = TEMPLATEPATH . DIRECTORY_SEPARATOR . $param['file'];
    if(!file_exists($file))return '';
    ob_start();
    include($file);
    $contents = ob_get_contents();
    ob_end_clean();
    return $contents;
}
add_shortcode('get_template', 'sc_get_template');
[get_template file="module/_head.php"]