Yoast\WP\SEO\Llms_Txt\Domain\Markdown\Sections

Description{}Yoast 1.0└─ Section_Interface

Represents the description section.

Хуков нет.

Использование

$Description = new Description();
// use class methods

Методы

  1. public __construct( string $description )
  2. public escape_markdown( Markdown_Escaper $markdown_escaper )
  3. public get_prefix()
  4. public render()
  5. ERROR: no method name found on line `*`
  6. ERROR: no method name found on line `* @return string`
  7. ERROR: no method name found on line `*/`

Код 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 );
	}
}