Changes between Initial Version and Version 1 of Ticket #32565, comment 4
- Timestamp:
- 09/08/2015 01:10:43 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32565, comment 4
initial v1 3 3 First, we can simplify the code here by issuing one call to `add_meta()` regardless of post status, and thereby one `wp_die()` statement. 4 4 5 We cannot edit the return of `add_meta()` to supply us with extra metadata forbackwards 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.5 Preferably `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.