Is there any way to guarantee that when I call get_option I will definitely get the value from the database and not from cache?

2 Answers
2

You could delete an existing cache for your option before you call get_option():

$GLOBALS['wp_object_cache']->delete( 'your_option_name', 'options' );
$value = get_option( 'your_option_name' );

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *