wp_register_widget_control()在小工具管理界面上创建控制选项,以便用户对设置进行修改

目录

描述

Registers widget control callback for customizing options.

The options contains the height, width, and id_base keys. The height
option is never used. The width option is the width of the fully expanded
control form, but try hard to use the default width. The id_base is for
multi-widgets (widgets which allow multiple instances such as the text
widget), an id_base must be provided. The widget id will end up looking like
{$id_base}-{$unique_number}.

wp_register_widget_control() 描述

参数

$id

(integer | string) (必填) Sidebar ID.

默认值: None

$name

(string) (必填) Sidebar display name.

默认值: None

$control_callback

(callback) (必填) Run when sidebar is displayed.

默认值: None

$options

(array | string) (可选) Widget options. See above long description.

默认值: array()

Note: Additional parameters may be passed to add to the widget.

wp_register_widget_control() 参数

历史

添加于 版本: 2.2.0

wp_register_widget_control() 历史

源文件

wp_register_widget_control() 函数的代码位于 wp-includes/widgets.php

wp_register_widget_control() 源文件

相关