Hot answers tagged

1

While adding the tags to this stack exchange question, I added tags and the hint showed up as post_tag. So, I tried add_action('post_tag_edit_form_fields','tag_edit_form_fields'); and it works!


1

I was under the impression you can't have categories and tags on custom post types? You can have categories and tags on custom post types! But I can't see how Taxonomies and Terms are the same? But they are the same, Categories are a taxonomy, as are post tags, they're stored in the database the same way as custom taxonomies, and use the same code ...


1

The answer is that these tags are created as part of the unit-test suite of json-api WP plugin: https://github.com/dphiffer/wp-json-api https://wordpress.org/plugins/json-api/


1

Not sure if I'm understanding you correctly, but why don't you just use $_GET['product_tag'] at the moment where you want to retrieve it? UPDATE If the product posts exist in the basic wp_{custom}_posts database or similar, this solution of a basic WP post query method may be more convenient to you: $args = array( 'post_type' => 'product_post_type', ...


1

When I copy/pasted your code I got an error message because enf_register_categories_names_field() wasn't defined. When I cleaned up your code and wrapped the register_rest_field() in a function called "enf_register_categories_names_field" it worked as expected. function ag_filter_post_json($response, $post, $context) { $tags = wp_get_post_tags($post-&...


Only top voted, non community-wiki answers of a minimum length are eligible