Changes between Initial Version and Version 1 of Ticket #51730
- Timestamp:
- 11/10/2020 12:50:13 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #51730
-
Property
Component
changed from
General
toOptions, Meta APIs
-
Property
Type
changed from
feature request
toenhancement
-
Property
Summary
changed from
Feature request: For update_metadata to differentiate failure from no update
toupdate_metadata function: differentiate failure from no update
-
Property
Component
changed from
-
Ticket #51730 – Description
initial v1 1 The wordpress function update_metadata, (as well as update_post_meta, and update_term_meta which call it) returns false on failure or if the value passed to the function is the same as the one that is already in the database. This behavior is documented by wordpress: https://developer.wordpress.org/reference/functions/update_metadata/.1 The WordPress function update_metadata, (as well as update_post_meta, and update_term_meta which call it) returns false on failure or if the value passed to the function is the same as the one that is already in the database. This behavior is documented by WordPress: https://developer.wordpress.org/reference/functions/update_metadata/. 2 2 3 3 However, I would like to be able to differentiate the failure case from the no update case. In my custom plugin I allow users to update post meta; I want to show them a failure message if their update failed and nothing if there was no update.