Created
March 12, 2012 18:13
-
-
Save tollmanz/2023731 to your computer and use it in GitHub Desktop.
Return values for memcache in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'test' ); | |
function test() { | |
// Returns bool( false ) | |
set_transient( 'test-trans-false', false, 5 ); | |
get_transient( 'test-trans-false' ); | |
// Return bool( false ) | |
set_transient( 'test-trans-true', true, 5 ); | |
get_transient( 'test-trans-true' ); | |
// Return bool( false ) | |
set_transient( 'test-trans-0', 0, 5 ); | |
get_transient( 'test-trans-0' ); | |
// Return int( 1 ) | |
set_transient( 'test-trans-1', 1, 5 ); | |
get_transient( 'test-trans-1' ); | |
// Return string( 'no' ) | |
set_transient( 'test-trans-no', 'no', 5 ); | |
get_transient( 'test-trans-no' ); | |
// Return string( 'yes' ) | |
set_transient( 'test-trans-yes', 'yes', 5 ); | |
get_transient( 'test-trans-yes' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment