当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_blogs_delete_blogmeta函数代码示例

本文整理汇总了PHP中bp_blogs_delete_blogmeta函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_blogs_delete_blogmeta函数的具体用法?PHP bp_blogs_delete_blogmeta怎么用?PHP bp_blogs_delete_blogmeta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bp_blogs_delete_blogmeta函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete_blog_for_all

 function delete_blog_for_all($blog_id)
 {
     global $wpdb, $bp;
     if (!$bp->blogs) {
         bp_blogs_setup_globals();
     }
     bp_blogs_delete_blogmeta($blog_id);
     return $wpdb->query($wpdb->prepare("DELETE FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id));
 }
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:9,代码来源:bp-blogs-classes.php

示例2: bp_blogs_update_blogmeta

function bp_blogs_update_blogmeta($blog_id, $meta_key, $meta_value)
{
    global $wpdb, $bp;
    if (!is_numeric($blog_id)) {
        return false;
    }
    $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
    if (is_string($meta_value)) {
        $meta_value = stripslashes($wpdb->escape($meta_value));
    }
    $meta_value = maybe_serialize($meta_value);
    if (empty($meta_value)) {
        return bp_blogs_delete_blogmeta($blog_id, $meta_key);
    }
    $cur = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d AND meta_key = %s", $blog_id, $meta_key));
    if (!$cur) {
        $wpdb->query($wpdb->prepare("INSERT INTO {$bp->blogs->table_name_blogmeta} ( blog_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $blog_id, $meta_key, $meta_value));
    } else {
        if ($cur->meta_value != $meta_value) {
            $wpdb->query($wpdb->prepare("UPDATE {$bp->blogs->table_name_blogmeta} SET meta_value = %s WHERE blog_id = %d AND meta_key = %s", $meta_value, $blog_id, $meta_key));
        } else {
            return false;
        }
    }
    wp_cache_set('bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, $meta_value, 'bp');
    return true;
}
开发者ID:vsalx,项目名称:rattieinfo,代码行数:27,代码来源:bp-blogs-functions.php

示例3: delete_blog_for_all

 /**
  * Delete the record of a given blog for all users.
  *
  * @param int $blog_id The blog being removed from all users.
  * @return int|bool Number of rows deleted on success, false on failure.
  */
 public static function delete_blog_for_all($blog_id)
 {
     global $wpdb;
     bp_blogs_delete_blogmeta($blog_id);
     $bp = buddypress();
     return $wpdb->query($wpdb->prepare("DELETE FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id));
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:13,代码来源:class-bp-blogs-blog.php

示例4: test_bp_blogs_delete_blogmeta_with_delete_all

 /**
  * @group blogmeta
  * @group bp_blogs_delete_blogmeta
  */
 public function test_bp_blogs_delete_blogmeta_with_delete_all()
 {
     // With no meta key, don't delete for all items - just delete
     // all for a single item
     bp_blogs_add_blogmeta(1, 'foo', 'bar');
     bp_blogs_add_blogmeta(1, 'foo1', 'bar1');
     bp_blogs_add_blogmeta(2, 'foo', 'bar');
     bp_blogs_add_blogmeta(2, 'foo1', 'bar1');
     $this->assertTrue(bp_blogs_delete_blogmeta(1, 'foo', '', true));
     $this->assertSame('', bp_blogs_get_blogmeta(1, 'foo'));
     $this->assertSame('', bp_blogs_get_blogmeta(2, 'foo'));
     $this->assertSame('bar1', bp_blogs_get_blogmeta(1, 'foo1'));
     $this->assertSame('bar1', bp_blogs_get_blogmeta(2, 'foo1'));
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:18,代码来源:functions.php

示例5: bp_blogs_delete_url_blogmeta

/**
 * Deletes the 'url' blogmeta for a site.
 *
 * Hooked to 'refresh_blog_details', which is notably used when editing a site
 * under "Network Admin > Sites".
 *
 * @since BuddyPress (2.3.0)
 *
 * @param int $site_id The site ID.
 */
function bp_blogs_delete_url_blogmeta($site_id = 0)
{
    bp_blogs_delete_blogmeta((int) $site_id, 'url');
}
开发者ID:AceMedia,项目名称:BuddyPress,代码行数:14,代码来源:bp-blogs-functions.php

示例6: delete_blog_for_all

 function delete_blog_for_all($blog_id)
 {
     global $nxtdb, $bp;
     bp_blogs_delete_blogmeta($blog_id);
     return $nxtdb->query($nxtdb->prepare("DELETE FROM {$bp->blogs->table_name} WHERE blog_id = %d", $blog_id));
 }
开发者ID:nxtclass,项目名称:NXTClass,代码行数:6,代码来源:bp-blogs-classes.php


注:本文中的bp_blogs_delete_blogmeta函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。