Skip to content

Instantly share code, notes, and snippets.

@entr
Created May 26, 2015 13:21
Show Gist options
  • Save entr/d50f484a515e3ac7921c to your computer and use it in GitHub Desktop.
Save entr/d50f484a515e3ac7921c to your computer and use it in GitHub Desktop.
A number of useful hooks to strip and clean up WordPress admin area.
<?php
/*
Plugin Name: WP Admin Snippets
Plugin URI: http://wptailor.com/
Description: A number of useful hooks to strip and clean up WordPress admin area.
Version: 0.0.1
Author: WPTailor
Author URI: http://wptailor.com/
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('ABSPATH') or exit;
/**
* Hide WP version in dashboard "At glance" widget.
*
* Bail if current user has sufficient privileges.
*/
function wpt_load_admin_css_overrides() {
if ( current_user_can( 'manage_options' ) )
return;
ob_start();
?>
#wp-version-message {
display: none;
}
<?php
wp_add_inline_style( 'wp-admin', ob_get_clean() );
}
add_action( 'admin_enqueue_scripts', 'wpt_load_admin_css_overrides', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment