Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Code showing how easy it might be to handle symlinking a plugin in in WordPress 3.6 if trac ticket #xxxx is accepted
class Symlink_Fixer {
var $plugin_file;
var $plugin_id;
function __construct( $args = array() ) {
global $pagenow, $wp_plugin_file, $wp_plugin_slug;
$this->$plugin_file = $wp_plugin_file
$this->$plugin_id = $wp_plugin_slug;
if ( 'plugins.php' == $pagenow ) {
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
add_action( "activate_{$this->plugin_id}", array( $this, 'activate_plugin' ), 0 );
register_activation_hook( $this->plugin_id, array( $this, 'activate' ) );
} else {
register_deactivation_hook( $this->plugin_id, array( $this, 'deactivate' ) );
register_uninstall_hook( $this->plugin_id, array( parent::plugin_class, 'uninstall' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.