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 32 33 34 35
<?php
namespace hji\geofarms\controllers;
use \hji\geofarms\GeoFarms;
use \hji\geofarms\models\CMB as CMBModel;
use \hji\membership\Membership;
use \hji\common\utils\MetaBoxes;
require_once(GeoFarms::$models . '/CMB.php');
class CMB
{
private $model;
public function __construct()
{
$this->model = new CMBModel();
add_action('init', array($this, 'cmb_initialize_cmb_meta_boxes'));
add_filter('tiny_mce_before_init', array($this->model, 'cmb_metaboxes_wysiwyg_before_init'), 10, 2);
}
public function cmb_initialize_cmb_meta_boxes()
{
require_once Membership::$dir . '/common/utils/MetaBoxes.php';
MetaBoxes::add($this->model->cmb_metaboxes());
}
}