woocommerce-multilingual
/
addons
/
wpml-dependencies
/
vendor
/
wpml
/
wp
/
classes
/
Transient.php
woocommerce-multilingual
/
addons
/
wpml-dependencies
/
vendor
/
wpml
/
wp
/
classes
Last commit date
Attachment.php
1 month ago
Cache.php
1 month ago
Gutenberg.php
1 month ago
Hooks.php
1 month ago
Http.php
1 month ago
Nonce.php
1 month ago
Option.php
1 month ago
Post.php
1 month ago
PostType.php
1 month ago
Resources.php
1 month ago
Roles.php
4 years ago
Transient.php
1 month ago
Url.php
1 month ago
User.php
1 month ago
WP.php
1 month ago
WPDB.php
1 month ago
Transient.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPML\LIB\WP; |
| 4 | |
| 5 | use WPML\Collect\Support\Traits\Macroable; |
| 6 | use function WPML\FP\curryN; |
| 7 | |
| 8 | class Transient { |
| 9 | use Macroable; |
| 10 | |
| 11 | public static function init() { |
| 12 | self::macro( 'get', curryN( 1, 'get_transient' ) ); |
| 13 | self::macro( 'getOr', curryN( 2, function ( $key, $default ) { |
| 14 | return self::get( $key ) ?: $default; |
| 15 | } ) ); |
| 16 | |
| 17 | self::macro( 'set', curryN( 3, 'set_transient' ) ); |
| 18 | self::macro( 'delete', curryN( 1, 'delete_transient' ) ); |
| 19 | } |
| 20 | |
| 21 | } |
| 22 | |
| 23 | Transient::init(); |