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


PHP bp_unserialize_profile_field函数代码示例

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


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

示例1: xprofile_format_profile_field

/**
 * Formats a profile field according to its type. [ TODO: Should really be moved to filters ]
 *
 * @package BuddyPress Core
 * @param string $field_type The type of field: datebox, selectbox, textbox etc
 * @param string $field_value The actual value
 * @return string|bool The formatted value, or false if value is empty
 */
function xprofile_format_profile_field($field_type, $field_value)
{
    if (empty($field_value)) {
        return false;
    }
    $field_value = bp_unserialize_profile_field($field_value);
    if ('datebox' != $field_type) {
        $content = $field_value;
        $field_value = str_replace(']]>', ']]>', $content);
    }
    return xprofile_filter_format_field_value_by_type(stripslashes_deep($field_value), $field_type);
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:20,代码来源:bp-xprofile-functions.php

示例2: xprofile_format_profile_field

/**
 * Formats a profile field according to its type. [ TODO: Should really be moved to filters ]
 *
 * @package BuddyPress Core
 * @param $field_type The type of field: datebox, selectbox, textbox etc
 * @param $field_value The actual value
 * @uses bp_format_time() Formats a time value based on the NXTClass date format setting
 * @return $field_value The formatted value
 */
function xprofile_format_profile_field($field_type, $field_value)
{
    if (!isset($field_value) || empty($field_value)) {
        return false;
    }
    $field_value = bp_unserialize_profile_field($field_value);
    if ('datebox' == $field_type) {
        $field_value = bp_format_time($field_value, true);
    } else {
        $content = $field_value;
        $field_value = str_replace(']]>', ']]>', $content);
    }
    return stripslashes_deep($field_value);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:23,代码来源:bp-xprofile-functions.php

示例3: bp_get_the_profile_field_edit_value

/**
 * Returns the XProfile field edit value.
 *
 * @since 1.1.0
 *
 * @return mixed|void
 */
function bp_get_the_profile_field_edit_value()
{
    global $field;
    /**
     * Check to see if the posted value is different, if it is re-display this
     * value as long as it's not empty and a required field.
     */
    if (!isset($field->data)) {
        $field->data = new stdClass();
    }
    if (!isset($field->data->value)) {
        $field->data->value = '';
    }
    if (isset($_POST['field_' . $field->id]) && $field->data->value != $_POST['field_' . $field->id]) {
        if (!empty($_POST['field_' . $field->id])) {
            $field->data->value = $_POST['field_' . $field->id];
        } else {
            $field->data->value = '';
        }
    }
    $field_value = isset($field->data->value) ? bp_unserialize_profile_field($field->data->value) : '';
    /**
     * Filters the XProfile field edit value.
     *
     * @since 1.1.0
     *
     * @param string $field_value Current field edit value.
     * @param string $type        Type for the profile field.
     * @param int    $id          ID for the profile field.
     */
    return apply_filters('bp_get_the_profile_field_edit_value', $field_value, $field->type, $field->id);
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:39,代码来源:bp-xprofile-template.php

示例4: bp_get_the_profile_field_edit_value

function bp_get_the_profile_field_edit_value()
{
    global $field;
    /**
     * Check to see if the posted value is different, if it is re-display this
     * value as long as it's not empty and a required field.
     */
    if (!isset($field->data->value)) {
        $field->data->value = '';
    }
    if (isset($_POST['field_' . $field->id]) && $field->data->value != $_POST['field_' . $field->id]) {
        if (!empty($_POST['field_' . $field->id])) {
            $field->data->value = $_POST['field_' . $field->id];
        } else {
            $field->data->value = '';
        }
    }
    $field_value = isset($field->data->value) ? bp_unserialize_profile_field($field->data->value) : '';
    return apply_filters('bp_get_the_profile_field_edit_value', $field_value, $field->type, $field->id);
}
开发者ID:newington,项目名称:buddypress,代码行数:20,代码来源:bp-xprofile-template.php

示例5: bp_get_the_profile_field_value

function bp_get_the_profile_field_value()
{
    global $field;
    $field->data->value = bp_unserialize_profile_field($field->data->value);
    return apply_filters('bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id);
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:6,代码来源:bp-xprofile-templatetags.php


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