我正在测试创建数据库插入的脚本。这是插入的正确语法吗?还是我需要获取对global$wpdb的引用并使用它?
<?php
/*
Plugin Name: Test Database Insert
*/
function test_db_insert()
{
INSERT wp_terms(term_id, \'name\', slug) VALUES (1, \'test\', \'test\');
INSERT wp_term_taxonomy(term_taxonomy_id, term_id, taxonomy, parent) VALUES (1, 1, \'category\', 0);
INSERT wp_term_relationships(object_id, term_taxonomy_id, term_order) VALUES (1, 1, 0);
}
register_activation_hook(__FILE__, \'test_db_insert\');