Update checked functionality to use a filter, removed option from settings screen. Can use the woocommerce_restock_refunded_items filter to have the option checked or not, defaults to unchecked.
This commit is contained in:
parent
9b07180c7a
commit
e3994348b3
|
@ -254,11 +254,13 @@ if ( wc_tax_enabled() ) {
|
|||
<tr>
|
||||
<td class="label"><label for="restock_refunded_items"><?php esc_html_e( 'Restock refunded items', 'woocommerce' ); ?>:</label></td>
|
||||
<?php
|
||||
if ( 'yes' === get_option( 'woocommerce_restock_refunded_items' ) ) {
|
||||
$checked = 'checked="checked"';
|
||||
if ( apply_filter( 'woocommerce_restock_refunded_items', false ) ) {
|
||||
$checked = 1;
|
||||
} else {
|
||||
$checked = 0;
|
||||
}
|
||||
?>
|
||||
<td class="total"><input type="checkbox" id="restock_refunded_items" name="restock_refunded_items"<?php echo esc_attr( $checked, 'woocommerce' ); ?> /></td>
|
||||
<td class="total"><input type="checkbox" id="restock_refunded_items" name="restock_refunded_items"<?php checked( 1, $checked, true ); ?> /></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
|
|
|
@ -139,14 +139,6 @@ class WC_Settings_Products extends WC_Settings_Page {
|
|||
'type' => 'checkbox',
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Restock refunded items', 'woocommerce' ),
|
||||
'desc' => __( 'Uncheck this to default to NOT restocking items when refunding', 'woocommerce' ),
|
||||
'id' => 'woocommerce_restock_refunded_items',
|
||||
'default' => 'yes',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Hold stock (minutes)', 'woocommerce' ),
|
||||
'desc' => __( 'Hold stock (for unpaid orders) for x minutes. When this limit is reached, the pending order will be cancelled. Leave blank to disable.', 'woocommerce' ),
|
||||
|
|
Loading…
Reference in New Issue