It is possible to remove the Dashboard?
-
It is possible to remove the from the admin interface Dashboard? And how is it done?
Thanx
-
EDITED* Scratch that.. thanks Viper! =)
spencerp
spencerp: they said the dashboard, not the whole admin area. The dashboard just shows you WordPress news and such.
typezero: add this to the very top of
/wp-admin/index.php:header('Location: post.php');
exit();Then open up
/wp-admin/menu.phpand add//in front of this line:$menu[0] = array(__('Dashboard'), 'read', 'index.php');Oh! Yeah.. [slaps self].. I just woke up a few minutes ago lol! Takes the thinking ability of the brain a little while to kick in.. =P
Thanks Viper for pointing that out to me.. 😉
spencerp
I’m not usually up at 9:30am lmao, I’m usually just going to bed at this time.. my sleep time is all screwed up now ..haha. =P
I managed to replace the dashboard with my customised version by tweaking the code of the ‘dasher’ plugin.
// this intercepts the request for the real Dashboard
if(strstr($_SERVER['PHP_SELF'], 'wp-admin/index.php') !== FALSE) {
$is_admin = TRUE;
if(!isset($_GET['page'])) {
add_action('admin_head', 'dbmod_user_dash_load', 99999);
}
}
// This function contains the replacement Dashboard. Some of the globals aren't needed anymore, but I'm not sure which ones...
function dbmod_user_dash_load() {
global $confidential_cat, $baseURL, $dasher_options, $wpdb, $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity, $user_nickname, $menu, $submenu, $admin_page_hooks, $parent_file, $title, $plugin_page, $submenu_file, $menu_hook, $pagenow, $wp_version;
get_currentuserinfo(); if ($user_level < 8) {
require_once(ABSPATH . '/wp-admin/admin.php');
$title = __('Dashboard');
require_once(ABSPATH . '/wp-admin/admin-header.php');
require_once (ABSPATH . WPINC . '/rss-functions.php');
echo '
</head>
<body>
<div id="wphead">
<h1>' . wptexturize(get_settings(('blogname'))) . ' <span>(<a href="' . get_settings('home') . '/">' . __('View site') . " �</a>)</span></h1>n</div>n";
if ($wp_version{0} != '1') { // suppress the user info thing for WP 1.x
echo "<div id='user_info'>";
printf(__('Howdy, <strong>%s</strong>.'), $user_identity);
echo ' [<a href="' . get_settings('siteurl') . '/wp-login.php?action=logout" title="' . __('Log out of this account') . '">' . __('Sign Out') . '</a>, <a href="profile.php">' . __('My Account') . "</a>] </div>n";
}
require(ABSPATH . '/wp-admin/menu-header.php');
//Here is the new content of the dashboard
echo '<div class="wrap">' . "n<h2>" . __('Dashboard') . "</h2>"
?>
<h3>YOUR TITLE</h3>
blah blah blah
<?php
require_once(ABSPATH . '/wp-admin/admin-footer.php');
die(); // critical - stops execution so the real Dashboard doesn't happen
}
}
You can add whatever you want in the middle; you can change the h2 dashboard title also, or make calls to queries.
Of course I suggest you using the wp divs to mimic the appearence of the real dashboard; to see them, just look at the code of admin pages.
This worked like magic for me.
Cheers,
DavideGreat!! Thanks for the replies!!!!
The topic ‘It is possible to remove the Dashboard?’ is closed to new replies.