checkbox.php 0000644 00000000650 15154557461 0007061 0 ustar 00 <?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $input
*/
$input = $this->input;
$input['value'] = $input['value'] ?? false;
$input['value'] = wc_bool_to_string( $input['value'] );
$input['wrapper_class'] = sprintf( '%s %s', $input['wrapper_class'] ?? '', 'options' );
woocommerce_wp_checkbox( $input );
datetime.php 0000644 00000003357 15154557461 0007076 0 ustar 00 <?php
/**
* Datetime input template
*
* @since 1.5.0
*/
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $input
*/
$input = $this->input;
$input['class'] = $input['class'] ?? '';
$input['wrapper_class'] = $input['wrapper_class'] ?? '';
$input['name'] = $input['name'] ?? $input['id'];
$input['desc_tip'] = $input['desc_tip'] ?? false;
$input['date'] = $input['date'] ?? '';
$input['time'] = $input['time'] ?? '';
echo '<p class="form-field ' . esc_attr( $input['id'] ) . '_field gla-input-datetime ' . esc_attr( $input['wrapper_class'] ) . '">
<label for="' . esc_attr( $input['id'] ) . '_date">' . wp_kses_post( $input['label'] ) . '</label>';
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo '<input type="date" pattern="\d{4}-\d{2}-\d{2}" class="' . esc_attr( $input['class'] ) . '" name="' . esc_attr( $input['name'] ) . '[date]" id="' . esc_attr( $input['id'] ) . '_date" value="' . esc_attr( $input['date'] ) . '" /> ';
echo '<input type="time" pattern="[0-9]{2}:[0-9]{2}" class="' . esc_attr( $input['class'] ) . '" name="' . esc_attr( $input['name'] ) . '[time]" id="' . esc_attr( $input['id'] ) . '_time" value="' . esc_attr( $input['time'] ) . '" /> ';
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
if ( ! empty( $input['description'] ) && false !== $input['desc_tip'] ) {
echo wc_help_tip( $input['description'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
if ( ! empty( $input['description'] ) && false === $input['desc_tip'] ) {
echo '<span class="description">' . wp_kses_post( $input['description'] ) . '</span>';
}
echo '</p>';
decimal.php 0000644 00000000454 15154557461 0006673 0 ustar 00 <?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $input
*/
$input = $this->input;
$input['type'] = 'text';
$input['data_type'] = 'decimal';
woocommerce_wp_text_input( $input );
form.php 0000644 00000001332 15154557461 0006234 0 ustar 00 <?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $form
*/
$form = $this->form;
?>
<div class="gla-input <?php echo esc_attr( $form['gla_wrapper_class'] ?? '' ); ?>">
<?php
if ( ! empty( $form['type'] ) ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->render_partial( path_join( 'inputs/', $form['type'] ), [ 'input' => $form ] );
}
if ( ! empty( $form['children'] ) ) {
foreach ( $form['children'] as $form ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->render_partial( 'inputs/form', [ 'form' => $form ] );
}
}
?>
</div>
integer.php 0000644 00000000575 15154557461 0006736 0 ustar 00 <?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $input
*/
$input = $this->input;
$input['type'] = 'number';
// Not so "custom" but standard `<input type="number">` attribute.
$input['custom_attributes'] = [
'min' => '0',
];
woocommerce_wp_text_input( $input );
select-with-text-input.php 0000644 00000000306 15154557461 0011640 0 ustar 00 <?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $input
*/
$input = $this->input;
select.php 0000644 00000000350 15154557462 0006550 0 ustar 00 <?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $input
*/
$input = $this->input;
woocommerce_wp_select( $input );
text.php 0000644 00000000354 15154557462 0006261 0 ustar 00 <?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* @var \Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView $this
*/
/**
* @var array $input
*/
$input = $this->input;
woocommerce_wp_text_input( $input );