Support » Fixing WordPress » Returning true when it doesn't do anything?

  • Adam


    So I have said code that is suppose to use the unzip_file($path_to_file, $path_to_unzip); which will upgrade my theme. I have a file (zip file) at the location its suppose to go to get the file, and I have a path set to where it should unzip to – AISIS – which is the root of the theme folder.

    The problem I have is that it constantly returns “true.” I had this issue in another thread and some one suggested to return the function unzip_file() its self instead of just return true. So I did that, and according to the doc this method, unzip_file() returns true if it did what you asked it to or wp_error.

    I get true. You’d think that’s a good thing,but the file I have, which over writes a current file is not overwriting that file, that is to say my local copy of said file is not being replaced with the zipped one.

    is it because the path to the zip file is a url and not a “path”? would it not throw an error? my logs and WP_DEBUG are clean when this method is run.


    Update So I don’t think I am using the function properly. I tried giving it a path to no where and it still returned true…. I have read the doc a thousand times

    Note: not sure why paste bin is formatting my code so poorly….

  • The topic ‘Returning true when it doesn't do anything?’ is closed to new replies.