start setting up directory transient
This commit is contained in:
parent
1bfb77ea8e
commit
b6abe31182
1 changed files with 13 additions and 1 deletions
|
@ -29,7 +29,19 @@ get_header();
|
|||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
// Directory
|
||||
// Directory transient
|
||||
|
||||
//define transient name - taxid + user state.
|
||||
$transient_name = 'directory-' . is_user_logged_in();
|
||||
if ( current_user_can('administrator') && WP_DEBUG ) {
|
||||
$transient_name = time();
|
||||
}
|
||||
//use transient to cache data
|
||||
if ( false === ( $the_directory = get_transient( $transient_name ) ) ) {
|
||||
$the_directory = 'test';
|
||||
set_transient( $transient_name, $the_directory, 24 * HOUR_IN_SECONDS );
|
||||
}
|
||||
|
||||
/* Start the Loop */
|
||||
$args = array(
|
||||
'orderby' => 'meta_value',
|
||||
|
|
Loading…
Reference in a new issue