Yoast\WP\SEO\Task_List\Domain\Components
Copy_Set{}
This class describes a set of copy.
Хуков нет.
Использование
$Copy_Set = new Copy_Set(); // use class methods
Методы
- public __construct(
- public get_about()
- public to_array()
Код Copy_Set{} Copy Set{} Yoast 28.3
class Copy_Set {
/**
* The title copy.
*
* @var string
*/
private $title;
/**
* The about copy.
*
* @var string
*/
private $about;
/**
* The constructor.
*
* @param string $title The title copy.
* @param string $about The about copy. Can contain HTML markup like <strong> and <p>.
*/
public function __construct(
string $title,
string $about = ''
) {
$this->title = $title;
$this->about = $about;
}
/**
* Returns the copy set's about.
*
* @return string
*/
public function get_about(): string {
return $this->about;
}
/**
* Returns an array representation of the copy set data.
*
* @return array<string, string> Returns in an array format.
*/
public function to_array(): array {
return [
'title' => $this->title,
'about' => $this->about,
];
}
}