Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions time-stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ public static function get_data( $clear = false ) {

if ( function_exists( 'apc_store' ) && apc_store( '__test', '123' ) ) {
$data = apc_fetch( '_hm_all_stacks' );
} else {
} elseif ( wp_using_ext_object_cache() ) {
$data = wp_cache_get( '_hm_all_stacks' );
} else {
$data = get_transient( '_hm_all_stacks' );
}

if ( $clear )
Expand All @@ -39,8 +41,10 @@ public static function set_data( $data ) {

if ( function_exists( 'apc_store' ) && apc_store( '__test', '123' ) ) {
return apc_store( '_hm_all_stacks', $data, 60 );
} else {
} elseif ( wp_using_ext_object_cache() ) {
return wp_cache_set( '_hm_all_stacks', $data, null, 60 );
} else {
return set_transient( '_hm_all_stacks', $data, 60 );
}
}

Expand Down