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: Grunt Sitemap Generator | |
* Plugin URI: http://www.github.com/lgladdy | |
* Description: Generate a JSON list of every page on a site so it can be used with grunt and uncss. Create a folder in /wp-content called mu-plugins, and drop this code into that folder, as grunt-sitemap.php | |
* Author: Liam Gladdy | |
* Author URI: http://gladdy.co.uk | |
* Version: 1.0 | |
*/ | |
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 | |
require_once('wp-load.php'); | |
is_user_logged_in() || auth_redirect(); | |
$upload_dir = wp_upload_dir(); | |
//Set your path below I am using /gravity_forms/ | |
$basedir = $upload_dir[ 'basedir' ] . '/gravity_forms/'; | |
$file = rtrim( $basedir, '/' ) . '/' . str_replace( '..', '', isset( $_GET[ 'file' ] ) ? $_GET[ 'file' ] : '' ); | |
if ( ! $basedir || ! is_file( $file ) ) { |