Hello,
no I haven’t updated any plugins other than yours. How can a comment be added successfully if it’s empty?
I just realized what the problem is -but have no idea how to fix this; I am using the following code to add my custom error page – because I am using the easy digital download page that uses the horrible wp_die function. Removing the following code from my functions.php seems to solve my problem:
add_filter('wp_die_handler', 'get_my_error_handler');
function get_my_error_handler() {
return 'my_error_handler';
}
function my_error_handler($message, $title='', $args=array()) {
$errorTemplate = get_theme_root().'/'.get_template().'/commenterror.php';
if(!is_admin() && file_exists($errorTemplate)) {
$defaults = array( 'response' => 500 );
$r = wp_parse_args($args, $defaults);
$have_gettext = function_exists('__');
if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
if ( empty( $title ) ) {
$error_data = $message->get_error_data();
if ( is_array( $error_data ) && isset( $error_data['title'] ) )
$title = $error_data['title'];
}
$errors = $message->get_error_messages();
switch ( count( $errors ) ) :
case 0 :
$message = '';
break;
case 1 :
$message = "<p>{$errors[0]}</p>";
break;
default :
$message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>";
break;
endswitch;
} elseif ( is_string( $message ) ) {
$message = "<p>$message</p>";
}
if ( empty($title) )
$title = $have_gettext ? __('<strong>An error has been encountered!</strong>') : 'WordPress › Error';
require_once($errorTemplate);
die();
} else {
_default_wp_die_handler($message, $title, $args);
}
}
any idea on how to have them both working properly?