How do I create a WP endpoint that retrieves all custom post types that have a tag?

You’ll need to expose both the Custom Post Type (CPT) and the taxonomy you are attaching to that CPT that you’d like access to. This is a great article that helped me the first time I used it.

https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/

If you are trying to expose the CPT and the Taxonomy to search, it’s something similar when you are registering those two. The arguments for both should have public to true and or exclude_from_search to false

https://codex.wordpress.org/Function_Reference/register_post_type#Usage

https://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)