我在很多网站上都使用过这个插件,而且效果很好。它阻止了重复帖子的创建,但我现在正在开发的站点是pinterest克隆,它不能与repins一起使用。插件不再受支持,这就是为什么我在这里问这个问题。这是否可以仅用于一个类别?我有一个类别可以作为博客使用,其余的类别都是针对网站的pinterest端
function superPostCleaner(){
global $wpdb;
$prefix = $wpdb->prefix;
$wpdb->query("DELETE a.*
FROM ".$prefix."posts AS a
INNER JOIN (SELECT Greater1.post_title, Titles.ID, Greater1.MinID FROM (SELECT post_title, MIN(ID) AS \'MinID\', MAX(ID) AS \'MaxID\' FROM ".$prefix."posts WHERE post_type = \'post\' AND post_status = \'publish\'
GROUP BY post_title HAVING COUNT(post_title)>1) AS Greater1
LEFT JOIN (SELECT post_title, ID FROM ".$prefix."posts) AS Titles
ON Greater1.post_title = Titles.post_title WHERE ID > MinID) AS b ON a.ID = b.ID WHERE a.ID = b.ID");
}
add_action(\'publish_post\', \'superPostCleaner\');