🫢WordPress wp-json API get posts with all categories (ok)
https://wordpress.org/support/topic/wordpress-api-get-posts-with-all-categories/
Step 1: Phân tích api "/wp/v2/categories/(?P[\d]+)"

— Step 1.1 Lấy theo slug


Step 2: Phân tích api "/wp/v2/categories/?args


Case 1 category id 1
https://dev-lionel1.pantheonsite.io/wp-json/wp/v2/posts/?categories=1


Case 2 category id 26
https://dev-lionel1.pantheonsite.io/wp-json/wp/v2/posts/?categories=26


Case 3 nhiều categories
https://dev-lionel1.pantheonsite.io/wp-json/wp/v2/posts/?categories=1,26

Last updated
Was this helpful?