All pastes #1458837 Raw Edit

Child Plugin

public php v1 · immutable
#1458837 ·published 2009-06-13 11:25 UTC
rendered paste body
<?php/*Plugin Name: ChildVersion: 1.0*/child_class::preinit();abstract class child_class{	// This is where the activation hooks and the main init hook are set up	// parent may or may not be loaded	static function preinit() {		register_activation_hook(__FILE__, array(__CLASS__, 'activate'));		add_action('parent_plugin_loaded', array(__CLASS__, 'init'));	}	// The actual work starts here	// parent is loaded	static function init() {		new parent_tool(__FILE__, 'foo');	}	// parent is loaded	static function activate() {		self::init();	// initialize again because the 'parent_plugin_loaded' hook was already fired		parent_do_activation(__FILE__);		// some parent tools might also need the activation hook	}}