Home / functions.php / Create dashboard widget
  • How to Create dashboard widget

    no thumbnail sorry: Create dashboard widget

    Adding this PHP code to the functions.php of your wordpress theme will add your custom dashboard widget. This is just the basic building blocks of your own custom dashboard widget.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    <?php
    function your_dashboard_widget() {
    ?>
    <h3>Hello WordPress user!</h3>
    <p>Fill this with HTML or PHP.</p>
    <?php
    };
    function add_your_dashboard_widget() {
           wp_add_dashboard_widget( 'your_dashboard_widget', __( 'Widget Title!' ), 'your_dashboard_widget' );
    }
          add_action('wp_dashboard_setup', 'add_your_dashboard_widget' );
    ?>
    

    ( WordPress codex functions, hooks, in this snippet. )

    add_action, wp_add_dashboard_widget, __, wp,
  • thanks for code.

  • zeb

    This one is also intresting :)
    Any way to be able to post any content to this widget, like publishing a post, etc.?