mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
PCP-26 / introduce text field with autocomplete off
This commit is contained in:
parent
585d5350ff
commit
754913b632
3 changed files with 31 additions and 3 deletions
|
@ -193,7 +193,7 @@ return [
|
|||
],
|
||||
'client_id' => [
|
||||
'title' => __('Client Id', 'woocommerce-paypal-commerce-gateway'),
|
||||
'type' => 'text',
|
||||
'type' => 'ppcp-text-input',
|
||||
'desc_tip' => true,
|
||||
'description' => __('The client id of your api ', 'woocommerce-paypal-commerce-gateway'),
|
||||
'default' => false,
|
||||
|
|
|
@ -81,6 +81,29 @@ class SettingsRenderer
|
|||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function renderTextInput($field, $key, $config, $value): string
|
||||
{
|
||||
|
||||
if ($config['type'] !== 'ppcp-text-input') {
|
||||
return $field;
|
||||
}
|
||||
|
||||
$html = sprintf(
|
||||
'<input
|
||||
type="text"
|
||||
autocomplete="off"
|
||||
class="%s"
|
||||
name="%s"
|
||||
value="%s"
|
||||
>',
|
||||
esc_attr(implode(' ', $config['class'])),
|
||||
esc_attr($key),
|
||||
esc_attr($value)
|
||||
);
|
||||
|
||||
return $html;
|
||||
}
|
||||
//phpcs:enable Inpsyde.CodeQuality.ArgumentTypeDeclaration.NoArgumentType
|
||||
|
||||
public function render()
|
||||
|
|
|
@ -118,8 +118,13 @@ class WcGatewayModule implements ModuleInterface
|
|||
* @var SettingsRenderer $renderer
|
||||
*/
|
||||
return $renderer->renderPassword(
|
||||
$renderer->renderMultiSelect(
|
||||
$field,
|
||||
$renderer->renderTextInput(
|
||||
$renderer->renderMultiSelect(
|
||||
$field,
|
||||
$key,
|
||||
$args,
|
||||
$value
|
||||
),
|
||||
$key,
|
||||
$args,
|
||||
$value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue