ngg_refreshSavedSettings

The NextGEN Gallery ngg refreshSavedSettings function.

Description

ngg_refreshSavedSettings(); 

Usage

  1. if ( !function_exists( 'ngg_refreshSavedSettings' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ngg_refreshSavedSettings(); 
  7.  

Defined (1)

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

/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php  
  1. function ngg_refreshSavedSettings() 
  2. if (class_exists('C_NextGen_Settings')) { 
  3. $settings = C_NextGen_Settings::get_instance(); 
  4.  
  5. if ($settings != null) 
  6. $width = $settings->thumbwidth; 
  7. $height = $settings->thumbheight; 
  8. $new_dimension = "{$width}x{$height}"; 
  9. $dimensions = (array) $settings->thumbnail_dimensions; 
  10.  
  11. if (!in_array($new_dimension, $dimensions)) { 
  12. $dimensions[] = $new_dimension; 
  13. $settings->thumbnail_dimensions = $dimensions; 
  14. $settings->save(); 
  15.  
  16. return true; 
  17.  
  18. return false;