Skip to content

Instantly share code, notes, and snippets.

@cogdog
Created December 11, 2014 21:11
Show Gist options
  • Save cogdog/35370800a2a6b5b65ee9 to your computer and use it in GitHub Desktop.
Save cogdog/35370800a2a6b5b65ee9 to your computer and use it in GitHub Desktop.
Add options to gdrive shortcode
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