Skip to content

Instantly share code, notes, and snippets.

@vangog
Created July 16, 2013 05:34
Show Gist options
  • Save vangog/6006035 to your computer and use it in GitHub Desktop.
Save vangog/6006035 to your computer and use it in GitHub Desktop.
<?php
/*
------------------------------------------------------------------
*/
public function activateCsp()
{
if (function_exists('is_multisite') && is_multisite()) {
$blog_id = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
foreach ($blog_id as $id) {
if (switch_to_blog($id)) {
array('installerCsp', 'delete');
}
}
return;
} else {
array('installerCsp', 'delete');
}
}
public function init()
{
//$startTime = microtime(true);
langCsp::init();
reqCsp::init();
$this->_extractTables();
$this->_extractModules();
$this->_initModules();
$this->_execModules();
add_action('init', array($this, 'addScripts'));
add_action('init', array($this, 'addStyles'));
register_activation_hook(CSP_DIR. DS. CSP_MAIN_FILE, $this->activateCsp(); //See classes/install.php file
register_deactivation_hook(CSP_DIR. DS. CSP_MAIN_FILE, array('installerCsp', 'delete'));
add_action('admin_notices', array('errorsCsp', 'displayOnAdmin'));
//$operationTime = microtime(true) - $startTime;
}
/*
------------------------------------------------------------------
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment