當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。