query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE '_transient_{$transient_id}%'" ); // WPCS: unprepared SQL ok. } /** * Prepare a cache key * * @since 1.5.0 * * @param string $name The cache name. * @param array $args Optional. The args to hash. * * @return string */ private static function prepare_key( $name, $args ) { $key = 0 !== strpos( $name, ATUM_PREFIX ) ? ATUM_PREFIX . $name : $name; if ( ! empty( $args ) ) { if ( '_' !== substr( $key, -1, 1 ) ) { $key .= '_'; } // Get md5 hash of the array of args to create unique transient key. $key .= md5( maybe_serialize( $args ) ); } return $key; } /** * Whether the ATUM cache is actually disabled * * @since 1.5.8 * * @return bool */ public static function is_cache_disabled() { return self::$disable_cache; } /** * Set the disable cache prop * * @since 1.5.8 * * @param bool $disable_cache */ public static function set_disable_cache( $disable_cache ) { self::$disable_cache = $disable_cache; } /** * Enable the ATUM Cache * * @since 1.5.8 */ public static function enable_cache() { self::$disable_cache = FALSE; } /** * Disable the ATUM Cache * * @since 1.5.8 */ public static function disable_cache() { self::$disable_cache = TRUE; } }