Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/14/2014 01:32:34 PM (10 years ago)
Author:
boonebgorges
Message:

Introduce bp_blogs_add_blogmeta()

See #5400

File:
1 edited

Legend:

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

    r7870 r7877  
    935935
    936936/**
     937 * Add a piece of blog metadata.
     938 *
     939 * @since BuddyPress (2.0.0)
     940 *
     941 * @param int $blog_id ID of the blog.
     942 * @param string $meta_key Metadata key.
     943 * @param mixed $meta_value Metadata value.
     944 * @param bool $unique. Optional. Whether to enforce a single metadata value
     945 *        for the given key. If true, and the object already has a value for
     946 *        the key, no change will be made. Default: false.
     947 * @return int|bool The meta ID on successful update, false on failure.
     948 */
     949function bp_blogs_add_blogmeta( $blog_id, $meta_key, $meta_value, $unique = false ) {
     950    add_filter( 'query', 'bp_filter_metaid_column_name' );
     951    $retval = add_metadata( 'blog', $blog_id, $meta_key, $meta_value, $unique );
     952    remove_filter( 'query', 'bp_filter_metaid_column_name' );
     953
     954    return $retval;
     955}
     956/**
    937957 * Remove all blog associations for a given user.
    938958 *
Note: See TracChangeset for help on using the changeset viewer.