フッククエリ実行フック
クエリ実行フック
Gato AI Translations for Polylang は、すべてのロジックを実現するために GraphQL クエリ を実行します。
- 不足している翻訳エントリの作成(投稿、カテゴリー、タグなど)
- 言語間のデータ同期
- コンテンツの翻訳
アプリケーションは、以下のアクションフックを使用してクエリの実行に反応できます。
gatompl:query_execution_startgatompl:query_execution_end
フックは以下のパラメーターを受け取ります。
| パラメーター | 説明 | 例 |
|---|---|---|
$querySlug | 実行するクエリのスラッグ | translate-customposts |
$queryVariables | クエリに渡される変数 | ['customPostIds' => [123, 456], ...] |
gatompl:query_execution_start
クエリが実行される直前にトリガーされます。
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
クエリが実行された直後にトリガーされます。
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
);クエリスラッグ
サポートされているクエリスラッグは以下のとおりです。
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
Prev
Next