WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #32565, comment 4


Ignore:
Timestamp:
09/08/2015 01:10:43 PM (4 years ago)
Author:
ericlewis
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32565, comment 4

    initial v1  
    33First, we can simplify the code here by issuing one call to `add_meta()` regardless of post status, and thereby one `wp_die()` statement.
    44
    5 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.
     5Preferably `add_meta()` would supply us with extra failure information about why the routine failed, but we cannot modify the return value because of 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.