对WordPress wp_create_category($string_value, $int_value)
的PHP调用将立即转到__destruct
。
我在try{...} catch
中包装了这一行,但这并没有改变任何东西。它仍然直接转到__destruct
而没有通过“GO”或收取200美元。
答案 0 :(得分:0)
你应该使用wp_insert_term。
$arg = array('description' => "my description", 'parent' => "cat_ID");
$new_cat_id = wp_insert_term("cat name", "category", $arg);