← All changes
|
modules/atomic-widgets/controls/section.php
+3
-24
4.1.0-dev2
→
3.26.0-dev5
View file →
| @@ -3,13 +3,12 @@ | ||
| 3 | 3 | |
| 4 | 4 | use JsonSerializable; |
| 5 | 5 | |
| 6 | 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | - exit; // Exit if accessed directly. | |
| 7 | + exit; // Exit if accessed directly | |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | class Section implements JsonSerializable { |
| 11 | - private ?string $id = null; | |
| 12 | 11 | private $label = null; |
| 13 | 12 | private $description = null; |
| 14 | 13 | private array $items = []; |
| 15 | 14 | |
| @@ -16,30 +15,16 @@ | ||
| 16 | 15 | public static function make(): self { |
| 17 | 16 | return new static(); |
| 18 | 17 | } |
| 19 | 18 | |
| 20 | - public function set_id( string $id ): self { | |
| 21 | - $this->id = $id; | |
| 22 | - | |
| 23 | - return $this; | |
| 24 | - } | |
| 25 | - | |
| 26 | - public function get_id() { | |
| 27 | - return $this->id; | |
| 28 | - } | |
| 29 | - | |
| 30 | 19 | public function set_label( string $label ): self { |
| 31 | - $this->label = html_entity_decode( $label ); | |
| 20 | + $this->label = $label; | |
| 32 | 21 | |
| 33 | 22 | return $this; |
| 34 | 23 | } |
| 35 | 24 | |
| 36 | - public function get_label(): ?string { | |
| 37 | - return $this->label; | |
| 38 | - } | |
| 39 | - | |
| 40 | 25 | public function set_description( string $description ): self { |
| 41 | - $this->description = html_entity_decode( $description ); | |
| 26 | + $this->description = $description; | |
| 42 | 27 | |
| 43 | 28 | return $this; |
| 44 | 29 | } |
| 45 | 30 | |
| @@ -44,14 +29,8 @@ | ||
| 44 | 29 | } |
| 45 | 30 | |
| 46 | 31 | public function set_items( array $items ): self { |
| 47 | 32 | $this->items = $items; |
| 48 | - | |
| 49 | - return $this; | |
| 50 | - } | |
| 51 | - | |
| 52 | - public function add_item( $item ): self { | |
| 53 | - $this->items[] = $item; | |
| 54 | 33 | |
| 55 | 34 | return $this; |
| 56 | 35 | } |
| 57 | 36 | |