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

Populate_File_Command_Handler::handlepublicYoast 1.0

Runs the command.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$Populate_File_Command_Handler = new Populate_File_Command_Handler();
$Populate_File_Command_Handler->handle();

Код Populate_File_Command_Handler::handle() Yoast 28.3

public function handle() {
	if ( $this->permission_gate->is_managed_by_yoast_seo() ) {
		$content      = $this->markdown_builder->render();
		$content      = $this->encode_content( $content );
		$file_written = $this->file_system_adapter->set_file_content( $content );

		if ( $file_written ) {
			// Maybe move this to a class if we need to handle this option more often.
			\update_option( self::CONTENT_HASH_OPTION, \md5( $content ) );
			\delete_option( self::GENERATION_FAILURE_OPTION );
			return;
		}

		\update_option( self::GENERATION_FAILURE_OPTION, 'filesystem_permissions' );
		return;
	}

	\update_option( self::GENERATION_FAILURE_OPTION, 'not_managed_by_yoast_seo' );
}