In Wordpress MU when you have multiple blogs and often want to go the same page of all the blogs, we either need to edit the URL or switch blog. I just thought of writing a simple hack to switch blogs to the same page. For example you are on the plugins page of the main blog and you want to go to the same plugins page of another blog, how do you go?
- Edit the URL with the blog name
- Go to blogs link and then backend and then the page you want to go.
Are there any other way, I don’t know, let me know how do you do that?
My hack
I just created a simple hack which adds up links on top of every admin page
Just click on the link, you will be taken to the same page of that particular blog
The Code
// You can add this code to the functions.php of your theme or create a small hack plugin
function kish_global_link() {
$page=$_SERVER['PHP_SELF'];
// getting the page with the query string if any of the current page
$page.=strlen($_SERVER['QUERY_STRING']) ? "?".$_SERVER['QUERY_STRING']:"";
global $blog_id;
$blogs=kish_mu_get_blogs();
echo "<div align="center" style="font-size:16px;font-weight:bold">";
//loop through all the blogs, the current blog will be escaped
foreach($blogs as $blog): ?>
<?php echo "<a>siteurl.$page."\">".$blog_details->blogname."</a> | "; ?>
<?php endforeach;
echo "</div>";
}
// add the action admin notices
add_action('admin_notices', 'kish_global_link', 1);
You can add this code you your theme functions.php

