Created
December 11, 2014 21:11
-
-
Save cogdog/35370800a2a6b5b65ee9 to your computer and use it in GitHub Desktop.
Add options to gdrive 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
unction gdrive_shortcode( $atts, $content = null ) { | |
// options for different kinds of embeds, default is folder view | |
extract( shortcode_atts( array( "what" => "folder"), $atts)); | |
switch ($what) { | |
case 'folder': | |
return '<iframe src="https://drive.google.com/embeddedfolderview?id=' . $content . '#list" frameborder="0" width="100%" height="500px" scrolling="auto"> </iframe>'; | |
break; | |
case 'somethingelse': | |
// something else | |
break; | |
case 'fritos': | |
// ai yi ai yi | |
break; | |
} | |
} | |
add_shortcode( 'gdrive', 'gdrive_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment