Ejemplo n.º 1
0
 /**
  * Outputs the entire chunk of Page Blocks
  * @author Andi Ruggles <*****@*****.**>
  * @author Mark Furrow
  */
 public static function output()
 {
     $page_block_rows = '';
     // Gets the current page id
     $page_id = get_queried_object_id();
     $posts = get_field('page_blocks_join', $page_id);
     if ($posts) {
         foreach ($posts as $p) {
             // variable must be called $post (IMPORTANT)
             $columns = '';
             self::$ID = $p->ID;
             self::$layout = get_field('layout', self::$ID);
             self::$has_flag = get_field('add_flag', self::$ID);
             // Hidden?
             if (get_field('hidden', self::$ID) != 'yes') {
                 // Set Header Data
                 self::setHeader();
                 // Set Column Data
                 self::setColumnsData();
                 // Display For: One, Two, or Three Cols
                 $columns = self::formatColumns();
                 // Build collection of Rows
                 $page_block_rows .= self::formatRow($columns);
             }
             $return = '
                 <div id="pageBlocks">
                     ' . $page_block_rows . '
                 </div>
             ';
         }
     }
     echo $return;
 }