Yoast\WP\SEO\Llms_Txt\Infrastructure\File
WordPress_File_System_Adapter::set_file_content
Creates a file and writes the specified content to it.
Метод класса: WordPress_File_System_Adapter{}
Хуков нет.
Возвращает
true|false. True on success, false on failure.
Использование
$WordPress_File_System_Adapter = new WordPress_File_System_Adapter(); $WordPress_File_System_Adapter->set_file_content( $content ): bool;
- $content(строка) (обязательный)
- The content to write into the file.
Код WordPress_File_System_Adapter::set_file_content() WordPress File System Adapter::set file content Yoast 26.9
public function set_file_content( string $content ): bool {
if ( $this->is_file_system_available() ) {
global $wp_filesystem;
$result = $wp_filesystem->put_contents(
$this->get_llms_file_path(),
$content,
\FS_CHMOD_FILE
);
return $result;
}
return false;
}