Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

I'm using this code to create custom widgets:

//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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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'
);
share|improve this answer
    
Fantastic! you are awesome. –  Sandro Dzneladze Oct 18 '12 at 17:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.