global $wpdb;
$wp_tables = array();
$pattern = '/^'. preg_quote($wpdb->prefix, '/') . '/i';
$tables = $wpdb->get_col('SHOW TABLES');
foreach ( $tables as $table ) {
if ( preg_match( $pattern, $table ) ) {
$wp_tables[] = $table;
}
}
[WordPress] 使用している全テーブルを取得
by
コメントを残す