HooksQuery yürütme hooks
Query yürütme hooks
Gato AI Translations for Polylang, tüm mantığını gerçekleştirmek için GraphQL queries çalıştırır:
- Eksik çeviri girişleri oluşturma (yazılar, kategoriler, etiketler vb.)
- Diller arasında veri senkronizasyonu
- İçerik çevirisi
Uygulamanız, aşağıdaki action hook'lar aracılığıyla queries yürütülmesine tepki verebilir:
gatompl:query_execution_startgatompl:query_execution_end
Hook'lar aşağıdaki parametreleri alır:
| Parametre | Açıklama | Örnek |
|---|---|---|
$querySlug | Yürütülecek query'nin slug'ı | translate-customposts |
$queryVariables | Query'ye iletilen değişkenler | ['customPostIds' => [123, 456], ...] |
gatompl:query_execution_start
Query yürütülmeden hemen önce tetiklenir.
add_action(
'gatompl:query_execution_start',
/**
* @param array<string, mixed> $queryVariables The variables passed to the query.
*/
function (
string $querySlug,
array $queryVariables
): void {
// Do something
},
10,
2
);gatompl:query_execution_end
Query yürütüldükten hemen sonra tetiklenir.
add_action(
'gatompl:query_execution_start',
/**
* @param array<string, mixed> $queryVariables The variables passed to the query.
*/
function (
string $querySlug,
array $queryVariables
): void {
// Do something
},
10,
2
);Query slug'ları
Desteklenen query slug'ları şunlardır:
create-missing-translation-categoriescreate-missing-translation-custompostscreate-missing-translation-mediacreate-missing-translation-tagssync-category-meta-entry-deletionsync-custompost-categoriessync-custompost-featuredimagesync-custompost-meta-entry-deletionsync-custompost-tagssync-tag-meta-entry-deletiontranslate-categoriestranslate-custompoststranslate-mediatranslate-tags