Skip to content

Commit

Permalink
PLUGINS-6870
Browse files Browse the repository at this point in the history
  • Loading branch information
meteor-ec committed Jun 20, 2024
1 parent 2e0c409 commit 7d97ed6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ecwid_platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,19 @@ public static function cache_set( $name, $value, $expires_after = 0 ) {
'expires' => $expires_after,
)
);
self::encode_emoji( $value );

set_transient( 'ecwid_' . $name, $value, $expires_after );
}

public static function encode_emoji( &$item, $key = false ) { //phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
if ( is_object( $item ) || is_array( $item ) ) {
array_walk_recursive( $item, 'self::encode_emoji' );
} elseif ( is_string( $item ) ) {
$item = wp_encode_emoji( $item );
}
}

public static function cache_reset( $name ) {
self::cache_log_record( 'reset', array( 'name' => $name ) );
delete_transient( 'ecwid_' . $name );
Expand Down

0 comments on commit 7d97ed6

Please sign in to comment.