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.3.3

do_action('woocommerce_update_option') is found 5 times:

  • /includes/abstracts/abstract-wc-settings-api.php line 237
    			}
    		}
    
    		$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 971
    				 * 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 3594
    					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 3598
    						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 255
    			}
    		}
    		// 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: