[wp-trac] [WordPress Trac] #54339: unique $keys array when add custom key from Several places with postmeta_form_keys
WordPress Trac
noreply at wordpress.org
Fri Oct 29 09:11:47 UTC 2021
#54339: unique $keys array when add custom key from Several places with
postmeta_form_keys
----------------------------+-----------------------------
Reporter: myousefi08 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.8.1
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
I added two similar custom key from my theme and a plugin with
postmeta_form_keys filter.
but now display both of theme in custom-fields name's select box (custom-
fields metabox - post.php or post-new.php)
I think is better to unique $keys before options are printed.
wp-admin/includes/template.php
line ~730
before:
foreach ( $keys as $key ) {
after:
$keys = array_unique($keys);
foreach ( $keys as $key ) {
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54339>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list