如果创建新表的代码使用dbDelta()
(应该),您可以筛选查询(请参见wp-admin/includes/upgrade.php
):
add_filter( \'dbdelta_create_queries\', function( Array $queries )
{
foreach ( $queries as $table => $query )
{
if ( FALSE !== stripos( $query, \'CREATE TABLE\' ) )
{
// change the query here
}
}
return $queries;
});