Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/16/2021 05:29:26 AM (4 years ago)
Author:
imath
Message:

Improve the Field/Group APIs to pick selected fields as signup ones

  • Introduce the bp_xprofile_get_signup_field_ids() function to get an ordered list of field IDs to use as signup fields.
  • Introduce the bp_xprofile_signup_args() function to get the signup arguments to use into the registration page xProfile loop. If no signup fields are available, it falls back to the primary fields group.
  • Introduce the $signup_fields_only xProfile loop argument to restrict fetched fields to signup ones if set to true.
  • Adapt the BP_XProfile_Data_Template class to build a unique xProfile field group out of any possible field groups containing one or more signup fields when the $signup_fields_only argument is set to true and registration is allowed on the site.
  • Adapt the BP_XProfile_Field class to get the possible field's signup position and add a new metabox to add a field to signup ones from the xProfile Field Administration screen.
  • Adapt the BP_XProfile_Group class to ignore non signup fields if the $signup_fields_only argument is set to true.

Props johnjamesjacoby, boonebgorges, DJPaul, Offereins

See #6347

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r12868 r12885  
    1616 * @since 1.0.0
    1717 * @since 2.4.0 Introduced `$member_type` argument.
    18  * @since 8.0.0 Introduced `$hide_field_types` argument.
     18 * @since 8.0.0 Introduced `$hide_field_types` & `$signup_fields_only` arguments.
    1919 *
    2020 * @global object $profile_template
     
    3737 *     @type int[]|bool   $exclude_fields         Default: false.
    3838 *     @type string[]     $hide_field_types       Default: empty array.
     39 *     @type bool         $signup_fields_only     Default: false.
    3940 *     @type bool         $update_meta_cache      Default: true.
    4041 * }
     
    6970        'exclude_fields'         => false, // Comma-separated list of profile field IDs to exclude.
    7071        'hide_field_types'       => array(), // List of field types to hide from profile fields loop.
     72        'signup_fields_only'     => false, // Whether to only return signup fields.
    7173        'update_meta_cache'      => true,
    7274    ), 'has_profile' );
Note: See TracChangeset for help on using the changeset viewer.