Hooks
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_start
  • gatompl:query_execution_end

Hook'lar aşağıdaki parametreleri alır:

ParametreAçıklamaÖrnek
$querySlugYürütülecek query'nin slug'ıtranslate-customposts
$queryVariablesQuery'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-categories
  • create-missing-translation-customposts
  • create-missing-translation-media
  • create-missing-translation-tags
  • sync-category-meta-entry-deletion
  • sync-custompost-categories
  • sync-custompost-featuredimage
  • sync-custompost-meta-entry-deletion
  • sync-custompost-tags
  • sync-tag-meta-entry-deletion
  • translate-categories
  • translate-customposts
  • translate-media
  • translate-tags