| @@ 17-79 (lines=63) @@ | ||
| 14 | * |
|
| 15 | * @deprecated 4.9.54 |
|
| 16 | */ |
|
| 17 | class Context implements ContextInterface |
|
| 18 | { |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @var string $slug |
|
| 22 | */ |
|
| 23 | private $slug; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var string $description |
|
| 27 | */ |
|
| 28 | private $description; |
|
| 29 | ||
| 30 | ||
| 31 | /** |
|
| 32 | * Context constructor. |
|
| 33 | * |
|
| 34 | * @param string $slug |
|
| 35 | * @param string $description |
|
| 36 | */ |
|
| 37 | public function __construct($slug, $description) |
|
| 38 | { |
|
| 39 | $this->setSlug($slug); |
|
| 40 | $this->setDescription($description); |
|
| 41 | } |
|
| 42 | ||
| 43 | ||
| 44 | /** |
|
| 45 | * @return string |
|
| 46 | */ |
|
| 47 | public function slug() |
|
| 48 | { |
|
| 49 | return $this->slug; |
|
| 50 | } |
|
| 51 | ||
| 52 | ||
| 53 | /** |
|
| 54 | * @param string $slug |
|
| 55 | */ |
|
| 56 | private function setSlug($slug) |
|
| 57 | { |
|
| 58 | $this->slug = sanitize_key($slug); |
|
| 59 | } |
|
| 60 | ||
| 61 | ||
| 62 | /** |
|
| 63 | * @return string |
|
| 64 | */ |
|
| 65 | public function description() |
|
| 66 | { |
|
| 67 | return $this->description; |
|
| 68 | } |
|
| 69 | ||
| 70 | ||
| 71 | /** |
|
| 72 | * @param string $description |
|
| 73 | */ |
|
| 74 | private function setDescription($description) |
|
| 75 | { |
|
| 76 | $this->description = sanitize_text_field($description); |
|
| 77 | } |
|
| 78 | ||
| 79 | } |
|
| 80 | // Location: Context.php |
|
| 81 | ||
| @@ 18-80 (lines=63) @@ | ||
| 15 | * @author Brent Christensen |
|
| 16 | * @since 4.9.46.rc.076 |
|
| 17 | */ |
|
| 18 | class Context implements ContextInterface |
|
| 19 | { |
|
| 20 | ||
| 21 | /** |
|
| 22 | * @var string $slug |
|
| 23 | */ |
|
| 24 | private $slug; |
|
| 25 | ||
| 26 | /** |
|
| 27 | * @var string $description |
|
| 28 | */ |
|
| 29 | private $description; |
|
| 30 | ||
| 31 | ||
| 32 | /** |
|
| 33 | * Context constructor. |
|
| 34 | * |
|
| 35 | * @param string $slug |
|
| 36 | * @param string $description |
|
| 37 | */ |
|
| 38 | public function __construct($slug, $description) |
|
| 39 | { |
|
| 40 | $this->setSlug($slug); |
|
| 41 | $this->setDescription($description); |
|
| 42 | } |
|
| 43 | ||
| 44 | ||
| 45 | /** |
|
| 46 | * @return string |
|
| 47 | */ |
|
| 48 | public function slug() |
|
| 49 | { |
|
| 50 | return $this->slug; |
|
| 51 | } |
|
| 52 | ||
| 53 | ||
| 54 | /** |
|
| 55 | * @param string $slug |
|
| 56 | */ |
|
| 57 | private function setSlug($slug) |
|
| 58 | { |
|
| 59 | $this->slug = sanitize_key($slug); |
|
| 60 | } |
|
| 61 | ||
| 62 | ||
| 63 | /** |
|
| 64 | * @return string |
|
| 65 | */ |
|
| 66 | public function description() |
|
| 67 | { |
|
| 68 | return $this->description; |
|
| 69 | } |
|
| 70 | ||
| 71 | ||
| 72 | /** |
|
| 73 | * @param string $description |
|
| 74 | */ |
|
| 75 | private function setDescription($description) |
|
| 76 | { |
|
| 77 | $this->description = sanitize_text_field($description); |
|
| 78 | } |
|
| 79 | ||
| 80 | } |
|
| 81 | // Location: Context.php |
|
| 82 | ||