Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Shortcode_Checkout::clean_form_fields( array $fields_html )

Clean form fields html


Description Description

Properly detects empty form fields when the html is only composed of blanks and empty paragraphs. In this case the form fields html is turned into an empty string.


Top ↑

Parameters Parameters

$fields_html

(array) (Required) Form Fields.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/shortcodes/class.llms.shortcode.checkout.php

	private static function clean_form_fields( $fields_html ) {
		// If fields html has only blanks and emoty paragraphs (autop?), clean it.
		if ( empty( preg_replace( '/(\s)*(<p><\/p>)*/m', '', $fields_html ) ) ) {
			$fields_html = '';
		}
		return $fields_html;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.