Created
May 9, 2013 09:37
-
-
Save ShaneGowland/5546561 to your computer and use it in GitHub Desktop.
Create a screenshot of any website
This file contains 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 wp_snap($atts, $content = NULL) { | |
extract(shortcode_atts(array( | |
"snap" => 'http://s.wordpress.com/mshots/v1/', | |
"url" => 'http://wpdaily.co/', | |
"alt" => 'WPDaily', | |
"w" => '400', // width | |
"h" => '300' // height | |
), $atts)); | |
$img = '<img alt="' . $alt . '" src="' . $snap . '' . urlencode($url) . '?w=' . $w . '&h=' . $h . '" />'; | |
return $img; | |
} | |
add_shortcode("snap", "wp_snap"); | |
// Use [snap url="http://wpdaily.co/" alt="WPDaily Website" w="400" h="300"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment