 @since 1.8.8
	 *
	 * @param array $attr Attributes passed by WPForms Gutenberg block.
	 */
	private function output_custom_css( array $attr ): void {

		if ( wpforms_get_render_engine() === 'classic' ) {
			return;
		}

		$custom_css = trim( $attr['customCss'] ?? '' );

		if ( empty( $custom_css ) ) {
			return;
		}

		$style_id = "#wpforms-custom-css-{$attr['formId']}-block-{$attr['clientId']}";

		printf(
			'<style id="%1$s">
				%2$s
			</style>',
			sanitize_key( $style_id ),
			wp_strip_all_tags( $custom_css ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		);
	}

	/**
	 * Output form-level custom CSS styles loaded from the form settings.
	 *
	 * Mirrors the shortcode render path so custom CSS configured in
	 * the Form Builder (Settings → Themes → Advanced) is also applied
	 * when the form is embedded via the Gutenberg block.
	 *
	 * @since 1.10.2
	 *
	 * @param int $form_id Form ID.
	 */
	private function output_form_custom_css( int $form_id ): void {

		static $outputted_forms = [];

		if ( $this->render_engine === 'classic' || in_array( $form_id, $outputted_forms, true ) ) {
			return;
		}

		$form_handler = wpforms()->obj( 'form' );

		if ( ! $form_handler ) {
			return;
		}

		$form_data = $form_handler->get( $form_id, [ 'content_only' => true ] );

		if ( empty( $form_data ) ) {
			return;
		}

		$custom_css = trim( $form_data['settings']['themes']['customCss'] ?? '' );

		if ( empty( $custom_css ) ) {
			return;
		}

		$outputted_forms[] = $form_id;
		$style_id          = "wpforms-custom-css-{$form_id}-form";

		printf(
			'<style id="%1$s">
				#wpforms-%2$d {
					%3$s
				}
			</style>',
			sanitize_key( $style_id ),
			absint( $form_id ),
			wp_strip_all_tags( $custom_css ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		);
	}

	/**
	 * Disable loading media for the richtext editor for edit action to prevent script conflicts.
	 *
	 * @since 1.9.1
	 *
	 * @param bool|mixed $media_enabled Whether to enable media.
	 * @param array      $field         Field data.
	 *
	 * @return bool
	 * @noinspection PhpUnusedParameterInspection
	 */
	public function disable_richtext_media( $media_enabled, array $field ): bool {

		// phpcs:ignore WordPress.Security.NonceVerification.Recommended
		if ( ! empty( $_REQUEST['action'] ) && $_REQUEST['action'] === 'edit' && is_admin() ) {
			return false;
		}

		return (bool) $media_enabled;
	}

	/**
	 * Get block API version based on WP core version.
	 *
	 * @since 1.9.3
	 *
	 * @return int Block API version.
	 */
	private function get_block_api_version(): int {

		if ( $this->is_legacy_block() ) {
			return 1;
		}

		return wpforms_is_wp_version_at_least( '6.3' ) ? 3 : 2;
	}
}
<error>
    <code>internal_server_error</code>
    <title><![CDATA[WordPress &amp;rsaquo; Błąd]]></title>
    <message><![CDATA[&lt;p&gt;W witrynie wystąpił błąd krytyczny.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://wordpress.org/documentation/article/faq-troubleshooting/&quot;&gt;Dowiedz się więcej o rozwiązywaniu problemów z WordPressem.&lt;/a&gt;&lt;/p&gt;]]></message>
    <data>
        <status>500</status>
    </data>
</error>
