public

Code showing how easy it might be to handle symlinking a plugin in in WordPress 3.6 if trac ticket #xxxx is accepted

  • Download Gist
symlinkable-plugin-base.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<?php
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' ) );
 
}
 
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.