Initial commit.

This commit is contained in:
2025-11-24 21:33:55 +00:00
parent 14b7ade051
commit d6e9d316bc
8974 changed files with 1423277 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
/**
* Form
*
* @package Automattic\WooCommerce\Pinterest\View\PHPView
*/
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* PHP view.
*
* @var \Automattic\WooCommerce\Pinterest\View\PHPView $this
*/
/**
* Form.
*
* @var array $form
*/
$form = $this->form;
?>
<div class="pinterest-input <?php echo esc_attr( $form['pinterest_wrapper_class'] ?? '' ); ?>">
<?php
if ( ! empty( $form['type'] ) ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->render_partial( path_join( 'inputs/', $form['type'] ), array( 'input' => $form ) );
}
if ( ! empty( $form['children'] ) ) {
foreach ( $form['children'] as $form ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->render_partial( 'inputs/form', array( 'form' => $form ) );
}
}
?>
</div>

View File

@@ -0,0 +1,48 @@
<?php
/**
* Google Category Input.
*
* @package Automattic\WooCommerce\Pinterest\View\PHPView
*/
declare( strict_types=1 );
use Automattic\WooCommerce\Pinterest\View\PHPView;
defined( 'ABSPATH' ) || exit;
/**
* PHP View.
*
* @var PHPView $this
*/
/**
* Input.
*
* @var array $input
*/
$input = $this->input;
$input['class'] = $input['class'] ?? '';
$input['wrapper_class'] = $input['wrapper_class'] ?? '';
$input['name'] = $input['name'] ?? $input['id'];
$input['value'] = $input['value'] ?? '';
$input['desc_tip'] = $input['desc_tip'] ?? false;
?>
<p class="form-field <?php echo esc_attr( $input['id'] ); ?>_field pinterest-input-google-category <?php echo esc_attr( $input['wrapper_class'] ); ?>">
<label for="<?php echo esc_attr( $input['id'] ); ?>_google_category"><?php echo wp_kses_post( $input['label'] ); ?></label>
<select class="wc-product-search" style="width: 50%;" id="<?php echo esc_attr( $input['id'] ); ?>" name="<?php echo esc_attr( $input['name'] ); ?>" data-placeholder="<?php esc_attr_e( 'Search for a category…', 'pinterest-for-woocommerce' ); ?>" data-action="woocommerce_json_search_google_category" data-allow_clear="yes">
<?php echo '<option value="' . esc_attr( $input['value'] ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $input['value'] ) ) . '</option>'; ?>
</select>
<?php
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>';
}
?>
</p>

View File

@@ -0,0 +1,25 @@
<?php
/**
* Input.
*
* @package Automattic\WooCommerce\Pinterest\View\PHPView
*/
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* PHP View.
*
* @var \Automattic\WooCommerce\Pinterest\View\PHPView $this
*/
/**
* Input.
*
* @var array $input
*/
$input = $this->input;
woocommerce_wp_select( $input );