Created
August 22, 2014 19:13
-
-
Save leemason/13a757335b9e499970fb to your computer and use it in GitHub Desktop.
"fake" fileysstem direct mode.
This file contains hidden or 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: 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