#51177 closed enhancement (invalid)
Add filters in the attachment_submitbox_metadata function
| Reported by: | Jean-David | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Media | Version: | |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: | template |
Description
In wp-admin/includes/media.php line 3249, the function
function attachment_submitbox_metadata() {
this function has no filter, so it's not possible to hook into it without to copy the function, but doing so would miss on any upgrade made to this function.
I don't know why there is no filters in this function, maybe there is a good explanation I didn't think about ?
The goal for me is to add the same div
.misc-pub-section.mis-pub-filename
used by the admin but with my own html.
Change History (4)
#1
@
6 years ago
#2
@
6 years ago
- Keywords close 2nd-opinion added
Going to mark this as close and 2nd-opinion. As @Mista-Flo mentioned you can add additional .misc-pub-section element by adding a custom hook onto the attachment_submitbox_misc_actions action. If you give it a priority less than 10 it'll place your custom items prior to the existing sections, if you give it a priority greater than 10 it'll place your custom items after the existing sections.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi @Jean-David, welcome and thank you for your ticket :)
I'm not sure adding some hooks here would be a good idea. I checked, and it was the same for the submit metabox for posts. You still have an action hook. But usually, for this metabox, I used to just manually add some custom HTML with JS code.