Opened 9 years ago
Closed 9 years ago
#33616 closed enhancement (fixed)
Add 'insertIntoPost' and 'uploadedToThisPost' to post type labels
Reported by: | flixos90 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
I noticed that among the media strings in wp_enqueue_media()
, there are two strings which should be part of the post type labels which are provided/generated when registering a post type.
In particular, I'm talking about the strings for inserting media into a post/page(insertIntoPost
) as well as for showing media uploaded to a post/page (uploadedToThisPost
).
The wp_enqueue_media()
function already receives the featured image labels from the current post type object, so I think it would be consistent to add the above two strings to the post type object as well and receive them from there, and we could get rid of the check whether that post type is hierarchical. This furthermore ensures that developers don't need to use a filter any more if they want to change these labels.
When adding the labels to the post type object, I would change the names a bit though, to reflect the other labels' structure, for example call them insert_into_item
and uploaded_to_this_item
respectively.
Patch with the minor changes implemented