Пример #1
0
 public function get_grids($query = false)
 {
     // Check if this is already a grid
     // Happens when default is passed through the shortcode
     if (is_array($query) && is_array(reset($query))) {
         return $query;
     }
     $posts = $this->_get_grid_posts($query);
     // If no posts are found, use fallback grid
     if (empty($posts)) {
         return array('Default' => Admin\GridTemplates::get_default_template());
     }
     $grids = array();
     foreach ($posts as $post) {
         $grids[$post->post_title] = $this->format_grid($post->post_content);
     }
     return $grids;
 }