register_widget()

注册小部件

register_widget(string|WP_Widget $widget)

说明(Description)

另见函数 functions()


参数(Parameters)

参数类型必填说明
$widget(string | WP_Widget)必需WP_小部件子类的名称或WP_小部件子类的实例。

返回(Return)

无返回值


源码(Source)

/**
 * Register a widget
 *
 * Registers a WP_Widget widget
 *
 * @since 2.8.0
 *
 * @see WP_Widget
 *
 * @global WP_Widget_Factory $wp_widget_factory
 *
 * @param string $widget_class The name of a class that extends WP_Widget
 */
function register_widget($widget_class) {
	global $wp_widget_factory;
	$wp_widget_factory->register($widget_class);
}
更新版本源码位置使用被使用
4.6.0wp-includes/widgets.php:1121 function1 function
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索