$attribute_values[ $term_value ] = $response; } return array_values( $attribute_values ); } /** * Get a single custom attribute. * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Request|WP_Error */ public function get_item_by_slug( $request ) { return $this->get_custom_attribute_values( $request['slug'] ); } }