factor1 / better-rest-endpoints

A WordPress plugin that serves up slimmer WP Rest API endpoints.
https://wordpress.org/plugins/better-rest-endpoints/
GNU General Public License v3.0
67 stars 25 forks source link

use get_the_terms with tax strings #40

Closed andrewminion-luminfire closed 5 years ago

andrewminion-luminfire commented 5 years ago

Thanks for the plugin!

I was getting a bunch of Notice: Array to string conversion in …/wp-includes/taxonomy.php on line 3306 errors and tracked it down to using an array of taxonomy names with get_the_terms(), which expects a single taxonomy name.

I’m guessing at some point this used to use wp_get_object_terms() which does accept an array, but was changed to get_the_terms() for better performance.