Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8 compatibilty #32

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fix check array keys existence
  • Loading branch information
chermant committed Apr 27, 2022
commit 593f102264702723d6d8c68974f2a612122e9ac1
20 changes: 10 additions & 10 deletions src/Admin/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ function () {
function () {
?>
<select name="<?php echo esc_html( sprintf( '%s[product_identifier]', self::SF_FEED_OPTIONS ) ); ?>">
<option value="id" <?php selected( 'id', $this->sf_feed_options['product_identifier'] ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<option value="id" <?php selected( 'id', isset( $this->sf_feed_options['product_identifier'] ) ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<?php esc_html_e( 'Product ID (recommended)', 'shopping-feed' ); ?>
</option>
<option value="sku" <?php selected( 'sku', $this->sf_feed_options['product_identifier'] ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<option value="sku" <?php selected( 'sku', isset( $this->sf_feed_options['product_identifier'] ) ? $this->sf_feed_options['product_identifier'] : false ); ?>>
<?php esc_html_e( 'SKU', 'shopping-feed' ); ?>
</option>
</select>
Expand All @@ -499,10 +499,10 @@ function () {
function () {
?>
<select name="<?php echo esc_html( sprintf( '%s[category_display_mode]', self::SF_FEED_OPTIONS ) ); ?>">
<option value="normal" <?php selected( 'id', $this->sf_feed_options['category_display_mode'] ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<option value="normal" <?php selected( 'id', isset( $this->sf_feed_options['category_display_mode'] ) ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<?php esc_html_e( 'Normal', 'shopping-feed' ); ?>
</option>
<option value="breadcrumb" <?php selected( 'breadcrumb', $this->sf_feed_options['category_display_mode'] ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<option value="breadcrumb" <?php selected( 'breadcrumb', isset( $this->sf_feed_options['category_display_mode'] ) ? $this->sf_feed_options['category_display_mode'] : false ); ?>>
<?php esc_html_e( 'Breadcrumb', 'shopping-feed' ); ?>
</option>
</select>
Expand Down Expand Up @@ -580,7 +580,7 @@ function () use ( $frequencies_options ) {
?>
<option
value="<?php echo esc_html( $frequency ); ?>"
<?php selected( $frequency, $this->sf_feed_options['frequency'] ? $this->sf_feed_options['frequency'] : false ); ?>
<?php selected( $frequency, isset( $this->sf_feed_options['frequency'] ) ? $this->sf_feed_options['frequency'] : false ); ?>
><?php echo esc_html( $name ); ?></option>
<?php
}
Expand All @@ -607,7 +607,7 @@ function () {
?>
<option
value="<?php echo esc_html( $part_size_option ); ?>"
<?php selected( $part_size_option, $this->sf_feed_options['part_size'] ? $this->sf_feed_options['part_size'] : false ); ?>
<?php selected( $part_size_option, isset( $this->sf_feed_options['part_size'] ) ? $this->sf_feed_options['part_size'] : false ); ?>
><?php echo esc_html( $part_size_option ); ?></option>
<?php
}
Expand Down Expand Up @@ -725,9 +725,9 @@ function () {
?>
<select id="retrieval_mode" name="<?php echo esc_html( sprintf( '%s[retrieval_mode]', self::SF_SHIPPING_OPTIONS ) ); ?>">
<option value="ADDONS"
<?php selected( 'ADDONS', $this->sf_shipping_options['retrieval_mode'] ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Addons</option>
<?php selected( 'ADDONS', isset( $this->sf_feed_options['retrieval_mode'] ) ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Addons</option>
<option value="METAS"
<?php selected( 'METAS', $this->sf_shipping_options['retrieval_mode'] ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Métas</option>
<?php selected( 'METAS', isset( $this->sf_feed_options['retrieval_mode'] ) ? $this->sf_shipping_options['retrieval_mode'] : false ); ?>>Métas</option>
</select>
<p class="description"
id="tagline-description">
Expand Down Expand Up @@ -890,7 +890,7 @@ function () use ( $frequencies_options ) {
?>
<option
value="<?php echo esc_html( $frequency ); ?>"
<?php selected( $frequency, $this->sf_orders_options['import_frequency'] ? $this->sf_orders_options['import_frequency'] : false ); ?>
<?php selected( $frequency, isset( $this->sf_feed_options['import_frequency'] ) ? $this->sf_orders_options['import_frequency'] : false ); ?>
><?php echo esc_html( $name ); ?></option>
<?php
}
Expand Down Expand Up @@ -927,7 +927,7 @@ function () use ( $wc_order_statuses ) {
?>
<option
value="<?php echo esc_html( $wc_order_statuse ); ?>"
<?php selected( $wc_order_statuse, $this->sf_orders_options['default_status'] ? $this->sf_orders_options['default_status'] : false ); ?>
<?php selected( $wc_order_statuse, isset( $this->sf_feed_options['default_status'] ) ? $this->sf_orders_options['default_status'] : false ); ?>
><?php echo esc_html( $name ); ?></option>
<?php
}
Expand Down