當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_XProfile_Field::delete方法代碼示例

本文整理匯總了PHP中BP_XProfile_Field::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_XProfile_Field::delete方法的具體用法?PHP BP_XProfile_Field::delete怎麽用?PHP BP_XProfile_Field::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BP_XProfile_Field的用法示例。


在下文中一共展示了BP_XProfile_Field::delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: xprofile_delete_field

function xprofile_delete_field($field_id)
{
    $field = new BP_XProfile_Field($field_id);
    return $field->delete();
}
開發者ID:kosir,項目名稱:thatcamp-org,代碼行數:5,代碼來源:bp-xprofile-functions.php

示例2: xprofile_admin_delete_field

/**
 * Handles the deletion of a profile field (or field option)
 *
 * @since BuddyPress (1.0)
 * @global string $message The feedback message to show
 * @global $type The type of feedback message to show
 * @param int $field_id The field to delete
 * @param string $field_type The type of field being deleted
 * @param bool $delete_data Should the field data be deleted too?
 */
function xprofile_admin_delete_field($field_id, $field_type = 'field', $delete_data = false)
{
    global $message, $type;
    // Switch type to 'option' if type is not 'field'
    // @todo trust this param
    $field_type = 'field' == $field_type ? __('field', 'buddypress') : __('option', 'buddypress');
    $field = new BP_XProfile_Field($field_id);
    if (!$field->delete((bool) $delete_data)) {
        $message = sprintf(__('There was an error deleting the %s. Please try again', 'buddypress'), $field_type);
        $type = 'error';
    } else {
        $message = sprintf(__('The %s was deleted successfully!', 'buddypress'), $field_type);
        $type = 'success';
        do_action('xprofile_fields_deleted_field', $field);
    }
    unset($_GET['mode']);
    xprofile_admin($message, $type);
}
開發者ID:eresyyl,項目名稱:mk,代碼行數:28,代碼來源:bp-xprofile-admin.php

示例3: xprofile_admin_delete_field

function xprofile_admin_delete_field($field_id, $type = 'field')
{
    global $message, $type;
    if ('field' == $type) {
        $type = __('field', 'buddypress');
    } else {
        $type = __('option', 'buddypress');
    }
    $field = new BP_XProfile_Field($field_id);
    if (!$field->delete()) {
        $message = sprintf(__('There was an error deleting the %s. Please try again', 'buddypress'), $type);
        $type = 'error';
    } else {
        $message = sprintf(__('The %s was deleted successfully!', 'buddypress'), $type);
        $type = 'success';
        do_action('xprofile_fields_deleted_field', $field);
    }
    unset($_GET['mode']);
    xprofile_admin($message, $type);
}
開發者ID:nxtclass,項目名稱:NXTClass,代碼行數:20,代碼來源:bp-xprofile-admin.php

示例4: xprofile_admin_delete_field

/**
 * Handles the deletion of a profile field (or field option)
 *
 * @since BuddyPress (1.0.0)
 * @global string $message The feedback message to show
 * @global $type The type of feedback message to show
 * @param int $field_id The field to delete
 * @param string $field_type The type of field being deleted
 * @param bool $delete_data Should the field data be deleted too?
 */
function xprofile_admin_delete_field($field_id, $field_type = 'field', $delete_data = false)
{
    global $message, $type;
    // Switch type to 'option' if type is not 'field'
    // @todo trust this param
    $field_type = 'field' == $field_type ? __('field', 'buddypress') : __('option', 'buddypress');
    $field = new BP_XProfile_Field($field_id);
    if (!$field->delete((bool) $delete_data)) {
        $message = sprintf(__('There was an error deleting the %s. Please try again.', 'buddypress'), $field_type);
        $type = 'error';
    } else {
        $message = sprintf(__('The %s was deleted successfully!', 'buddypress'), $field_type);
        $type = 'success';
        /**
         * Fires at the end of the field deletion process, if successful.
         *
         * @since BuddyPress (1.0.0)
         *
         * @param BP_XProfile_Field $field Current BP_XProfile_Field object.
         */
        do_action('xprofile_fields_deleted_field', $field);
    }
    unset($_GET['mode']);
    xprofile_admin($message, $type);
}
開發者ID:kosir,項目名稱:thatcamp-org,代碼行數:35,代碼來源:bp-xprofile-admin.php


注:本文中的BP_XProfile_Field::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。