Yoast\WP\SEO\Llms_Txt\Domain\Markdown\Sections
Description{}└─ Section_Interface
Represents the description section.
Хуков нет.
Использование
$Description = new Description(); // use class methods
Методы
- public __construct( string $description )
- public escape_markdown( Markdown_Escaper $markdown_escaper )
- public get_prefix()
- public render()
- ERROR: no method name found on line `*`
- ERROR: no method name found on line `* @return string`
- ERROR: no method name found on line `*/`
Код Description{} Description{} Yoast 27.8
class Description implements Section_Interface {
/**
* The description.
*
* @var string
*/
private $description;
/**
* Class constructor.
*
* @param string $description The description.
*/
public function __construct( string $description ) {
$this->description = $description;
}
/**
* Returns the prefix of the description section.
*
* @return string
*/
public function get_prefix(): string {
return '> ';
}
/**
* Renders the description section.
*
* @return string
*/
public function render(): string {
return $this->description;
}
/**
* Escapes the markdown content.
*
* @param Markdown_Escaper $markdown_escaper The markdown escaper.
*
* @return void
*/
public function escape_markdown( Markdown_Escaper $markdown_escaper ): void {
$this->description = $markdown_escaper->escape_markdown_content( $this->description );
}
}