The code snippet will check the number of post relations of your post.
In our example, we use “feature-request” post type key,
When a feature request is created or updated, the function will run and check the database for voxel post relations, so that the hidden field “total_myposttype” will get updated with the total number of post relations.
Now you can use this field for sorting, filtering and display.
Count Post Relations for Post Types
Create a number field in your post type called “total_myposttype”
Add a post relation field with the custom key “myposttype”.
Edit the $post_type_config arrays from the code.
No results available
Reset- Filter by
- Filter by