Opened 12 years ago
Closed 10 years ago
#26978 closed enhancement (wontfix)
In the admin area, the WP menu to the left links to index.php for the dashboard
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.8 |
| Component: | Administration | Keywords: | has-patch dev-feedback |
| Focuses: | ui | Cc: |
Description
It goes <a href="index.php" …. Could we make it prettier and use <a href="./" instead?
Attachments (1)
Change History (9)
#2
in reply to:
↑ 1
@
12 years ago
Replying to nacin:
The entire admin menu uses just relative URLs, not just index.php. Why does this matter?
It's prettier and more consistent:
- from the front-end, you see the url you're going to as example.com/wp-admin/
- from the back-end, you see the url you're going to as example.com/wp-admin/index.php
Changing that from index.php to ./ in the menu code would make the two show as example.com/wp-admin/.
I'll supply the patch for you to see if you're interested (I'm resorting to js in the meanwhile.) Else, just close as wontfix.
#3
@
12 years ago
Sorry, I had read this as you wanting it to be "./index.php", versus "./". I've never seen "./" used to be honest. admin_url( '/ ) could be used instead, I gather.
#5
@
12 years ago
+1
This has been an annoyance, but small, for a too long time now. It was my first little disappointment with WordPress, as "Why do I see this 'index.php' in the admin internal links?".
Never ever link to index.php explicitly, partly because it looks like duplicate content (and other reasons).
./ is the correct relative URL to the index of the current directory.
#6
@
12 years ago
Alternative means to do this using a drop-in plugin in the meanwhile:
add_filter('parent_file', function($parent) {
ob_start(function($buffer) {
$buffer = str_replace(array(
"href='index.php'", 'href="index.php"'
), array(
"href='./'", 'href="./"'
), $buffer);
return $buffer;
});
return $parent;
});
add_action('adminmenu', function() {
ob_end_flush();
});
#8
@
10 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
index.php appears all over the logic for the admin menus - not just the href, the relative url is what is hooked to add submenus. Removing it would actually confuse things. I see this change as being too trivial, sorry.
The entire admin menu uses just relative URLs, not just index.php. Why does this matter?