[wp-trac] [WordPress Trac] #21864: PHPDoc incorrect with the return value of add_*_meta functions

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 10 20:54:14 UTC 2012


#21864: PHPDoc incorrect with the return value of add_*_meta functions
--------------------------+-------------------------------------
 Reporter:  mark8barnes   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Inline Docs   |    Version:  3.4.2
 Severity:  normal        |   Keywords:  has-patch needs-testing
--------------------------+-------------------------------------
 The PHPDocs for `add_comment_meta`, `add_post_meta` and `add_user_meta`
 all say that they return `true` on success. In fact, each calls
 `add_metadata`, which returns the metadata_id on success.

 In addition, `update_metadata` currently returns the metadata_id on
 success if the metadata did not already exist, but true on success if the
 metadata did already exist (the PHPDoc says simply that it is true on
 success).

 The patch corrects the documentation, and additionally ensures consistency
 with the return value for `update_metadata`.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21864>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list