Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
Created December 7, 2012 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeschinkel/4230972 to your computer and use it in GitHub Desktop.
Save mikeschinkel/4230972 to your computer and use it in GitHub Desktop.
Code showing how easy it might be to handle symlinking a plugin in in WordPress 3.6 if trac ticket #xxxx is accepted
<?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' ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment