Created
May 6, 2013 13:20
-
-
Save ahmedghazi/5525082 to your computer and use it in GitHub Desktop.
pdf embed shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pdf_function($attr, $url) { | |
extract(shortcode_atts(array( | |
'width' => '640', | |
'height' => '480' | |
), $attr)); | |
return '<iframe src="http://docs.google.com/viewer?url=' . $url . '&embedded=true" style="width:' .$width. '; height:' .$height. ';">Your browser does not support iframes</iframe>'; | |
} | |
add_shortcode('pdf', 'pdf_function'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment