start setting up directory transient

This commit is contained in:
Evan Mullins 2019-03-19 07:43:36 -06:00
parent 1bfb77ea8e
commit b6abe31182

View file

@ -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',