/** * Create a new set of options * * @param string $key Option name * @param string $file Reference to main plugin file * @param array $defaults An associative array of default values ( optional ) */ public function __construct($key, $file, $defaults = '') { $this->key = $key; $this->defaults = $defaults; scbUtil::add_activation_hook($file, array($this, '_update_reset')); scbUtil::add_uninstall_hook($file, array($this, 'delete')); }
/** * Create a new set of options * * @param string $key Option name * @param string $file Reference to main plugin file * @param array $defaults An associative array of default values (optional) */ public function __construct($key, $file, $defaults = array()) { $this->key = $key; $this->defaults = $defaults; if ($file) { scbUtil::add_activation_hook($file, array($this, '_activation')); scbUtil::add_uninstall_hook($file, array($this, 'delete')); } }
function __construct($name, $file, $columns, $upgrade_method = 'dbDelta') { global $wpdb; $this->name = $wpdb->{$name} = $wpdb->prefix . $name; $this->columns = $columns; $this->upgrade_method = $upgrade_method; scbUtil::add_activation_hook($file, array($this, 'install')); scbUtil::add_uninstall_hook($file, array($this, 'uninstall')); }
/** * Sets up table. * * @param string $name Table name. * @param string $file Reference to main plugin file. * @param string $columns The SQL columns for the CREATE TABLE statement. * @param array $upgrade_method (optional) * * @return void */ public function __construct($name, $file, $columns, $upgrade_method = 'dbDelta') { $this->name = $name; $this->columns = $columns; $this->upgrade_method = $upgrade_method; scb_register_table($name); if ($file) { scbUtil::add_activation_hook($file, array($this, 'install')); scbUtil::add_uninstall_hook($file, array($this, 'uninstall')); } }
/** * Create a new set of options * * @param string $key Option name * @param string $file Reference to main plugin file * @param array $defaults An associative array of default values (optional) */ public function __construct($key, $file, $defaults = '') { $this->key = $key; $this->defaults = $defaults; $this->data = get_option($this->key); if (is_array($this->defaults)) { $this->data = (array) $this->data; register_activation_hook($file, array($this, '_update_reset')); } scbUtil::add_uninstall_hook($file, array($this, 'delete')); }
/** * Constructor. * * @param string|bool $file (optional) * @param object $options (optional) A scbOptions object. * * @return void */ public function __construct($file = false, $options = null) { parent::__construct($file, $options); scbUtil::add_uninstall_hook($this->file, array($this, 'uninstall')); }
function __construct( $file, $options = null ) { parent::__construct( $file, $options ); // too late scbUtil::add_uninstall_hook( $this->file, array( $this, 'uninstall' ) ); }