update_logo_info

The Responsive Minimal update logo info function.

Description

update_logo_info(); 

Usage

  1. if ( !function_exists( 'update_logo_info' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = update_logo_info(); 
  7.  

Defined (1)

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

/functions.php  
  1. function update_logo_info() { 
  2. $upload_dir=wp_upload_dir(); 
  3. if (isset($upload_dir["error"]) && $upload_dir["error"]!==false ) { 
  4. $GLOBALS['error_folder']= 'The option to change logo and slider is disabled, please create the following folder: /wp-content/uploads/ and allow writing by setting its permissions to 0777'; 
  5. return false;  
  6. }  
  7. $directory_logo=$upload_dir['basedir'].'/logo/'; 
  8. $get_img_logo=get_template_directory_uri().'/img/logo/logo.png'; 
  9. $get_dimmensions=getimagesize($get_img_logo); 
  10. $logo_info['path']=$upload_dir['basedir'].'/logo/logo.png'; 
  11. $logo_info['url']=$upload_dir['baseurl'].'/logo/logo.png'; 
  12. $logo_info['size']=$get_dimmensions; 
  13. @mkdir($directory_logo, 0777, true); 
  14. check_filesystem($logo_info['path'], '', $get_img_logo, 'active-theme'); 
  15. //file_put_contents($logo_info['path'], file_get_contents($get_img_logo)); 
  16. chmod($logo_info['path'], 0777);  
  17. update_option('themeshock_logo', maybe_serialize($logo_info)); 
  18. return $logo_info;