private static function read_cookie()
 {
     if (empty($_COOKIE[self::NAME])) {
         return;
     }
     $data = $_COOKIE[self::NAME];
     // No referrer
     if (!isset($data['query'])) {
         return;
     }
     $data['query'] = json_decode(stripslashes($data['query']), true);
     // JSON is invalid
     if (is_null($data['query'])) {
         return;
     }
     self::$data = $data;
     self::$cache['same'] = self::get_posts(array('_sn_post' => get_queried_object(), '_sn_op' => '=', 'order' => 'ASC', 'fields' => 'ids', 'nopaging' => true));
     // The current post doesn't belong to the group
     if (!in_array(get_queried_object_id(), self::$cache['same'])) {
         self::$data = false;
     }
 }
Example #2
0
function get_referrer_url()
{
    return Smarter_Navigation::get_referrer_url();
}