Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/14/2014 12:23:35 PM (10 years ago)
Author:
boonebgorges
Message:

Introduce groups_add_groupmeta(). See #5400

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-functions.php

    r7840 r7875  
    10381038}
    10391039
     1040/**
     1041 * Add a piece of group metadata.
     1042 *
     1043 * @since BuddyPress (2.0.0)
     1044 *
     1045 * @param int $group_id ID of the group.
     1046 * @param string $meta_key Metadata key.
     1047 * @param mixed $meta_value Metadata value.
     1048 * @param bool $unique. Optional. Whether to enforce a single metadata value
     1049 *        for the given key. If true, and the object already has a value for
     1050 *        the key, no change will be made. Default: false.
     1051 * @return int|bool The meta ID on successful update, false on failure.
     1052 */
     1053function groups_add_groupmeta( $group_id, $meta_key, $meta_value, $unique = false ) {
     1054    add_filter( 'query', 'bp_filter_metaid_column_name' );
     1055    $retval = add_metadata( 'group', $group_id, $meta_key, $meta_value, $unique );
     1056    remove_filter( 'query', 'bp_filter_metaid_column_name' );
     1057
     1058    return $retval;
     1059}
     1060
    10401061/*** Group Cleanup Functions ****************************************************/
    10411062
Note: See TracChangeset for help on using the changeset viewer.