Dashboard widget custom positioning?

I cannot figure out how to arrange my custom widgets one left and one right.

I’m using this code to create custom widgets:

Read More
//Add my comments. Shows user his last 5 comments
function dashboard_user_comments_widget_function() {
    echo 'beh!';
}

function dashboard_user_add_comments_widget_function() {
     wp_add_dashboard_widget('my_comments_user_dashboard_widget', 'My comments', 'dashboard_user_comments_widget_function');
}
add_action('wp_dashboard_setup', 'dashboard_user_add_comments_widget_function');

Is there a way to pass a left/right variable into this function?

I read the codex page for it and the way they explain doing positioning is quite complicated, I don’t know how to incorporate it.

Related posts

Leave a Reply

1 comment

  1. The dashboard widget function wp_add_dashboard_widget() is just a wrapper for add_meta_box(). So you can use the underlying function instead.

    add_meta_box(
         'my_comments_user_dashboard_widget'
        ,'My comments'
        ,'dashboard_user_comments_widget_function'
        ,$screen // Take a look at the output of `get_current_screen()` on your dashboard page
        ,'normal' // Valid: 'side', 'advanced'
        ,$priority // Valid: 'default', 'high', 'low'
    );