Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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' );
share|improve this answer
    
not wp_cache_delete()? –  djb May 20 '13 at 9:59
    
ah, it's the same anyway. thanks –  djb May 20 '13 at 10:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.