function add_to_context($context)
 {
     $context['current_url'] = TimberHelper::get_current_url();
     $context['pagination'] = Timber::get_pagination();
     $context['bethel_header_menu'] = new TimberMenu('primary');
     $context['bethel_sidebar_menu'] = new TimberMenu('sidebar');
     $context['site'] = $this;
     return $context;
 }
Example #2
0
 function load_json($json_file)
 {
     if (file_exists($json_file)) {
         $json = file_get_contents($json_file);
         $json = json_decode($json);
         foreach ($json->bricks as &$brick) {
             $brick = new ZoneboardBlock($brick);
         }
         $this->json_data = $json;
         $this->_bricks = $json->bricks;
     } else {
         if (is_admin()) {
             $url = TimberHelper::get_current_url();
             $parts = parse_url($url);
             if (isset($parts['query']) && $parts['query'] == 'page=zoneboard' || isset($parts['path']) && strpos($parts['path'], 'wp-admin/plugins.php')) {
                 $this->show_message_for_missing_json_file($json_file);
             }
         }
     }
 }