调用WordPress插件的PHP函数

时间:2017-04-07 21:07:12

标签: php wordpress

所以我安装了这个插件https://wordpress.org/plugins/wp-db-table-editor/

在“如何安装”中,它说我必须在我的主题的functions.php中调用add_db_table_editor函数才能显示插件界面

安装屏幕截图 enter image description here

我在functions.php文件的最底部添加了此代码,当我刷新我的网站时,它将无法加载。

这是我的代码(我对编码很新):

function add_db_table_editor(){

if(function_exists(‘add_db_table_editor’)){ add_db_table_editor(‘title=Employees&table=employees’);

add_db_table_editor(array( ‘title’=>’Test title’, ‘table’=>’wp_posts’, ‘sql’=>’SELECT));

     }
}

1 个答案:

答案 0 :(得分:0)

在wordpress中你必须去

Select-String .\reducedCodes.txt  -Pattern "?????-?????-?????-?????-?????"

在active_theme文件夹中你应该找到

{wpinstallfolder}/wp-content/themes/{active_theme}

在将任何代码添加到functions.php之前,您需要对其进行备份,以便在没有正确编辑的情况下恢复原状。

打开它并添加插件告诉您添加的行。并保存它。

这是一个可以帮助您的格式化代码块

functions.php
相关问题