cdbt_after_table_truncated

(CDBT 2.0.0)

cdbt_after_table_truncatedテーブルの全データ削除後にフックします

Description

 cdbt_after_table_truncated ( bool $result [, string $table_name ] )
テーブルの全データ削除後にフックします。

Parameters

result
全データ削除の処理結果を参照できます。
table_name
全データ削除の対象テーブル名を参照できます。

History

バージョン 内容
2.0.0 新規追加

Example

特定テーブルの初期化成功後にリダイレクトを行う

<?php
function custom_action_after_truncate_table( $result, $table_name ) {
  if ( $result && 'prefix_table' === $table_name ) {
    header( 'Location: http://www.example.com/' );
    exit;
  }
}
add_action( 'cdbt_after_table_truncated', 'custom_action_after_truncate_table', 10, 2 );

Hook Point