protected function __construct() { self::$instance = $this; $this->base = dirname(dirname(__FILE__)); add_action('init', array($this, 'init')); add_action('admin_init', array($this, 'admin_init')); }
public function plugins_loaded() { if (!$this->passes()) { remove_action('init', array(Admin_Color_Schemer_Plugin::get_instance(), 'init')); if (current_user_can('activate_plugins')) { add_action('admin_init', array($this, 'admin_init')); add_action('admin_notices', array($this, 'admin_notices')); } } }
public function __construct($attr = NULL) { // extend accessors $admin_schemer = Admin_Color_Schemer_Plugin::get_instance(); $this->accessors = array_merge($this->accessors, array_keys($admin_schemer->get_colors())); // set slug $this->slug = 'admin_color_schemer_' . $this->id; if (is_array($attr)) { foreach ($this->accessors as $thing) { if (isset($attr[$thing]) && !empty($attr[$thing])) { $this->{$thing} = $attr[$thing]; } } } else { // set defaults // @todo: make this really set defaults for the items that must have a color - what are those? $this->name = __('Custom', 'admin-color-schemer'); } }
Version: 1.0 Author: WordPress Core Team Author URI: http://wordpress.org/ Text Domain: admin-color-schemer Domain Path: /languages */ /* Copyright 2013 Helen Hou-SandÃ, Mark Jaquith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ defined('WPINC') or die; // Pull in the plugin classes and initialize include dirname(__FILE__) . '/classes/color-scheme.php'; include dirname(__FILE__) . '/classes/plugin.php'; Admin_Color_Schemer_Plugin::get_instance(); // Pull in the version checker and initialize include dirname(__FILE__) . '/classes/version-check.php'; Admin_Color_Schemer_Version_Check::get_instance();