In realtà, non c'è bisogno di modificare qualsiasi file core per fare questo. Basta inserire questi filtri e due funzioni minuscole nel file functions.php
del tuo tema e i commenti duplicati non verranno più rifiutati.
add_filter('wp_die_handler', 'my_wp_die_handler_function', 9); //9 means you can unhook the default before it fires
function my_wp_die_handler_function($function) {
return 'my_skip_dupes_function'; //use our "die" handler instead (where we won't die)
}
//check to make sure we're only filtering out die requests for the "Duplicate" error we care about
function my_skip_dupes_function($message, $title, $args) {
if (strpos($message, 'Duplicate comment detected') === 0) { //make sure we only prevent death on the $dupe check
remove_filter('wp_die_handler', '_default_wp_die_handler'); //don't die
}
return; //nothing will happen
}
Ciò significa che se lo stesso autore scrive più di un commento sullo stesso post, viene considerato un duplicato. Il che è semplicemente sbagliato! Ma grazie per la tua risposta. – codecowboy