Created
July 16, 2013 05:34
-
-
Save vangog/6006035 to your computer and use it in GitHub Desktop.
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 | |
/* | |
------------------------------------------------------------------ | |
*/ | |
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