本文整理匯總了PHP中BP_XProfile_Field::get_id_from_name方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_XProfile_Field::get_id_from_name方法的具體用法?PHP BP_XProfile_Field::get_id_from_name怎麽用?PHP BP_XProfile_Field::get_id_from_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BP_XProfile_Field
的用法示例。
在下文中一共展示了BP_XProfile_Field::get_id_from_name方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bp_xprofile_save_global_field_value
/**
* Save the global field value.
*
* @since 1.0
*
* @param object $field
*/
public function bp_xprofile_save_global_field_value($field)
{
if (!empty($_POST['saveField'])) {
if (BP_XProfile_Field::admin_validate()) {
$field_id = $field->id;
if (empty($field_id)) {
$field_id = BP_XProfile_Field::get_id_from_name($field->name);
}
$this->__update_xprofile_meta($field_id, 'field', 'global_value', $_POST['fieldvalue']);
}
}
}
開發者ID:nightbook,項目名稱:buddypress-admin-global-profile-fields,代碼行數:19,代碼來源:bp-admin-only-profile-fields.php
示例2: xprofile_get_field_id_from_name
/**
* Returns the ID for the field based on the field name.
*
* @since 1.0.0
*
* @param string $field_name The name of the field to get the ID for.
* @return int $field_id on success, false on failure.
*/
function xprofile_get_field_id_from_name($field_name)
{
return BP_XProfile_Field::get_id_from_name($field_name);
}
示例3: save_admin_field
function save_admin_field($field)
{
if (isset($_POST['bp_smp'])) {
// When creating a new field, no field_id will have been set yet. We'll
// look it up based on the $field object passed to the hook
if (empty($this->field_id)) {
$this->field_id = BP_XProfile_Field::get_id_from_name($field->name);
}
$new_smp_data = $_POST['bp_smp'];
bp_xprofile_update_field_meta($this->field_id, 'bp_smp_data', $new_smp_data);
}
}