Skip to:
Content

BuddyPress.org

Changeset 1218


Ignore:
Timestamp:
03/16/2009 11:53:35 AM (15 years ago)
Author:
apeatling
Message:

Re-adding optional meta_key parameters to meta delete functions.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r1217 r1218  
    726726//
    727727
    728 function bp_blogs_delete_blogmeta( $blog_id, $meta_key, $meta_value = false ) {
     728function bp_blogs_delete_blogmeta( $blog_id, $meta_key = false, $meta_value = false ) {
    729729    global $wpdb, $bp;
    730730   
     
    739739    $meta_value = trim( $meta_value );
    740740
    741     if ( $meta_value ) {
     741    if ( !$meta_key ) {
     742        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id ) );     
     743    } else if ( $meta_value ) {
    742744        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d AND meta_key = %s AND meta_value = %s", $blog_id, $meta_key, $meta_value ) );
    743745    } else {
  • trunk/bp-groups.php

    r1217 r1218  
    21482148//
    21492149
    2150 function groups_delete_groupmeta( $group_id, $meta_key, $meta_value = false ) {
     2150function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = false ) {
    21512151    global $wpdb, $bp;
    21522152   
     
    21612161    $meta_value = trim( $meta_value );
    21622162
    2163     if ( $meta_value ) {
     2163    if ( !$meta_key ) {
     2164        $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d", $group_id ) );       
     2165    } else if ( $meta_value ) {
    21642166        $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) );
    21652167    } else {
Note: See TracChangeset for help on using the changeset viewer.