Exemplo n.º 1
0
 /**
  * @param $event_id
  */
 protected function get_event_root($event_id)
 {
     $event_root = get_post_meta($event_id, $this->root_meta_key, true);
     if (empty($event_root)) {
         $event_post = get_post($event_id);
         $event_root = $this->pool->generate_unique_root($event_post);
         update_post_meta($event_id, $this->root_meta_key, $event_root);
     }
     return $event_root;
 }
Exemplo n.º 2
0
 /**
  * Primes the post pool.
  *
  * @param array $pool
  * @param bool  $override_transient If `true` the transient too will be overwritten.
  */
 public function set_pool(array $pool, $override_transient = false)
 {
     self::$prefix_pool = $pool;
     if ($override_transient) {
         set_transient($this->pool_transient_name, $pool);
     }
 }