ddw_wcde_update_default_options

Update option IDs with our default values if not existing.

Description

ddw_wcde_update_default_options(); 

Usage

  1. if ( !function_exists( 'ddw_wcde_update_default_options' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/includes/wcde-settings-defaults.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddw_wcde_update_default_options(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wcde-settings-defaults.php  
  1. function ddw_wcde_update_default_options() { 
  2.  
  3. $wcde_defaults = ddw_wcde_get_default_options(); 
  4.  
  5. foreach ( $wcde_defaults as $wcde_option_id => $wcde_option_value ) { 
  6.  
  7. /** If options do not exist (on first run), update them with default values */ 
  8. if ( ! get_option( $wcde_option_id ) ) { 
  9.  
  10. update_option( $wcde_option_id, $wcde_option_value ); 
  11.  
  12. } // end if 
  13.  
  14. } // end foreach 
  15.  
  16. } // end of function ddw_wcde_update_default_options