Render 'safe_text' settings as 'text' inputs (#37154)

This commit is contained in:
Néstor Soriano 2023-03-10 10:52:09 +01:00 committed by GitHub
commit 4cbb607631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: tweak
Make sure 'safe_text' settings are rendered as 'text' inputs for compatibility.

View File

@ -458,6 +458,20 @@ abstract class WC_Settings_API {
return ob_get_clean();
}
/**
* Generates HTML for the 'safe_text' input type (mostly used for gateway-related settings).
*
* @param string $key Field key.
* @param array $data Field data.
* @return string
*
* @since 7.6.0
*/
public function generate_safe_text_html( $key, $data ) {
$data['type'] = 'text';
return $this->generate_text_html( $key, $data );
}
/**
* Generate Price Input HTML.
*