[wp-trac] [WordPress Trac] #32565: Adding an underscore prefix meta key with a meta value provides an incorrect error message

WordPress Trac noreply at wordpress.org
Sun Sep 6 21:12:32 UTC 2015


#32565: Adding an underscore prefix meta key with a meta value provides an
incorrect error message
--------------------------------+------------------------------
 Reporter:  danielpataki        |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  4.3
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:
--------------------------------+------------------------------

Comment (by ericlewis):

 In attachment:32565.2.diff, I've extended the work in @danielpataki's
 previous diff.

 First, we can simplify the code here by issuing one call to `add_meta()`
 regardless of post status, and thereby one `wp_die()` statement.

 We cannot edit the return of `add_meta()` to supply us with extra metadata
 for backwards compatibility. So, the work that function does to detect
 metakey must be duplicated here to decide whether `add_meta()` is failing
 because the user isn't allowed to edit it (by the meta being protected or
 capability checks) or if the value is empty.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32565#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list