PluginProbe
Admin Bar Editor – Toolbar Customization with User Role based access & Custom menus / trunk
Admin Bar Editor – Toolbar Customization with User Role based access & Custom menus vtrunk
1.1.10 1.1.9 1.1.8 1.1.7 trunk 1.0 1.0.1 1.0.2.1 1.0.2.2 1.0.2.3 1.0.2.4 1.0.2.5 1.0.2.6 1.0.2.7 1.0.2.8 1.0.2.9 1.0.3.0 1.0.4.0 1.1.0 1.1.2 1.1.2.0 1.1.2.1 1.1.2.2 1.1.3 1.1.4 All 27 releases
admin-bar / Inc / Base_Model.php

Base_Model.php in Admin Bar Editor – Toolbar Customization with User Role based access & Custom menus trunk, at Inc/Base_Model.php

37 lines 655 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace JewelTheme\AdminBarEditor\Inc;
4
5 if (!defined('ABSPATH')) exit;
6
7 abstract class Base_Model extends Base_Data
8 {
9
10 protected function init($data)
11 {
12 $this->set(array_merge($this->get_defaults(), $data));
13 }
14
15 public static function _get_defaults()
16 {
17 return [];
18 }
19
20 public function get_default_field($field)
21 {
22 $fields = $this->get_defaults();
23 return isset($fields[$field]) ? $fields[$field] : null;
24 }
25
26 public static function _get_default_field($field)
27 {
28 $fields = self::_get_defaults();
29 return isset($fields[$field]) ? $fields[$field] : null;
30 }
31
32 public function __construct($data)
33 {
34 if ($data) $this->init($data);
35 }
36 }
37