/**
  * Ensures that only posts and not pages are returned
  * WP stores posts and pages in the same DB table
  *
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->getSelect()->order('menu_order ASC');
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Ensure that is any pages are in the collection, they are correctly cast
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     $this->getResource()->preparePosts($this->_items);
     return $this;
 }