Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51730


Ignore:
Timestamp:
11/10/2020 12:50:13 AM (4 years ago)
Author:
sabernhardt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51730

    • Property Component changed from General to Options, Meta APIs
    • Property Type changed from feature request to enhancement
    • Property Summary changed from Feature request: For update_metadata to differentiate failure from no update to update_metadata function: differentiate failure from no update
  • 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/.
     1The 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/.
    22
    33However, 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.