Skip to:

Opened 10 years ago

Closed 10 years ago

#5400 closed defect (bug) (fixed)

Implement add_meta() functions and other WP metadata goodies

Reported by: boonebgorges's profile boonebgorges Owned by: boonebgorges's profile boonebgorges
Milestone: 2.0 Priority: normal
Severity: normal Version:
Component: Core Keywords:


In migrating to WP's metadata functions, we now have the ability to use some of the good stuff that those functions have available, such as:

  • the $single param of get_metadata()
  • the $delete_all param of delete_metadata()
  • the add_metadata() function

Should do a review and see how these can be consistently added to each of our component metadata libraries.

Change History (9)

#1 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Status changed from new to assigned

#2 @boonebgorges
10 years ago

In 7872:

Introduce bp_activity_add_meta()

See #5400

#3 @boonebgorges
10 years ago

In 7875:

Introduce groups_add_groupmeta(). See #5400

#4 @boonebgorges
10 years ago

In 7877:

Introduce bp_blogs_add_blogmeta()

See #5400

#5 @boonebgorges
10 years ago

In 7878:

Introduce bp_xprofile_add_meta().

See #5400

#6 @boonebgorges
10 years ago

In 7879:

Add support for $single param in _get_meta() functions

Unlike get_metadata(), we are defaulting to $single = true, for backward

See #5400

#7 @boonebgorges
10 years ago

In 7883:

Add delete_all support for all _delete_meta() functions

The delete_all parameter allows you to delete all meta items matching the
specified meta_key, regardless of the associated object.

Because our meta delete functions also support the deletion of all metadata
associated with an object (by leaving out the meta_key param), a decision had
to be made regarding the behavior when _delete_meta() is called with delete_all

true and meta_key = false. The most logical (and least destructive) strategy

was deemed to be: force delete_all to false when meta_key is also false. This
ensures that you don't accidentally wipe out all metadata for a component.

See #5400

#8 @boonebgorges
10 years ago

In 7885:

Add support for prev_value param to _update_meta() functions

This parameter, inherited from update_metadata(), allows you to limit your
updates only to rows where the meta_value matches your specified prev_value.

See #5400

#9 @boonebgorges
10 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

I think I've gotten all the good stuff out of the WP functions. Aside from the quirks in our functions (see #5399) we have complete feature parity with WP's metadata functions. Marking fixed.

Note: See TracTickets for help on using tickets.