add_action('publish_post','publish_article');
function publish_article( $post_ID )
{
return file_put_contents('123publish.txt',var_export($post_ID,true));
}
add_action('trash_post','trash_article');
function trash_article($post_ID){
return file_put_contents('123trash.txt',var_export($post_ID,true));
}
add_action('untrash_post','untrash_article');
function untrash_article($post_ID){
return file_put_contents('123untrash.txt',var_export($post_ID,true));
}
add_action('before_delete_post', 'delete_article');
function delete_article($post_ID){
$txt = "删除数据";
return file_put_contents('123delete.txt',var_export($post_ID,true).var_export($txt,TRUE));
}