Created
December 7, 2012 05:17
-
-
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
This file contains 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 | |
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