WOOF :: cache( String $name, Mixed $value = null, Integer $expires = 600, Boolean $json = false )


  • Mixed The cached value, or the value to cache if a value is provided.
  • Boolean false if no value is provided, and no transient is currently cached, or has the cached value has expired.

An more concise API terminology for the WordPress Transients API to retrieve OR store a value in a transient for a given amount of time.  

If a value is not provided in the second argument, this method will get the value of the transient of the given name (if any).

If a value is provided in the second argument, this method will set the value of the transient against the given name.



  • String $name

    The name of the cached item to check for

  • Mixed $value = null

    The value to store, if any. If this value is not provided, it is assumed you’re trying to retrieve it.

  • Integer $expires = 600

    For setting a value only. Either an integer number of seconds to store the transient, or a string describing the time period, as parsed by the WOOF::seconds function (see related methods).

  • Boolean $json = false

    If true, the value will be encoded to JSON if being stored, or decoded from JSON if being retrieved.

Latest From the Blog

MasterPress 1.3.8 is now available

16th December 2022

MasterPress 1.3.8 is a bugfix release. Fixed a bug where MB, KB, and GB were being converted to bytes incorrectly via WOOF file functions. Fixed a bug where transparent images were losing their transparency on resize.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM