Advertisement
websupporter

use the wp transient api

Apr 30th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None | 0 0
  1. <?php
  2. if ( false === ( $value = get_transient( 'transient-name' ) ) ) {
  3.     /** very complex and cpu consuming code **/
  4.     $value = 'result of process';
  5.     set_transient( 'transient-name', $value, 12 * HOUR_IN_SECONDS );
  6. }
  7. echo $value;
  8. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement