1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<?php
namespace hji\geofarms\controllers;
use \hji\geofarms\GeoFarms;
use \hji\membership\Membership;
use \hji\geofarms\models\Slipstream as SlipstreamModel;
require_once(GeoFarms::$models . '/Slipstream.php');
require_once(Membership::$dir . '/common/utils/Views.php');
class Slipstream
{
private $model;
public function __construct()
{
$this->model = new SlipstreamModel();
add_action('add_meta_boxes', array($this->model, 'add_meta_boxes'));
add_action('edit_post', array($this->model, 'edit_post'), 10, 2);
add_action('admin_enqueue_scripts', array($this->model, 'loadPostEditScripts'));
add_action('wp_insert_post', array($this->model, 'save_post'), 99, 3);
add_action('trashed_post', array($this->model, 'trashed_post'), 10, 1);
add_action('wp_ajax__searchNeighborhoods', array($this->model, '_searchNeighborhoods'));
add_action('wp_ajax__lookupAreas', array($this->model, '_lookupAreas'));
add_action('wp_ajax__getArea', array($this->model, '_getArea'));
add_action('wp_ajax__getMarket', array($this->model, '_getMarket'));
}
}