我在数据库中有不同的表,称为“wp\\U taxterms”。如何在每次创建“客户机”下的新闻分类术语或更新/删除现有术语时插入该表?
编辑:
if( isset($_GET[\'page\']) && ($_GET[\'page\']=="export-clients") ) {
global $wpdb;
$result = $wpdb->get_results("SELECT * FROM wp_special");
$categories = get_terms( \'clients\' );
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\\"Clients.csv\\";" );
header("Content-Transfer-Encoding: binary");
//create a file pointer connected to the output stream
$output = fopen(\'php://output\', \'w\');
//output the column headings
fputcsv($output, array(\'Name\', \'Address\', \'Email\', \'Contact\'));
foreach($categories as $cat) {
fputcsv($output, array($cat->name, $cat->description, $cat->email, $cat->contact) );
}
fclose($output);
exit;
}//endif