Opened 10 years ago
Closed 10 years ago
#34045 closed defect (bug) (fixed)
"Add New" button links to wrong location
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | 4.4 |
| Component: | Posts, Post Types | Keywords: | has-patch |
| Focuses: | administration | Cc: |
Description
When viewing wp-admin/post-new.php the "Add New" link in the h1 tag links to:
/wp-admin/post-new.php?post_type=page
Attachments (3)
Change History (14)
#1
@
10 years ago
This looks to be caused by the $post_new_file global getting overwritten by menu.php, as the URL in this link-button is influenced by whichever custom post type is positioned lastly in the admin menu.
#2
follow-up:
↓ 3
@
10 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.4
There shouldn't an Add New link there in the first place, because that's already what you're doing.
#3
in reply to:
↑ 2
@
10 years ago
Replying to helen:
There shouldn't an Add New link there in the first place, because that's already what you're doing.
I'd considered this. There are many inconsistencies across objects in regard to this link placement specifically:
- Media is similar to Posts/Pages
- Plugins alternates between "Add New" "Upload Plugin" and "Browse"
- Themes alternates between "Add New" "Upload Theme" and "Browse"
- Users has no "Add New" link when viewing the "Add New User" page
- Comments has no "Add New" link when editing a single comment
- Tools and Settings are not applicable IMO
We could toggle the "Add New" links in question to be "All" links to take the user back instead. Or we could remove them entirely, which would give us a clean slate if we want to do anything else here later.
#4
@
10 years ago
I think this is because $post_new_file is now set also on the post-new.php screen because defined in menu.php after [33723]
#5
@
10 years ago
- Owner set to norcross
- Status changed from new to assigned
@norcross is currently patching.
#6
@
10 years ago
- Keywords has-patch added; needs-patch removed
added patch to remove the button on post-new.php. confirmed working as expected on new posts and pages
#7
@
10 years ago
There was no "Add New" link there previously, and there shouldn't be one there, so the goal now is to remove it again.
30405-02.diff is the most immediately obvious way to do it - $post_new_file gets redefined in other files, so unsetting it in this case is a way to accomplish this, and possibly is the right thing to do. However, looking at 34041.01.patch does make me wonder if maybe we shouldn't be reusing a global variable like this and if it was intentional or not. @wonderboymusic - was there a reason you reused that variable name in [33723]?
Safari Inspector shot of UI & HTML