Skip to content

Instantly share code, notes, and snippets.

@collegeman
Created October 6, 2012 15:35
Show Gist options
  • Save collegeman/3845242 to your computer and use it in GitHub Desktop.
Save collegeman/3845242 to your computer and use it in GitHub Desktop.
This file allows you to configure SharePress once for an entire WordPress MU installation.
<?php
/**
* Working with WordPress MU or Multi-Network? Configure the settings below,
* and then drop this file into wp-content/mu-plugins. These settings can
* also be configured on a theme-by-theme basis by copying them into each
* theme's functions.php file. Enjoy!
*/
@define('SHAREPRESS_MU_LICENSE_KEY', '');
@define('SHAREPRESS_MU_APP_ID', '');
@define('SHAREPRESS_MU_APP_SECRET', '');
///////////////////////////////////////////////////////////////////////////////
// You should not need to edit below this line
///////////////////////////////////////////////////////////////////////////////
@define('SHAREPRESS_MU', true);
class SharePressMu {
private static $plugin;
static function load() {
$class = __CLASS__;
return ( self::$plugin ? self::$plugin : ( self::$plugin = new $class() ) );
}
private function __construct() {
add_action('init', array($this, 'init'));
}
function init() {
add_filter('pre_option_sharepress_api_key', array($this, 'api_key'));
add_filter('pre_option_sharepress_app_secret', array($this, 'app_secret'));
}
function api_key($value) {
return SHAREPRESS_MU_APP_ID;
}
function app_secret($value) {
return SHAREPRESS_MU_APP_SECRET;
}
}
SharePressMu::load();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment