How to make sure changes to a Wordpress plugin won't be lost on plugin update?

后端 未结 2 997
清歌不尽
清歌不尽 2021-02-10 18:12

I\'m pretty sure I\'ve read somewhere that you can actually move the main plugin *.php file to somewhere else (I assume under your theme directory) to have it safe in case you m

2条回答
  •  眼角桃花
    2021-02-10 18:38

    With themes, Wordpress has a concept of "child themes" which allows exactly that: to keep changes separate from main theme, in case it changes.

    I haven't yet found a way to do this with plugins.

    I'm using a few tactics myself:

    • I bump plugin version to a very high number like 99.9. This way Wordpress won't ever update the plugin.
    • Store my plugins in version control (i use git, but it doesnt matter), this allows you to update the plugin, run the 'diff' tool and see what changes happend. If you don't like you just revert like it would be a bad code you've written. But this approach requires a bit of skill.

提交回复
热议问题