Created
December 11, 2014 19:46
-
-
Save woodwardtw/b90ff5b83d4d86e18cfe to your computer and use it in GitHub Desktop.
wordpress plugin to allow Google Drive embeds via the URL ID
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
<?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 : [email protected]) | |
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