• Okay, so I decided to let wordpress update my themes. I use TML and had some customization done in the twenty fourteen folder, such as functions.php, profile-form.php, register-form.php, etc. Upon upgrade, those files were deleted. I thought themes were not supposed to kill anything that did not belong to them? I can understand functions.php, but it looks like the directory structure was completely wiped out and recreated and it blew away all my custom files.

    Thankfully I have a backup, but really? Good thing I didn’t have automatic updates turned on or my website would have been foo-barred until I noticed something wrong. Horrible coding to not use explicit names when deleting old files rather than a wild card or complete directory removal. Come on coding team! This is elementary stuff.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Did you create a Child Theme?

    You still want to have automatic updates for core.

    Thread Starter tcarroll2

    (@tcarroll2)

    No, the directions in TML do not mention anything about child themes. It just say to place the file(s) in the themes folder/directory.

    Even posts here talking about modifying functions.php state that the file would be safe from theme updates. I have no clue what a child theme is.

    In my coding days, I would have never blindly deleted files or directories for upgrading software. I even wrote a smart installer that looked for modified files and did not touch those while going through the update process.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Sorry, can you clarify what TML is for a newbie like me?

    Thread Starter tcarroll2

    (@tcarroll2)

    Theme-my-login plugin.

    Heheh, good one, Andrew.

    @tcarroll2, you can read about how to create a child theme here. Hopefully you’ve guessed by now that theme files should not be modified for the reasons that you’ve just discovered: any modifications will get overwritten on a theme upgrade. You create a child theme and make your changes to copies of the files that you need to modify. Not sure why the plugin author would suggest making changes to the theme files directly, it’s fairly common knowledge among WordPress developers that that’s not what should be done.

    Now, you can add your own files (like your own stylesheet) in relative safety if the file names don’t collide (i.e., aren’t the same) with existing theme files. That’s what the Theme My Login FAQ seems to suggest, but if you’re going to add your own CSS, better to do it through a child theme or with a custom CSS plugin.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Files deleted upon upgrade’ is closed to new replies.