maybe_add_column()
maybe_add_column( string $table_name, string $column_name, string $create_ddl )
将列添加到数据库表(如果该表不存在)。
Adds column to a database table if it doesn’t already exist.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$table_name | (string) | 必需 | 要修改的表名。 |
$column_name | (string) | 必需 | 要添加到表中的列名。 |
$create_ddl | (string) | 必需 | 用于添加列的SQL语句。 |
返回(Return)
(bool)如果已存在或成功完成,则为True;如果出错,则为false。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
1.3.0 | wp-admin/includes/upgrade.php:2400 | 0 | 2 |
maybe_add_column() 为WP2原创文章,链接:https://www.wp2.cn/functions/maybe_add_column/