1 | <?php |
||
7 | class Sidebar_Field extends Select_Field { |
||
8 | |||
9 | /** |
||
10 | * Allow the user to add new sidebars |
||
11 | * |
||
12 | * @var boolean |
||
13 | */ |
||
14 | private $enable_add_new = true; |
||
15 | |||
16 | /** |
||
17 | * Array of sidebars to exclude from the select menu |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | private $excluded_sidebars = array(); |
||
22 | |||
23 | /** |
||
24 | * {@inheritDoc} |
||
25 | */ |
||
26 | protected function load_options() { |
||
40 | |||
41 | /** |
||
42 | * Disable adding new sidebars. |
||
43 | * |
||
44 | * @return self $this |
||
45 | */ |
||
46 | public function disable_add_new() { |
||
50 | |||
51 | /** |
||
52 | * Specify sidebars to be excluded. |
||
53 | * |
||
54 | * @param array $sidebars |
||
55 | * @return self $this |
||
56 | */ |
||
57 | public function set_excluded_sidebars( $sidebars ) { |
||
61 | |||
62 | /** |
||
63 | * Returns an array that holds the field data, suitable for JSON representation. |
||
64 | * |
||
65 | * @param bool $load Should the value be loaded from the database or use the value from the current instance. |
||
66 | * @return array |
||
67 | */ |
||
68 | public function to_json( $load ) { |
||
95 | } |
||
96 |