为 wordpress 后台添加“全部设置”选项
- 时间:2020-05-16 19:39:54
- 分类:网络文摘
- 阅读:172 次
通过 wordpress 的“全部设置”选项可以对自定义字段值、插件设置、常规设置、主题设置等进行修改,相当于在数据库之外修改wp_options数据表。
这个“全部设置”选项默认是隐藏的,平时可以使用 http://yourdomain.com/wp-admin/options.php 链接打开。如果不想每次都输入链接,可以将此选项在后台开启,方便调用。
具体方法:
将下例代码添加到当前 wordpress主题的配置文件 functions.php 中,保存即可。
- // 显示全部设置选项
- function all_settings_link() {
- add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
- }
- add_action('admin_menu', 'all_settings_link');
登陆后台就可以看到在“设置”菜单中多了一个“全部设置”的选项,如下图所示:

Algorithms to Locate the Leftmost Column with at Least a One in Algorithms to Compute the Bitwise AND of Numbers in a Range Depth First Search Algoritm to Compute The k-th Lexicographical Blogging From Your Tablet – The Ins and Outs Saudi Blogger’s Wife Looks to West for Help Singaporean Amos Yee Fights for Free Speech Gay Catholic Blogger to Visit White House 5 Tools for Making Your Content Visual Top Website Builders for SEO Is Blogging Taking a Toll on Your Eyes?
- 评论列表
-
- 添加评论