1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83:
<?php
defined( 'ABSPATH' ) || exit;
if ( ! function_exists( 'vsp_slashit' ) ) {
/**
* Appends a trailing slash.
*
* @param string $path
*
* @return string
*/
function vsp_slashit( $path ) {
return trailingslashit( $path );
}
}
if ( ! function_exists( 'vsp_unslashit' ) ) {
/**
* Removes trailing forward slashes and backslashes if they exist.
*
* @param string $path
*
* @return string
*/
function vsp_unslashit( $path ) {
return untrailingslashit( $path );
}
}
if ( ! function_exists( 'vsp_set_cache' ) ) {
/**
* Set Data Cache For Given Cache ID
*
* @param string $key cache_id.
* @param mixed $value
*
* @return mixed
*/
function vsp_set_cache( $key, $value ) {
return wponion_set_cache( $key, $value );
}
}
if ( ! function_exists( 'vsp_get_cache_defaults' ) ) {
/**
* Set Cache With Defaults.
*
* @param string $key cache_id.
* @param mixed $defaults
*
* @return bool|mixed
*/
function vsp_get_cache_defaults( $key, $defaults = false ) {
return wponion_get_cache_defaults( $key, $defaults );
}
}
if ( ! function_exists( 'vsp_get_cache' ) ) {
/**
* Fetch & Returns Cached Data.
*
* @param string $key cache_id.
*
* @return mixed
* @throws \WPOnion\Exception\Cache_Not_Found
*/
function vsp_get_cache( $key ) {
return wponion_get_cache( $key );
}
}
if ( ! function_exists( 'vsp_delete_cache' ) ) {
/**
* Deletes Cached Data For Given Key.
*
* @param string $key cache_id.
*/
function vsp_delete_cache( $key ) {
wponion_delete_cache( $key );
}
}