编辑主题插件文件的最佳实践

huangapple go评论53阅读模式
英文:

Best practice editing theme's plugin files

问题

我目前正在对已复制到我们父题的子主题中的一些 .css 和 .php 文件进行各种更改。

发现我需要编辑的一些文件位于主题之外的插件文件夹中 - wp-content/uploads/ 和 wp-content/plugins。

我理解不应直接编辑插件文件,所以我想知道在不影响可能会覆盖我的更改的将来更新的情况下,编辑这些文件的最佳实践是什么?

我不知道该怎么办。

英文:

I am currently making various changes to some of the .css and .php files that have been copied to the child theme of our parent theme.

Found that some files I need to edit reside in plugin folders outside theme - wp-content/uploads/ and wp-content/plugins.

My understanding is that I should not make edits directly to the plugin files so I am wondering what is best practice to edit these files without effecting future updates that could overwrite my changes?

I am stuck at not knowing what to do.

答案1

得分: 0

最好和最安全的方法是手动备份插件文件夹。

  1. 进入您的Cpanel。打开wp-content,找到那里的“plugins”文件夹。
  2. 左键单击并创建“plugins”文件夹的ZIP文件(在名称中加入日期以便记住)。
  3. 继续编辑插件文件。
  4. 如果出现问题,删除插件文件夹,然后简单地提取您已经压缩的文件,并将提取的文件夹更名为“plugins”(正确的名称)。
英文:

The best and safest way is backing up the plugins folder manually.

  1. Go to your Cpanel. Open wp-content and find "plugins" folder there.
  2. Left click and create a ZIP of the plugins folder (put a date in the name so you remember)
  3. Proceed to edit the plugin files
  4. If something goes wrong, delete the plugin folder and simple extract the files you had zipped and change the extracted folder name to "plugins" (the correct name).

huangapple
  • 本文由 发表于 2023年3月12日 13:28:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/75711219.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定