Yoast\WP\SEO\Llms_Txt\Application\File\Commands

Populate_File_Command_Handler::encode_contentprivateYoast 1.0

Encodes the content by prepending it with the Byte Order Mark (BOM) for UTF-8.

Метод класса: Populate_File_Command_Handler{}

Хуки из метода

Возвращает

Строку.

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

// private - только в коде основоного (родительского) класса
$result = $this->encode_content( $content ): string;
$content(строка) (обязательный)
The content to encode.

Код Populate_File_Command_Handler::encode_content() Yoast 27.7

private function encode_content( string $content ): string {

	/**
	 * Filter: 'wpseo_llmstxt_encoding_prefix' - Allows editing the Byte Order Mark (BOM) for UTF-8 we prepend to the llmst.txt file.
	 *
	 * @param string $encoding_prefix The Byte Order Mark (BOM) for UTF-8 we prepend to the llmst.txt file.
	 */
	$encoding_prefix = \apply_filters( 'wpseo_llmstxt_encoding_prefix', "\xEF\xBB\xBF" );

	return $encoding_prefix . $content;
}