Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/14/2014 07:21:52 PM (11 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/groups/functions.php

    r7883 r7885  
    337337    /**
    338338     * @group groupmeta
     339     * @group groups_update_groupmeta
     340     */
     341    public function test_groups_update_groupmeta_prev_value() {
     342        $g = $this->factory->group->create();
     343        groups_add_groupmeta( $g, 'foo', 'bar' );
     344        $this->assertFalse( groups_update_groupmeta( $g, 'foo', 'bar2', 'baz' ) );
     345        $this->assertTrue( groups_update_groupmeta( $g, 'foo', 'bar2', 'bar' ) );
     346    }
     347
     348    /**
     349     * @group groupmeta
    339350     *
    340351     * @todo Why do we do this?
Note: See TracChangeset for help on using the changeset viewer.