Skip to content

Instantly share code, notes, and snippets.

@anthonybudd
Created July 12, 2017 08:14
Show Gist options
  • Select an option

  • Save anthonybudd/1c336f3efb424d197f25cd55d49589b8 to your computer and use it in GitHub Desktop.

Select an option

Save anthonybudd/1c336f3efb424d197f25cd55d49589b8 to your computer and use it in GitHub Desktop.
<?php
Class Event extends WP_Model{
public $postType = 'event';
public $attributes = [
'start_date',
];
public function _finderArchive($args){
$args = array_merge([
'page' => 1,
], $args);
return [
'paged' => $args['page'],
'posts_per_page' => '5',
];
}
}
$events = Event::finder('archive', [
'page' => 1,
]);
dd($products); // [Event, Event, Event];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment