1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11: function papi_cache_delete( $key, $suffix ) {
12: return wp_cache_delete( papi_cache_key( $key, $suffix ) );
13: }
14:
15: 16: 17: 18: 19: 20: 21: 22:
23: function papi_cache_get( $key, $suffix ) {
24: return wp_cache_get( papi_cache_key( $key, $suffix ) );
25: }
26:
27: 28: 29: 30: 31: 32: 33: 34:
35: function papi_cache_key( $key, $suffix ) {
36: if ( ! is_string( $key ) ) {
37: return '';
38: }
39:
40: $key = papify( $key );
41: $suffix = papi_convert_to_string( $suffix );
42: $suffix = papi_html_name( $suffix );
43: $suffix = papi_remove_papi( $suffix );
44:
45: return sprintf( '%s_%s', $key, $suffix );
46: }
47:
48: 49: 50: 51: 52: 53: 54: 55: 56:
57: function papi_cache_set( $key, $suffix, $value ) {
58: return wp_cache_set( papi_cache_key( $key, $suffix ), $value );
59: }
60: