Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/14/2014 07:21:52 PM (13 years ago)
Author:
boonebgorges
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/xprofile/functions.php

    r7883 r7885  
    443443        /**
    444444         * @group xprofilemeta
     445         * @group bp_xprofile_update_meta
     446         */
     447        public function test_bp_xprofile_update_meta_prev_value() {
     448                $g = $this->factory->xprofile_group->create();
     449                bp_xprofile_add_meta( $g, 'group', 'foo', 'bar' );
     450                $this->assertFalse( bp_xprofile_update_meta( $g, 'group', 'foo', 'bar2', 'baz' ) );
     451                $this->assertTrue( bp_xprofile_update_meta( $g, 'group', 'foo', 'bar2', 'bar' ) );
     452        }
     453
     454        /**
     455         * @group xprofilemeta
    445456         * @group bp_xprofile_add_meta
    446457         */
Note: See TracChangeset for help on using the changeset viewer.