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 … Read more

Working with a json feed & trying to figure out how best to import

You could use a combination of update_post_meta(), set_objetc_terms(), and wp_update_post() to update your products. It is a good idea to use taxonomies (product categories and product attributes in WooC) as extensively as possible to store common product data as it makes searching for products faster compared to storing the data in post_meta. Here’s a concept … Read more

How to get WordPress to respond to a GET request at the end of a Woo product page

If you want to do the processing and reloading, more or less, user not noticing, you could execute a custom function on template_redirect action. function check_parameter() { if ( isset( $_GET[‘bar’] ) && ‘foo’ === $_GET[‘bar’] && is_singular( ‘product’ ) ) { // get remote data e.g. with wp_remote_get( ‘http://example.com’ ); // do something // … Read more

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