Make WordPress Core

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: denis-de-bernardy's profile Denis-de-Bernardy 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)

26978.diff (2.3 KB) - added by Denis-de-Bernardy 12 years ago.

Download all attachments as: .zip

Change History (9)

#1 follow-up: @nacin
12 years ago

The entire admin menu uses just relative URLs, not just index.php. Why does this matter?

#2 in reply to: ↑ 1 @Denis-de-Bernardy
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.

Last edited 12 years ago by Denis-de-Bernardy (previous) (diff)

#3 @nacin
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.

#4 @Denis-de-Bernardy
12 years ago

  • Keywords has-patch dev-feedback added

Something like the patch I just attached.

#5 @knutsp
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 @Denis-de-Bernardy
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();
});

#7 @SergeyBiryukov
12 years ago

  • Version changed from trunk to 3.8

#8 @wonderboymusic
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.

Note: See TracTickets for help on using tickets.