Notifications
Clear all

Script [Closed] How to make error/success notices last longer

3 Posts
2 Users
2 Reactions
518 Views
JorgeW
Posts: 105
Topic starter
(@jorgew)
Estimable Member
Joined: 5 years ago

Hi @robert, @chris,

How can I give more time to read the notices that appear on top-right confirming actions, like post submitted, post edited, and especially when there was an error?

Currently users have about 1sec (I guess) to read those messages.

Thanks

2 Replies
JorgeW
Posts: 105
Topic starter
(@jorgew)
Estimable Member
Joined: 5 years ago
Posts: 986
Moderator
(@martin)
Support Team
Joined: 8 years ago

Hi @jorgew,

The error message duration is currently set 8 seconds. You can manage them using following hook codes in a PHP code snippet of the Code Snippets plugin:

function custom_wpforo_error_message_duration( $duration_in_milliseconds ){
	$duration_in_milliseconds = 10000; //10 seconds. 1000 is one second
	return $duration_in_milliseconds;
}
add_filter( 'wpforo_notice_timeout_error', 'custom_wpforo_error_message_duration', 11);

function custom_wpforo_success_message_duration( $duration_in_milliseconds ){
	$duration_in_milliseconds = 10000; //10 seconds. 1000 is one second
	return $duration_in_milliseconds;
}
add_filter( 'wpforo_notice_timeout_success', 'custom_wpforo_success_message_duration', 11);