This documentation provides details on using the wbcom_enhanced_profile_fields shortcode to display BuddyPress profile groups, their fields, group keys, user meta names, and field types. The shortcode is designed for developers to quickly fetch and use these fields in custom functionalities, such as adding them to registration forms.
Shortcode
[wbcom_enhanced_profile_fields]
Description:
Generates a table for each BuddyPress profile group with the following details:
- Field Label: The display label of the field.
- Field Name: The internal name of the field.
- User Meta Name: The meta key used to store the field’s value in the database.
- Field Type: The type of field (e.g., textbox, email, etc.).
- Group Key: The unique identifier for the profile group.
How to Use
- Add the shortcode
[wbcom_enhanced_profile_fields]to any page or post. - The shortcode will render an organized table with profile group and field details.
Output Example
Group: Education (Group Key: bprm_grp_edu)
| Field Label | Field Name | User Meta Name | Field Type |
|---|---|---|---|
| Institute | bprms_inst |
wbbpp_bprm_grp_edu_bprms_inst |
textbox |
| Place | bprms_inst_place |
wbbpp_bprm_grp_edu_bprms_inst_place |
place_autocomplete |
| Degree/Program | bprms_degree |
wbbpp_bprm_grp_edu_bprms_degree |
textbox |
Developer Benefits
- Field Discovery: Easily locate relevant field meta keys and their types.
- Dynamic Usage: Use field data in custom registration forms or other functionalities.
- Structured Output: Tables make it simple to copy/paste or reference fields.
Example Use Case
Fetching a Field for Registration Form
// Example to display a specific field dynamically in a registration form.
$meta_keys = [
'wbbpp_bprm_grp_edu_bprms_inst' => [
'type' => 'textbox',
'label' => 'Institute'
]
];
foreach ($meta_keys as $meta_key => $details) {
echo '';
echo '';
}
Advanced Features
- The shortcode includes all profile groups and fields, ensuring no manual lookup is required.
- Supports additional field types for customization.
- Clear grouping and separation of data.
Conclusion
The wbcom_enhanced_profile_fields shortcode simplifies the process of managing BuddyPress profile groups and fields. It is an essential tool for developers working with custom registration forms or user profiles.
Use this shortcode to save time and enhance the flexibility of your BuddyPress projects.
