wp_dashboard_trigger_widget_control

函数
wp_dashboard_trigger_widget_control ( $widget_control_id = false )
参数
  • (int|false) $widget_control_id Optional. Registered widget ID. Default false.
    Required:
    Default: false
定义位置
相关方法
wp_dashboard_primary_controlwp_render_widget_controlwp_dashboard_rss_controlwp_register_widget_controlwp_dashboard_secondary_control
引入
2.5.0
弃用
-

wp_dashboard_trigger_widget_control:此函数用于触发特定仪表盘小工具的控件窗体。它可用于显示窗体以编辑或添加小工具内容。

调用小工具控制回调。

function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
	global $wp_dashboard_control_callbacks;

	if ( is_scalar( $widget_control_id ) && $widget_control_id
		&& isset( $wp_dashboard_control_callbacks[ $widget_control_id ] )
		&& is_callable( $wp_dashboard_control_callbacks[ $widget_control_id ] )
	) {
		call_user_func(
			$wp_dashboard_control_callbacks[ $widget_control_id ],
			'',
			array(
				'id'       => $widget_control_id,
				'callback' => $wp_dashboard_control_callbacks[ $widget_control_id ],
			)
		);
	}
}

常见问题

FAQs
查看更多 >