woocommerce_update_option

woocommerce_update_option

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_update_option') is found 5 times:

  • /includes/abstracts/abstract-wc-settings-api.php line 237
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
            }
        }
     
        $option_key = $this->get_option_key();
        do_action( 'woocommerce_update_option', array( 'id' => $option_key ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
        return update_option( $option_key, apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ), 'yes' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
    }
     
    /**
     * Add an error message for display in admin on save.
     *
  • /includes/admin/class-wc-admin-settings.php line 989
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
         * Fire an action before saved.
         *
         * @deprecated 2.4.0 - doesn't allow manipulation of values!
         */
        do_action( 'woocommerce_update_option', $option );
    }
     
    // Save all options in our array.
    foreach ( $update_options as $name => $value ) {
        update_option( $name, $value, $autoload_options[ $name ] ? 'yes' : 'no' );
    }
  • /includes/class-wc-ajax.php line 3621
    3617
    3618
    3619
    3620
    3621
    3622
    3623
    3624
    3625
    3626
    3627
        if ( $gateway->needs_setup() ) {
            wp_send_json_error( 'needs_setup' );
            wp_die();
        } else {
            do_action( 'woocommerce_update_option', $option );
            $gateway->update_option( 'enabled', 'yes' );
        }
    } else {
        do_action( 'woocommerce_update_option', $option );
        // Disable the gateway.
        $gateway->update_option( 'enabled', 'no' );
  • /includes/class-wc-ajax.php line 3625
    3621
    3622
    3623
    3624
    3625
    3626
    3627
    3628
    3629
    3630
    3631
            do_action( 'woocommerce_update_option', $option );
            $gateway->update_option( 'enabled', 'yes' );
        }
    } else {
        do_action( 'woocommerce_update_option', $option );
        // Disable the gateway.
        $gateway->update_option( 'enabled', 'no' );
    }
    do_action( 'woocommerce_update_options' );
    wp_send_json_success( ! wc_string_to_bool( $enabled ) );
    wp_die();
  • /includes/gateways/bacs/class-wc-gateway-bacs.php line 264
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
            }
        }
        // phpcs:enable
     
        do_action( 'woocommerce_update_option', array( 'id' => 'woocommerce_bacs_accounts' ) );
        update_option( 'woocommerce_bacs_accounts', $accounts );
    }
     
    /**
     * Output for the order received page.
     *

See this hook used in plugins: