Linux 软件免费装

Register Settings API

开发者 Jenst
更新时间 2015年1月1日 04:30
PHP版本: 4.0 及以上
WordPress版本: 4.1
版权: GPLv2
版权网址: 版权信息

标签

admin options wp-admin settings api

下载

1.0 1.1 1.2 1.3 1.4

详情介绍:

Add settings to your own theme or plugin. As simple as writing an array. Full documentation at: http://www.wp-load.com/register-settings-api/ Benefits of the plugin Full example, placed in functions.php OR your plugin `add_filter('register_settings_api', 'settings_array'); function settings_array( $options_page ) { $options_page['my-menu-slug'] = array( 'menu_title' => 'My menu', 'page_title' => 'My page', 'option_name' => 'my_options_slug', 'tabs' => array( 'first' => array( 'tab_title' => 'My first tab', 'fields' => array( 'my_editor' => array( 'type' => 'tinymce', 'title' => 'My editor' ), 'my_color' => array( 'type' => 'color', 'title' => 'My color' ) ), ), 'second' => array( 'tab_title' => 'My second tab', 'fields' => array( 'my_textarea' => array( 'type' => 'textarea', 'title' => 'My textarea' ) ) ) ) ); return $options_page; }`

安装:

To use as a plugin:
  1. Upload register-settings-api folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Place the array code (described in another tab) in your functions.php file OR in your plugin
To use as a class:
  1. Upload register-settings-api.php into your theme or plugin and include it
  2. Remove the comment on the top and only keep the class. Else it might belive it's a plugin
  3. It's recommended to rename the class, the instance and the class_exists class to prevent collision with other plugins
  4. Place the array code (described in another tab) in your functions.php file OR in your plugin

屏幕截图:

  • Full example. This is what it creates. Much more types than this available.

常见问题:

Why use this plugin when there are a settings API that work fine?

Speed. It should take just a few minues to set up a whole lot of settings for your plugin or theme.

What makes this better than other plugins like this?

Simplicity. It's one file to include (if not using the plugin directly). There is one array to write.

I want an advanced settings page not looking like default WordPress style. Is this plugin for me?

No, probably not. This plugin makes it simple to set up tabs with settings the "default" way, not that much more. It's made for speed not complexity.

I don't see any tabs. Why not?

If you only created ONE tab there are no meaning of adding tabs. Then it will not add the tabs. You need two or more tabs to get them visible.

更新日志:

1.4 1.3 1.2 1.1 1.0