/** * set class instance * @param $inst: an object instanceof this class */ public static function setInstance($inst) { if ($inst instanceof HW_Templates_Metabox) { self::$instance = $inst; } }
/** * init metaboxs */ public static function init_metabox() { if (is_admin()) { global $current_user; if (class_exists('HW_Templates_Manager') && class_exists('HW_Templates_Metabox') && current_user_can('administrator')) { new HW_Templates_Manager(HW_Templates_Manager::post_type); // the post type slug HW_Templates_Metabox::setInstance(new HW_Templates_Metabox(null, __('Thêm template động'), array(HW_Templates_Manager::post_type), 'normal', 'low')); //add new metabox new HW_Templates_Metabox(null, __('Hướng dẫn'), array(HW_Templates_Manager::post_type), 'normal', 'low'); } } }