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


PHP BP_XProfile_Field::delete_for_group方法代码示例

本文整理汇总了PHP中BP_XProfile_Field::delete_for_group方法的典型用法代码示例。如果您正苦于以下问题:PHP BP_XProfile_Field::delete_for_group方法的具体用法?PHP BP_XProfile_Field::delete_for_group怎么用?PHP BP_XProfile_Field::delete_for_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BP_XProfile_Field的用法示例。


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

示例1: delete

 function delete()
 {
     global $wpdb, $bp;
     if (!$this->can_delete) {
         return false;
     }
     $sql = $wpdb->prepare("DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id);
     if (!$wpdb->query($sql)) {
         return false;
     } else {
         // Now the group is deleted, remove the group's fields.
         if (BP_XProfile_Field::delete_for_group($this->id)) {
             // Now delete all the profile data for the groups fields
             for ($i = 0; $i < count($this->fields); $i++) {
                 BP_XProfile_ProfileData::delete_for_field($this->fields[$i]->id);
             }
         }
         return true;
     }
 }
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:20,代码来源:bp-xprofile-classes.php

示例2: delete

 function delete()
 {
     global $wpdb, $bp;
     if (empty($this->can_delete)) {
         return false;
     }
     // Delete field group
     if (!$wpdb->query($wpdb->prepare("DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id))) {
         return false;
     } else {
         // Remove the group's fields.
         if (BP_XProfile_Field::delete_for_group($this->id)) {
             // Remove profile data for the groups fields
             for ($i = 0, $count = count($this->fields); $i < $count; ++$i) {
                 BP_XProfile_ProfileData::delete_for_field($this->fields[$i]->id);
             }
         }
         return true;
     }
 }
开发者ID:vsalx,项目名称:rattieinfo,代码行数:20,代码来源:bp-xprofile-classes.php

示例3: delete

 /**
  * Delete a profile field group
  *
  * @since 1.1.0
  *
  * @global object  $wpdb
  * @return boolean
  */
 public function delete()
 {
     global $wpdb;
     // Bail if field group cannot be deleted.
     if (empty($this->can_delete)) {
         return false;
     }
     /**
      * Fires before the current group instance gets deleted.
      *
      * @since 2.0.0
      *
      * @param BP_XProfile_Group $this Current instance of the group being deleted. Passed by reference.
      */
     do_action_ref_array('xprofile_group_before_delete', array(&$this));
     $bp = buddypress();
     $sql = $wpdb->prepare("DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id);
     $deleted = $wpdb->query($sql);
     // Delete field group.
     if (empty($deleted) || is_wp_error($deleted)) {
         return false;
     }
     // Remove the group's fields.
     if (BP_XProfile_Field::delete_for_group($this->id)) {
         // Remove profile data for the groups fields.
         for ($i = 0, $count = count($this->fields); $i < $count; ++$i) {
             BP_XProfile_ProfileData::delete_for_field($this->fields[$i]->id);
         }
     }
     /**
      * Fires after the current group instance gets deleted.
      *
      * @since 2.0.0
      *
      * @param BP_XProfile_Group $this Current instance of the group being deleted. Passed by reference.
      */
     do_action_ref_array('xprofile_group_after_delete', array(&$this));
     return true;
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:47,代码来源:class-bp-xprofile-group.php


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