Monday, October 1, 2012

Include external file shortcode

function show_file_func( $atts ) {
  extract( shortcode_atts( array(
    'file' => ''
  ), $atts ) );
  if ($file!='')
    return @file_get_contents($file);
}
add_shortcode( 'show_file', 'show_file_func' );

[show_file file="http://www.mysite.com/somefile.html"]

No comments:

Post a Comment