英文:
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
最好和最安全的方法是手动备份插件文件夹。
- 进入您的Cpanel。打开wp-content,找到那里的“plugins”文件夹。
- 左键单击并创建“plugins”文件夹的ZIP文件(在名称中加入日期以便记住)。
- 继续编辑插件文件。
- 如果出现问题,删除插件文件夹,然后简单地提取您已经压缩的文件,并将提取的文件夹更名为“plugins”(正确的名称)。
英文:
The best and safest way is backing up the plugins folder manually.
- Go to your Cpanel. Open wp-content and find "plugins" folder there.
- Left click and create a ZIP of the plugins folder (put a date in the name so you remember)
- Proceed to edit the plugin files
- 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).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论