register_widget

函数


register_widget ( $widget )
参数
  • (string|WP_Widget)
    $widget
    Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass.
    Required:
相关
  • WP_Widget
定义位置
  • wp-includes/widgets.php
    , line 112
引入
2.8.0
弃用

注册一个小工具

注册一个WP_Widget小工具

function register_widget( $widget ) {
	global $wp_widget_factory;

	$wp_widget_factory->register( $widget );
}