• Hi

    I just created my custom theme section. It is possible to determinate the color background, the text color, the wrapper width and import a logo.

    Everything works but when I update any of the color / width data, my logo disappear then from my frontend. So everytime I have to upload it.

    How can I keep it ?

    Here is my function for my logo uploading and settings validation:

    function validate_setting($plugin_options) {
    $keys = array_keys($_FILES);
    $i = 0;
    foreach ($_FILES as $image ) {
    //if file was uploaded
    if ($image ['size']) {
    //is it an image ?
    if (preg_match('/(jpg|jpeg|png|gif)$/i', $image['type']) ) {
    $override = array ('test_form' => false);
    $file = wp_handle_upload ($image, $override);
    $plugin_options[$keys[$i]] = $file ['url'];
         }
    	 else {
    	 wp_die('No image was uploaded');
    	 }
      }
      else {
      $options = get_option('plugin_option');
    $plugin_options[$keys[$i]] = $options [$keys[$i]];
      }
    $i++;
    }
    return $plugin_options;
    }

    Thanks for your help

  • The topic ‘logo disappear after update’ is closed to new replies.