How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?

We can check out the /wp/v2/clock endpoint’s arguments here: https://myapp.dev/wp-json/wp/v2/ If we add the ‘show_in_rest’ => true, argument, when registering the custom clock_category taxonomy, it will add a support for this GET/POST argument: clock_category: { required: false, default: [ ], description: “Limit result set to all items that have the specified term assigned in the … Read more

Using Custom Fields in Custom Post Type URL

I managed to fix this. Basically I changed the permastruct to this: $wp_rewrite->add_permastruct(‘showroom’, ‘location/%state%/%city%/%showroom%’, false); I then grabbed state & city as two separate variables, replacing it in the permalink structure using these lines: $permalink = str_replace(‘%state%’, $state, $permalink); $permalink = str_replace(‘%city%’, $city, $permalink); With $state & $city grabbed using get_post_meta from the post.

Select All in Parent Category, Group by Child Category?

Here’s a straight up simple solution. Requires you to have the most recent version of WordPress though. (or at least 4.1) Using nested taxonomy query. Taking what you have, and just adding to it a bit. $args = array( ‘post-type’ => ‘episode’, ‘post-status’ => ‘publish’, ‘posts_per_page’ => 4, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( … Read more