บล็อก
⭐️ เปิดตัว v4.1 พร้อมการกรองข้อมูลตามภาษาสำหรับ Polylang (PRO)
Gato GraphQL v4.1 ได้เปิดตัวแล้ว ดูบันทึกการเปิดตัวใน GitHub สำหรับรายการการเปลี่ยนแปลงทั้งหมด
ฟีเจอร์ใหม่ที่สำคัญที่สุดเป็นส่วนหนึ่งของ Gato GraphQL PRO
[PRO] Polylang: การกรองข้อมูลตามภาษา
ด้วยส่วนขยาย Polylang ตอนนี้เราสามารถกรองข้อมูลตามภาษาได้แล้ว
เราสามารถระบุภาษาที่ต้องการกรองเมื่อดึงข้อมูลสำหรับ:
- Posts
- Pages
- Custom posts
- หมวดหมู่
- Tags
- Media items
ฟิลด์ที่เกี่ยวข้องรับอินพุต polylangLanguage และเราสามารถกรองด้วยรหัสหรือ locale และด้วย 1 ภาษาหรือมากกว่า 1 ภาษา
ตัวอย่างเช่น การส่ง $languageCodes: ["es"] จะดึงข้อมูลเป็นภาษาสเปน:
query FilterByLanguage($languageCodes: [String!])
{
posts(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
pages(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
customPosts(filter: {
customPostTypes: ["some-cpt"]
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
postCategories(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
name
}
postTags(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
name
}
categories(
taxonomy: "some-category"
filter: { polylangLanguages: { codes: $languageCodes } }
) {
id
name
}
tags(
taxonomy: "some-tag"
filter: { polylangLanguages: { codes: $languageCodes } }
) {
id
name
}
mediaItems(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
}