WordPress.org

Ready to get started?Download WordPress

Forums

Dashboard widget location (1 post)

  1. cognitions
    Member
    Posted 4 years ago #

    I want to create aplugin to add a widget to the Admin Dashboard.

    It works fine except I cannot work out from the core files how to make the new widget occupy the side rather than the main column when it is first installed.
    $location = 'side' seems to be the code, but where to place it.
    I have:

    <?php
    function thistheme_admin_dashboard_widget_a() { ?>
    	Content A
    <?php } 
    
    function thistheme_admin_add_dashboard_widget_a() {
    
    	wp_add_dashboard_widget('thistheme_admin_dashboard_widget_a', 'Widget A', 'thistheme_admin_dashboard_widget_a');
    }
    add_action('wp_dashboard_setup', 'thistheme_admin_add_dashboard_widget_a' );
    
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic