<?php /* Plugin Name: Castlegate IT WP Tweak Tool Plugin URI: http://github.com/castlegateit/cgit-wp-tweak-tool Description: Tweaks various parts of the WordPress dashboard. Version: 1.1 Author: Castlegate IT Author URI: http://www.castlegateit.co.uk/ License: MIT */ use Cgit\TweakTool; require __DIR__ . '/src/autoload.php'; require __DIR__ . '/functions.php'; /** * Load plugin */ add_action('init', function () { $tool = TweakTool::getInstance(); $tool->update(); });
/** * Is current user an administrator? * * The Tweak Tool provides a method to check whether the current user in * administrator. If that is not available, fall back to the default WP * function. * * @return boolean */ protected static function isAdmin() { if (class_exists('\\Cgit\\TweakTool')) { $tool = \Cgit\TweakTool::getInstance(); return $tool->isAdmin(); } return current_user_can('update_core'); }