Extend a single base class to get started using the power of Fresa's PostModel
class. Register a custom post type in one line instead of 30.
Fresa embraces the existing WordPress API and extends it into a set of fluent, configurable interfaces.
Extend a single base class to get started using the power of Fresa's PostModel
class. Register a custom post type in one line instead of 30.
use Fresa\PostModel;
class Event extends PostModel
{
protected $postType = 'event';
}
Event::register();
Set default WordPress properties with a shorter syntax. Assign meta values in a single line. Persist all of your data with a single method.
$event = new Event;
$event->title = 'A Fun Party';
$event->content = 'Come hang with us!';
$event->venue = 'Central Park';
$event->save();
Leverage Fresa's model syntax to perform fluent queries of existing WordPress data. Apply limits, orders and offsets in the same query. Iterate over results returned as Collection
instances.
$events = Event::where('venue', 'Central Park')
->order('start', 'asc')
->limit(5)
->offset(5)
->get();
foreach ($events as $event) {
echo $event->title;
}
Get notified of new features