这可以通过将参数传递给父窗口小部件构造函数的$control\\u选项来设置,这是第四个参数。下面是一个示例构造函数:
class Custom_Widget extends WP_Widget {
/**
* Sets up the widgets name etc
*/
function __construct() {
$widget_options = array(
\'description\' => __( \'Featured Pages Widget.\', \'affiliate\' )
);
$control_options = array(
\'width\' => 750
);
parent::__construct(
\'custom_widget\', // Base ID
__( \'Custom Widget\', \'text_domain\' ), // Name
$widget_options,
$control_options
);
}