Make WordPress Core

Opened 2 years ago

#54339 new defect (bug)

unique $keys array when add custom key from Several places with postmeta_form_keys

Reported by: myousefi08's profile myousefi08 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8.1
Component: General Keywords:
Focuses: administration Cc:

Description

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 ) {

Change History (0)

Note: See TracTickets for help on using tickets.