Opened 6 weeks ago
Closed 2 weeks ago
#9292 closed defect (bug) (fixed)
Harden the bp_get_object_terms function
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 15.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | dev-feedback close |
Cc: |
Description
An odd one I know but the function
bp_get_object_terms does this:
$site_terms = wp_get_object_terms( $object_ids, $site_taxonomies, $args );
$retval = array_merge( $retval, $site_terms );
except wp_get_object_terms may not actually an array, it can return a error etc
I know this is unsual but I have used bp_get_default_taxonomies to remove a taxaonomy hence egenerating an error
I think it would be a prudent to harden the above function
Change History (3)
Note: See
TracTickets for help on using
tickets.
On the Github version, the bp_get_object_terms() should already "harden" as per https://github.com/buddypress/buddypress/commit/95cd39a637001357adcfa83770594ae0d4e98870
It already handles the WP_Error or anything that is not an array(), however, this has not been shipped yet. I checked the same function from https://wordpress.org/plugins/buddypress/ version and can confirm that:
From the SVN Version 14.3.4

Github master

I'm not gonna close this since it's not been shipped yet, so I'll leave that to @johnjamesjacoby to decide..