我创建了一个自定义仪表板页面,用户登录时会重定向到该页面。我想将“立即”小部件包括到我的自定义仪表板页面中。我如何做到这一点?
class CustomDash {
function __construct(){
add_action( \'admin_menu\', array( &$this, \'nn_register_custom_dash\' ) );
add_action( \'load-index.php\', array( &$this, \'nn_redirect_custom_dash\' ) );
}
function nn_register_custom_dash(){
add_dashboard_page( \'Custom Dash\', \'Custom Dash\', \'manage_options\', \'custom-dash\', array( &$this, \'nn_create_dash\' ) );
}
function nn_redirect_custom_dash(){
$screen = get_current_screen();
if( $screen->base == \'dashboard\' )
wp_redirect( admin_url( \'index.php?page=custom-dash\' ) );
}
function nn_create_dash(){
}
}
new CustomDash();