Skip to content

Instantly share code, notes, and snippets.

@JPry
Forked from norcross/admin_htaccess.txt
Created November 7, 2011 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JPry/1346174 to your computer and use it in GitHub Desktop.
Save JPry/1346174 to your computer and use it in GitHub Desktop.
WCPhilly Admin
# custom login link
RewriteRule ^login$ http://localhost/whitelabel/wp-login.php [NC,L]
<?php
/*
Plugin Name: WordCamp Philly 2011 Admin
Plugin URI: http://localhost/whitelabel
Description: Some swanky stuff to make your admin look GOOD
Author: Andrew Norcross
Version: 0.1
Requires at least: 3.0
Author URI: http://andrewnorcross.com
*/
/* Copyright 2011 Andrew Norcross
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; version 2 of the License (GPL v2) only.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// custom CSS for admin logo and layout
function rkv_custom_stylez() {
echo '<link rel="shortcut icon" type="image/png" href="' . plugins_url( 'img/favicon.png', __FILE__) . '" />';
echo '<link rel="stylesheet" href="' . plugins_url( 'css/rkv_admin_style.css', __FILE__) . '" type="text/css" media="screen" />';
}
// add_action('login_head', 'rkv_custom_stylez');
// add_action('admin_head', 'rkv_custom_stylez');
// add admin logo link swap
function rkv_login_title($message) {
return get_bloginfo('description');
}
function rkv_login_url($message) {
return get_bloginfo('url');
}
// add_filter('login_headerurl', 'rkv_login_url');
// add_filter('login_headertitle', 'rkv_login_title');
// re-order admin panel
function rkv_reorder_menu( $__return_true) {
return array(
'index.php', // this represents the dashboard link
'edit.php?post_type=page', // this is the default page menu
'edit.php', // this is the default POST admin menu
'upload.php',
);
}
// add_filter('custom_menu_order', 'rkv_reorder_menu');
// add_filter('menu_order', 'rkv_reorder_menu');
// change main post labels
function rkv_main_post_menu_labels() {
global $menu;
global $submenu;
$menu[5][0] = 'Products';
$submenu['edit.php'][5][0] = 'Products';
$submenu['edit.php'][10][0] = 'Add Product';
$submenu['edit.php'][15][0] = 'Product Types';
$submenu['edit.php'][16][0] = 'Product Tags';
echo '';
}
// add_action( 'admin_menu', 'rkv_main_post_menu_labels' );
// Change post to product labels
function rkv_detail_post_labels() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = 'Products';
$labels->singular_name = 'Product';
$labels->add_new = 'Add Product';
$labels->add_new_item = 'Add Product';
$labels->edit_item = 'Edit Products';
$labels->new_item = 'Product';
$labels->view_item = 'View Product';
$labels->search_items = 'Search Products';
$labels->not_found = 'No Products found';
$labels->not_found_in_trash = 'No Products found in Trash';
}
// add_action( 'init', 'rkv_detail_post_labels' );
// change category labels
function rkv_change_category_labels() {
global $wp_taxonomies;
$labels = &$wp_taxonomies['category']->labels;
$labels->name = 'Product Types';
$labels->singular_name = 'Product Type';
$labels->add_new_item = 'Add New Product Type';
$labels->edit_item = 'Edit Product Type';
$labels->search_items = 'Search Product Types';
$labels->update_item = 'Update Product Type';
$labels->all_items = 'All Product Types';
}
// add_action( 'init', 'rkv_change_category_labels' );
// change tag labels
function rkv_change_tag_labels() {
global $wp_taxonomies;
$labels = &$wp_taxonomies['post_tag']->labels;
$labels->name = 'Product Tags';
$labels->singular_name = 'Product Tag';
$labels->add_new_item = 'Add New Product Tag';
$labels->edit_item = 'Edit Product Tag';
$labels->search_items = 'Search Product Tags';
$labels->update_item = 'Update Product Tag';
$labels->all_items = 'All Product Tags';
}
// add_action( 'init', 'rkv_change_tag_labels' );
// remove dashboard widgets
function rkv_dashboard_cleanup() {
// remove meta boxes
remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
// add call to include two custom ones
wp_add_dashboard_widget('rkv_help_text', 'Help and Support Links', 'rkv_help_links'); // add a new custom widget for help and support
wp_add_dashboard_widget('rkv_help_vids', 'Help and Support Videos', 'rkv_help_videos'); // add a new custom widget for help and support
}
// add_action('wp_dashboard_setup', 'rkv_dashboard_cleanup');
// add custom help links and video
function rkv_help_links() { ?>
<p>Take a look at these links</p>
<ul>
<li><a href="http://awesome.com">Support Link #1</a></li>
<li><a href="http://awesome.com">Support Link #2</a></li>
<li><a href="http://awesome.com">Support Link #1</a></li>
</ul>
<?php }
function rkv_help_videos() { ?>
<div style="width:420px; margin:0 auto; display:block;"><iframe width="420" height="243" src="http://www.youtube.com/embed/9IbGVWDO0YU?rel=0&amp;hd=1" frameborder="0" allowfullscreen></iframe></div>
<?php }
// change post title box text
function rkv_change_post_text( $title ) {
$screen = get_current_screen();
if ( 'post' == $screen->post_type ) {
$title = 'Enter Product Title';
}
return $title;
}
// add_filter('enter_title_here', 'rkv_change_post_text');
// remove items from the admin panel
function rkv_remove_extras() {
remove_menu_page('link-manager.php');
remove_menu_page('edit-comments.php');
remove_menu_page('theme-editor.php');
}
// add_action( 'admin_menu', 'rkv_remove_extras' );
// remove the columns I don't need
function rkv_edit_post_columns($defaults) {
unset($defaults['comments']);
unset($defaults['author']);
unset($defaults['date']);
return $defaults;
}
// add_filter('manage_post_posts_columns', 'rkv_edit_post_columns'); // will affect all non-hierarchical post types
// re-title my columns
function rkv_mod_columns($new_columns) {
$new_columns['title'] = _x('Product Name', 'column name');
$new_columns['categories'] = _x('Product Type', 'column name');
$new_columns['tags'] = _x('Product Tags', 'column name');
return $new_columns;
}
// add_filter('manage_posts_columns', 'rkv_mod_columns');
// Make these columns sortable
# This code doesn't do anything. You've told WordPress they can be clicked to be sorted, but WordPress
# doesn't know how to sort them. See http://scribu.net/wordpress/custom-sortable-columns.html.
function rkv_sortable_columns($columns) {
$columns['categories'] = 'rkv_categories';
return $columns;
}
// add_filter( 'manage_edit-post_sortable_columns', 'rkv_sortable_columns' );
// determine sort from above
function rkv_column_orderby( $vars ) {
if ( isset( $vars['orderby'] ) && 'rkv_categories' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'orderby' => 'name'
) );
}
return $vars;
}
// add_filter( 'request', 'rkv_column_orderby' );
// clean up the admin bar to match
function rkv_admin_bar_cleanup() {
global $wp_admin_bar;
// we can remove an entire menu item
$wp_admin_bar->remove_menu('comments');
// or we can remove just a submenu item.
$wp_admin_bar->remove_menu('new-link', 'new-content');
// we can add also submenu item too
$wp_admin_bar->add_menu( array(
'parent' => 'dashboard',
'id' => 'new_awesome',
'title' => __('Awesome Help Links'),
'href' => 'http://awesome.com'
) );
}
// add_action( 'wp_before_admin_bar_render', 'rkv_admin_bar_cleanup' );
@charset "utf-8";
/* CSS Document */
html, body {
height: 100%;
}
html {
background-color: #fff;
}
body.login {
background:#1D2736;
padding-top:0;
}
/* Set Gradient */
.widget .widget-top,
.postbox h3,
.stuffbox h3,
#widgets-right .sidebar-name,
#widgets-left .sidebar-name,
#widget-list .widget-top {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#435366', endColorstr='#1D2736'); /* for IE */
background: -webkit-gradient(linear, center bottom, center top, from(#435366), to(#1D2736)); /* for webkit browsers */
background: -moz-linear-gradient(center bottom, #435366, #1D2736) repeat scroll 0 0 transparent;
}
/* Standardize Fonts */
#wphead h1,
.tablenav,
table.wp-list-table,
.widefat th,
#poststuff h3,
.metabox-holder h3,
#menu-management .nav-tab,
#thesis_options,
div.sidebar-name h3,
#dashboard_right_now td.b {
font-family: Arial,"Bitstream Vera Sans",Helvetica,Verdana,sans-serif;
}
/* Login Screen */
#login {
margin:0 auto;
padding-top:30px;
}
#login h1 {
margin-top:60px;
padding:20px 0 0;
}
#login h1 a {
background:url(../img/login_logo.png) no-repeat top center !important;
height:113px;
width:300px;
margin:0 auto;
}
#login form {
box-shadow: 0 4px 18px #1D2736;
-moz-box-shadow: 0 4px 18px #1D2736;
}
.login #nav a, .login #backtoblog a {
color: #fff !important;
text-shadow:none;
}
/* Dashboard */
#wphead #header-logo {
background:url(../img/favicon.png) no-repeat scroll center center transparent;
height:16px;
width:16px;
}
#wphead {
border-bottom: 1px solid #435366;
}
#wphead h1 a {
color:#435366;
}
#user_info {
color: #435366;
}
#user_info a:link, #user_info a:visited {
color: #435366;
}
ul#adminmenu li.wp-has-current-submenu .wp-menu-arrow,
ul#adminmenu li.wp-has-current-submenu a.menu-top,
.folded ul#adminmenu li.wp-has-current-submenu .wp-menu-arrow,
.folded ul#adminmenu li.wp-has-current-submenu {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#435366', endColorstr='#1D2736'); /* for IE */
background: -webkit-gradient(linear, center bottom, center top, from(#435366), to(#1D2736)); /* for webkit browsers */
background: -moz-linear-gradient(center bottom, #435366, #1D2736) repeat scroll 0 0 transparent;
}
#adminmenu li.wp-has-current-submenu a.menu-top {
border-bottom-color: #435366;
border-top-color: #1D2736;
}
.widget .widget-top, .postbox h3, .stuffbox h3 {
color:#fff;
text-shadow: 0 1px 0 #000000;
font-family: Arial,"Bitstream Vera Sans",Helvetica,Verdana,sans-serif;
}
.ui-sortable .postbox h3 {
color:#fff;
}
.widget .widget-top,
.sidebar-name:hover h3,
.postbox h3:hover,
.ui-sortable .postbox h3:hover {
color: #f9f2f7;
}
#adminmenu a {
color:#435366;
}
#adminmenu .wp-submenu a {
color:#000000;
}
.widget, .postbox, .stuffbox {
border-style: solid;
border-color:#435366;
}
#side-sortables #global_select input{
margin-right:5px;
}
#widgets-right .sidebar-name {
border-color:#435366;
color: #FFFFFF;
text-shadow: 0 -1px 0 #3F3F3F;
}
#widgets-left .sidebar-name {
border-color:#435366;
color: #FFFFFF;
text-shadow: 0 -1px 0 #3F3F3F;
}
#available-widgets .widget-holder,
div.widgets-sortables, #widgets-left .inactive {
background-color: #ffffff;
border-color: #435366;
}
#available-widgets .widget-description {
background-color: #ffffff;
color:#000000;
}
#normal-sortables #offerings_select table.form-table ul li{
display:inline;
margin-right:15px;
}
#normal-sortables #offerings_select table.form-table ul li label{
margin-left:5px;
}
#footer {
}
/* Full Screen setup */
#wp-fullscreen-body #fullscreen-topbar {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#435366', endColorstr='#1D2736');
background: -webkit-gradient(linear, center bottom, center top, from(#435366), to(#1D2736));
background: -moz-linear-gradient(center bottom, #435366, #1D2736) repeat scroll 0 0 transparent;
}
#wp-fullscreen-body #fullscreen-topbar #wp-fullscreen-close a {
color:#fff;
}
/* Remove what we don't want */
/*
ul#adminmenu li#menu-links,
ul#adminmenu li#menu-comments {
display:none;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment