Opened 4 years ago
Closed 3 years ago
#8789 closed defect (bug) (fixed)
bp_get_the_profile_field_ids should check that groups exist
| Reported by: | shawfactor | Owned by: | imath |
|---|---|---|---|
| Priority: | normal | Milestone: | 12.0.0 |
| Component: | Extended Profile | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: |
Description
The bp_get_the_profile_field_ids function should incorporate a check that $profile_template->groups before the foreach loop. At present when you use it programmatically it can generate an error in some contexts
this would be an improvement:
if (!empty($profile_template->groups)){
foreach ( $profile_template->groups as $group ) {
if ( ! empty( $group->fields ) ) {
$field_ids = array_merge( $field_ids, wp_list_pluck( $group->fields, 'id' ) );
}
}
}
Change History (5)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Prevent potential errors in
bp_get_the_profile_field_ids().Trac ticket: https://buddypress.trac.wordpress.org/ticket/8789