TPost

The Eewee responsive design TPost class.

Defined (1)

The class is defined in the following location(s).

/inc/models/TPost.php  
  1. class TPost{ 
  2.  
  3. public function __construct() {} 
  4.  
  5. /** 
  6. * return categ list 
  7. * @param array $args 
  8. */ 
  9. public function getCategList($args=array()) { 
  10. $defaults = array( 
  11. 'type' => 'post',  
  12. 'child_of' => 0,  
  13. 'parent' => '',  
  14. 'orderby' => 'name',  
  15. 'order' => 'ASC',  
  16. 'hide_empty' => 1,  
  17. 'hierarchical' => 1,  
  18. 'exclude' => '',  
  19. 'include' => '',  
  20. 'number' => '',  
  21. 'taxonomy' => 'category',  
  22. 'pad_counts' => false ); 
  23. $tbl = array_merge($defaults, $args); 
  24. return get_categories( $tbl ); 
  25.  
  26. /** 
  27. * return last news 
  28. * @param array $args 
  29. */ 
  30. public function getPosts($args=array()) { 
  31. $defaults = array( 
  32. 'numberposts' => 3,  
  33. 'offset' => 0,  
  34. 'category' => '',  
  35. 'orderby' => 'post_date',  
  36. 'order' => 'DESC',  
  37. 'include' => '',  
  38. 'exclude' => '',  
  39. 'meta_key' => '',  
  40. 'meta_value' => '',  
  41. 'post_type' => 'post',  
  42. 'post_mime_type' => '',  
  43. 'post_parent' => '',  
  44. 'post_status' => 'publish' ); 
  45. $tbl = array_merge($defaults, $args); 
  46. return get_posts( $tbl ); 
  47.  
  48. }//fin class