Skip to content

Instantly share code, notes, and snippets.

@ginocremer
Last active December 29, 2015 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ginocremer/bbf2d4433a22d71b6f6e to your computer and use it in GitHub Desktop.
Save ginocremer/bbf2d4433a22d71b6f6e to your computer and use it in GitHub Desktop.
Dieses Snippet erstellt wieder einen Shortcode, den Sie innerhalb des Inhalts nutzen können: [doc dokument="PFAD ZU IHRER DATEI" width="800" height="600"]
/* GOOGLE DOCUMENT VIEWER */
function doc_viewer($atts, $content = null) {
extract(
shortcode_atts(
array(
"dokument" => 'http://',
"class" => '',
'width' => '700',
'height' => '400'
),
$atts)
);
return '<iframe width="'.$width.'" height="'.$height.'" src="http://docs.google.com/viewer?url='.$dokument.'&embedded=true" class="'.$class.' googleviewer"></iframe>';
}
add_shortcode("doc", "doc_viewer");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment