简体   繁体   English

编辑Wordpress仪表板中的所有文件和文件夹

[英]Editing all files & folders inside Wordpress Dashboard

I know it is possible to edit php and css file in the editor in dashboard [Appearance -> Editor].. But i was wondering why it is not possible to edit all the folders [including js files] in the editor.. 我知道可以在仪表板[外观->编辑器]中的编辑器中编辑php和css文件。但是我想知道为什么不可能在编辑器中编辑所有文件夹[包括js文件]。

I searched for this and found a plugin to make all files editable inside wordpress dashboard.. https://wordpress.org/plugins/solid-code-theme-editor/ 我搜索,发现这个插件,使所有的文件WordPress的仪表板内编辑.. https://wordpress.org/plugins/solid-code-theme-editor/

But still is there anyway to do it by adding any javascript or shortcode or whatever?? 但是仍然有通过添加任何javascript或简码或其他方式来做到这一点的方法吗?

Unfortunately there isn't a way to extend the types of files that Appearance -> Editor lets you edit (for example, adding files in subfolders, or JS files). 不幸的是,没有一种方法可以扩展外观->编辑器允许您编辑的文件类型(例如,在子文件夹中添加文件或JS文件)。 I've tried to find a way to do this before, but - despite almost everything else being hook'able in WordPress - there is no way to hook into the file editor to change the way it works. 我曾经尝试过找到一种方法来执行此操作,但是-尽管几乎所有其他内容都可以在WordPress中进行钩挂-但没有办法钩入文件编辑器来更改其工作方式。

This could be for security reasons (having the ability to edit files like this can be a problem in the first place anyway), but in the end, the only way to add the ability to edit every file is to use an outside-of-WordPress editor, which is what the plugin you referred to does. 可能出于安全原因(首先具有这样的文件编辑能力可能是一个问题),但最后,增加编辑每个文件的功能的唯一方法是使用外部文件。 WordPress编辑器,即您所指插件的功能。

I usually disable the Editor entirely (by adding define('DISALLOW_FILE_EDIT',true); to wp-config.php ), and use another method of editing the theme instead (usually FTP, or occasionally the file manager accessible through the web host's control panel). 我通常会完全禁用编辑器(通过将define('DISALLOW_FILE_EDIT',true);wp-config.php ),并使用另一种编辑主题的方法(通常是FTP,或者偶尔通过网络主机控件访问文件管理器)面板)。 This way you'll have access to everything you need. 这样,您就可以访问所需的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM