#38655 closed defect (bug) (fixed)
Correct Post Template not displaying when selecting Quick Edit
Reported by: | ahortin | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Posts, Post Types | Keywords: | has-patch commit |
Focuses: | template | Cc: |
Description
It was just announced that WP 4.7 will now support Post Type Templates.
I've just tested this out by using Template Post Type
in the template header.
One thing I noticed is that when you select Quick Edit on the Posts list page, it's not displaying the correct template name.
I've edited my Post so that it now uses a 'Left Sidebar' template as can be seen here - https://cl.ly/1p0f1E1f1U10
When I select the Quick Edit option on the Posts page, the Template dropdown field is saying that it's using the Default Template, rather than my new 'Left Sidebar' template.
Attachments (3)
Change History (16)
#1
@
8 years ago
- Keywords has-patch needs-testing added
- Milestone changed from Awaiting Review to 4.7
#2
@
8 years ago
D'oh! Started working on this without realizing that you've already come up with the same solution :-)
#3
@
8 years ago
@dd32 Just tested these changes and they work. Thanks. And yep, also noticed that other Posts will show blank until they're actually saved again, at which time they'll then show 'Default Template' in the dropdown (if the template wasn't changed)
#4
@
8 years ago
- Keywords needs-testing removed
Nice work @dd32. I was going to patch this today but you beat me to it!
I've tested this as well and can also confirm it works as expected now!
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
#8
@
8 years ago
- Keywords commit removed
One thing I've noticed is that with this patch, and I don't think it's specific to this implementation, is that when a post doesn't have a template selected (posts OR pages) then the Template dropdown is set to blank, instead of the expected
default
.
Apparently this hasn't been the case in 4.6, so this needs to be fixed as well.
#9
@
8 years ago
38655.3.diff changes get_inline_data()
to fix the empty dropdown in Quick Edit.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#11
@
8 years ago
- Keywords commit added
LGTM
Confirmed:
- default shows in template dropdown
- templates display in quick edit
#13
@
8 years ago
FYI; changed the patch a bit.
- I removed the
selected()
case as it wasn't actually used and didn't appear to make a difference to the outcome - I added brackets around the logic in
get_inline_data()
as it was causing the template tags not to be output as they were being considered part of the expression or the else branch, which resulted in thediv
element not being printed.
38655.diff makes the dropdown operate as expected, 38655.2.diff also changes the inline edit template so that it doesn't look like
WP_Post
is an actual post (hint: It's not).One thing I've noticed is that with this patch, and I don't think it's specific to this implementation, is that when a post doesn't have a template selected (posts OR pages) then the Template dropdown is set to blank, instead of the expected
default
.Note for others; original ticket: #18375