Notifications
Clear all

How to make error/success notices last longer

5 Posts
2 Users
2 Likes
216 Views
JorgeW
Posts: 96
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

4 Replies
JorgeW
Posts: 96
Topic starter
(@jorgew)
Estimable Member
Joined: 5 years ago
Reply
Posts: 952
Moderator
(@martin)
Support Team
Joined: 7 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);
Reply
JorgeW
Posts: 96
Topic starter
(@jorgew)
Estimable Member
Joined: 5 years ago

Posted by: @martin

The error message duration is currently set 8 seconds

 

1 - The mixed notice (error - success) I posted above didn't last 8sec,  but just 1 sec or even less.

2 - Will try your hook and report later, thanks.  

 

Reply
JorgeW
Posts: 96
Topic starter
(@jorgew)
Estimable Member
Joined: 5 years ago

@martin,

I tested your hook and it seems to work fine (10sec display) when dealing with normal notices like trying to post an empty post (error) or posting a correct one (success).

Nonetheless the mentioned mixed one (error-success) keeps lasting no more than ONE second.

 

These are some examples of situations that I tried:

 

A - I tried to post a topic with its title ok but with an empty body.

  • Error notice lasts 10sec. (as expected!)

 

B - I posted a topic with its title and body both correct.

  • Success notice lasts 10sec. (as expected!)

 

C - I successfully deleted an existing posted topic with NO replies.

  • Success notice lasts 10sec. (as expected!)

 

D - I successfully deleted an existing posted topic with only ONE reply.

  • Success notice lasts 1sec. (to short!!)

  

D - I successfully deleted an existing posted topic with TWO or more replies.

  • Error notice "Post delete error" lasts 1sec. 
  • Success notices (three) lasts 1sec. (both error & success notices at the same time, to short!!)

 

It seems that when deleting a post with one or more replies notices will last only ONE second.

 

What should I do?

 

PS: I will treat the strange "Post delete error" when successfully deleting a post in another topic.

 

 

Reply