• 知识库
    • 所有的文章
    • BuddyBoss平台
    • Buddyboss主题
    • Buddyboss应用程序
    • 乐动体育网站怎样
    • 高级设置
    • 故障排除
    • 发布说明
      • BuddyBoss平台
      • BB Platform Pro
      • Buddyboss主题
      • Buddyboss应用程序
      • Buddyboss app插件
      • 其他产品
  • 开发者
    • 开发人员教程
      • Web开发
      • 应用程序开发
    • 代码参考
      • 职能
      • 钩子
      • 课堂
      • 方法
      • 命令
      • App Codex.
    • RESTAPI
      • BuddyBoss平台
      • Buddyboss应用程序
    • GitHub项目
  • 路线图
  • 去BuddyBoss
    联系支持
    滤器

    • 知识库
      • 所有的文章
      • BuddyBoss平台
      • Buddyboss主题
      • Buddyboss应用程序
      • 乐动体育网站怎样
      • 高级设置
      • 故障排除
      • 发布说明
        • BuddyBoss平台
        • BB Platform Pro
        • Buddyboss主题
        • Buddyboss应用程序
        • Buddyboss app插件
        • 其他产品
    • 开发者
      • 开发人员教程
        • Web开发
        • 应用程序开发
      • 代码参考
        • 职能
        • 钩子
        • 课堂
        • 方法
        • 命令
        • App Codex.
      • RESTAPI
        • BuddyBoss平台
        • Buddyboss应用程序
      • GitHub项目
    • 路线图
    • 去BuddyBoss
    登录
    联系支持
    滤器
    滤器

    内容

    • 描述
    • 参数
    • 回来
    • 来源
    • 变更乐
    • 有关的
    代码参考 课堂 BP\u REST\u注册\u端点 BP_REST_Signup_Endpoint::Signup_form_items()

    BP_REST_Signup_Endpoint:: signup_form_items (WP_REST_请求$请求的)

    检索注册表单字段。

    描述

    参数

    $请求

    (WP_REST_请求的)(必需)有关该请求的完整详细信息。

    回来

    (wp_rest_response)| WP_Error

    来源

    文件:bp-members /类/ class-bp-rest-signup-endpoint.php

    Public function signup_form_items($request) {$fields = array();/*账户详细字段*/ $account_fields = bp_nouveau_get_signup_fields('account_details');如果(!if (array_key_exists($k, $this->default_password_fields)) {$field = $this->default_password_fields[$k]; $this->default_password_fields[$k]; $this->default_password_fields;} $[] =字段数组(“id”= > $ k '标签' = >['标签'],美元的描述 ' => '', ' 美元类型' = >字段“类型”,“需要”= >字段(“需要”),美元的选项 ' => '', ' member_type ' => '', );}} /* xProfile字段*/ if (bp_is_active(' xProfile ')) {$signup_group_id = $this->bp_rest_xprofile_base_group_id();$field_group = bp_xprofile_get_groups(array('profile_group_id' => $signup_group_id, 'fetch_fields' => true,));如果(!$field_group = current($field_group); / /当前字段$fields_endpoint = new BP_REST_XProfile_Fields_Endpoint(); if ( ! empty( $field_group->fields ) ) { foreach ( $field_group->fields as $field ) { /** * Added support for display name format support from platform. */ // Get the current display settings from BuddyBoss > Settings > Profiles > Display Name Format. $current_value = bp_get_option( 'bp-display-name-format' ); // If First Name selected then do not add last name field. if ( 'first_name' === $current_value && function_exists( 'bp_xprofile_lastname_field_id' ) && bp_xprofile_lastname_field_id() === $field->id ) { if ( function_exists( 'bp_hide_last_name' ) && false === bp_hide_last_name() ) { continue; } // If Nick Name selected then do not add first & last name field. } elseif ( 'nickname' === $current_value && function_exists( 'bp_xprofile_lastname_field_id' ) && bp_xprofile_lastname_field_id() === $field->id ) { if ( function_exists( 'bp_hide_nickname_last_name' ) && false === bp_hide_nickname_last_name() ) { continue; } } elseif ( 'nickname' === $current_value && function_exists( 'bp_xprofile_firstname_field_id' ) && bp_xprofile_firstname_field_id() === $field->id ) { if ( function_exists( 'bp_hide_nickname_first_name' ) && false === bp_hide_nickname_first_name() ) { continue; } } if ( function_exists( 'bp_member_type_enable_disable' ) && false === bp_member_type_enable_disable() ) { if ( function_exists( 'bp_get_xprofile_member_type_field_id' ) && bp_get_xprofile_member_type_field_id() === $field->id ) { continue; } } /** * --Added support for display name format support from platform. */ $field = $fields_endpoint->assemble_response_data( $field, $request ); $fields[] = array( 'id' => 'field_' . $field['id'], 'label' => $field['name'], 'description' => ( ! empty( $field['alternate_name'] ) ? $field['alternate_name'] : $field['name'] ), 'type' => $field['type'], 'required' => $field['is_required'], 'options' => $field['options'], 'member_type' => bp_xprofile_get_meta( $field['id'], 'field', 'member_type', false ), ); } } } } /* xProfile fields */ $blog_fields = bp_nouveau_get_signup_fields( 'blog_details' ); if ( ! empty( $blog_fields ) && bp_get_blog_signup_allowed() ) { if ( array_key_exists( 'signup_blog_privacy_public', $blog_fields ) ) { unset( $blog_fields['signup_blog_privacy_public'] ); } if ( array_key_exists( 'signup_blog_privacy_private', $blog_fields ) ) { unset( $blog_fields['signup_blog_privacy_private'] ); } $fields[] = array( 'id' => 'signup_with_blog', 'label' => __( "Yes, I'd like to create a new site", 'buddyboss' ), 'description' => '', 'type' => 'checkbox', 'required' => '', 'options' => '', ); foreach ( $blog_fields as $k => $field ) { $fields[] = array( 'id' => $k, 'label' => $field['label'], 'description' => '', 'type' => $field['type'], 'required' => $field['required'], 'options' => '', ); } $fields[] = array( 'id' => 'signup_blog_privacy', 'label' => __( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddyboss' ), 'description' => '', 'type' => 'radio', 'required' => true, 'options' => array( array( 'id' => 'public', 'type' => 'option', 'name' => __( 'Yes', 'buddyboss' ), 'is_default_option' => true, ), array( 'id' => 'private', 'type' => 'option', 'name' => __( 'No', 'buddyboss' ), 'is_default_option' => false, ), ), ); } $response = rest_ensure_response( $fields ); /** * Fires after a list of signup fields is fetched via the REST API. * * @param array $fields Fetched Form fields. * @param WP_REST_Response $response The response data. * @param WP_REST_Request $request The request sent to the API. * * @since 0.1.0 */ do_action( 'bp_rest_signup_form_items', $fields, $response, $request ); return $response; }

    展开完整的源代码折叠全源代码

    变更乐

    变更乐
    版本 描述
    0.1.0. 介绍。

    有关的

    使用

    使用
    使用 描述
    bp xprofile/classes/class-bp-rest-xprofile-fields-endpoint.php:BP_REST_XProfile_Fields_Endpoint::_构造()

    构造函数。

    bp成员/classes/class-bp-rest-signup-endpoint.php:bp_restig_signup_endpoint :: bp_rest_xprofile_base_group_id()

    获取基本名称字段的组ID - 来自bp_xprofile_base_group_id()

    bp成员/classes/class-bp-rest-signup-endpoint.php:bp_rest_signup_form_Items.

    通过REST API获取注册字段列表后触发。

    bp-core / bp-core-clusers.php:bp_core_hide_display_name_field ()

    是否隐藏了配置文件字段。

    bp members/bp-members-functions.php:bp_get_xprofile_member_type_field_id()

    返回成员类型xprofile字段id。

    bp-xprofile / bp-xprofile-clusers.php:bp_xprofile_get_meta()

    获取一块xprofile元数据。

    bp-xprofile / bp-xprofile-clusers.php:bp_xprofile_get_group()

    获取一组字段组,填充字段和字段数据。

    bp-templates / bp-nouveau / /显然也包括:bp_nouveau_get_signup_fields()

    获取所请求的部分的注册字段

    bp-core/bp-core-template.php:bp_is_active()

    检查是否有效的给定组件(或组件的功能)是活动的。

    bp-core/bp-core-template.php:bp_get_blog_signup_allowed()

    允许注册博客吗?

    BP-Core / BP-Core-Options.php:bp_member_type_enable_disable()

    成员类型是否已禁用?

    显示6更多使用 隐藏更多用途

    被使用
    被使用 描述
    bp成员/classes/class-bp-rest-signup-endpoint.php:BP_REST_Signup_Endpoint: create_item ()

    创建注册。

    问题?

    我们总是很乐意帮助您可能拥有的代码或其他问题!搜索我们开发人员文档那联系支持,或与我们的销售团队。

    ©2021•BuddyBoss
    Baidu