Skip to content

Instantly share code, notes, and snippets.

@leemason
Created August 22, 2014 19:13
Show Gist options
  • Save leemason/13a757335b9e499970fb to your computer and use it in GitHub Desktop.
Save leemason/13a757335b9e499970fb to your computer and use it in GitHub Desktop.
"fake" fileysstem direct mode.
<?php
/*
Plugin Name: Fluent Demo - force direct
Plugin URI: #
Description: Forces wp to think it has direct filesystem access during ajax and admin requests.
Author: No Half Pixels Ltd
Version: 1.0.0
Author URI: http://nohalfpixels.com
*/
add_filter( 'filesystem_method', function($method){
if(is_admin() || is_defined('DOING_AJAX') && DOING_AJAX){
return 'direct';
}else{
return $method;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment