WordPress - Overriding a function in a plugin

后端 未结 3 775
醉酒成梦
醉酒成梦 2021-02-02 17:55

I\'ve been wonder for some time what the best practice is for modifying a plugin created by a WordPress user?

For example there are a couple lines of code I want to chan

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-02 18:53

    You could use SVN if you wanted to maintain forwards compatibility (and your host has SVN available), whilst being able to keep your own changes.

    Each plugin that's on the Plugin Directory has to have an SVN repo (that's how the Directory knows if there are updates). Here's the CF7 repo.

    Checkout the trunk to your /plugins/ directory inside a folder like /custom-contact-form-7/. Alter the wp-contact-form-7.php file to give it a unique name, and make the changes you want to make to customise it.

    To get new updates you can just svn up to get them, and they'll merge with your changes. Though, you may have to clean up merge conflicts sometimes.

    Version Control with Subversion is the place everyone starts to learn SVN, if you need it. There's also a Github repo now, if you'd like to fork that.

提交回复
热议问题