Skip to content

Instantly share code, notes, and snippets.

@woodwardtw
Created December 11, 2014 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woodwardtw/b90ff5b83d4d86e18cfe to your computer and use it in GitHub Desktop.
Save woodwardtw/b90ff5b83d4d86e18cfe to your computer and use it in GitHub Desktop.
wordpress plugin to allow Google Drive embeds via the URL ID
<?php
/**
* Plugin Name: Embed UR Google Drive Folder w the unique URL ID
* Plugin URI: http://bionicteaching.com
* Description: Allows an embed of the Google Drive Folder via the unique ID
* Version: .9
* Author: Tom Woodward
* Author URI: http://bionicteaching.com
* License: A "Slug" license name e.g. GPL2
*/
/* 2014 PLUGIN_AUTHOR_NAME (email : bionicteaching@gmail.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//[gdrive][/gdrive]
function gdrive_shortcode( $atts, $content = null ) {
return '<iframe src="https://drive.google.com/embeddedfolderview?id=' . $content . '#list" frameborder="0" width="100%" height="500px" scrolling="auto"> </iframe>';
}
add_shortcode( 'gdrive', 'gdrive_shortcode' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment