# Shared Notes Dashboard Widget

> A notepad on the dashboard that every editor can read and update, for handover notes, to-dos or reminders.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Tags: dashboard, widget, notes
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/shared-notes-dashboard-widget/

## Code

```php
// Who can edit the notes (everyone with dashboard access can read them).
$wpide_notes_capability = 'edit_others_posts';

add_action( 'wp_dashboard_setup', function () use ( $wpide_notes_capability ) {
    if ( ! current_user_can( 'edit_posts' ) ) {
        return;
    }

    wp_add_dashboard_widget( 'wpide_shared_notes', 'Team Notes', function () use ( $wpide_notes_capability ) {
        $notes = (string) get_option( 'wpide_dashboard_notes', '' );

        if ( ! current_user_can( $wpide_notes_capability ) ) {
            echo $notes ? wp_kses_post( wpautop( $notes ) ) : '<p>No notes yet.</p>';
            return;
        }
        ?>
        <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
            <input type="hidden" name="action" value="wpide_save_dashboard_notes">
            <?php wp_nonce_field( 'wpide_save_dashboard_notes' ); ?>
            <textarea name="wpide_notes" rows="8" style="width:100%"><?php echo esc_textarea( $notes ); ?></textarea>
            <p><button type="submit" class="button button-primary">Save notes</button></p>
        </form>
        <?php
    } );
} );

add_action( 'admin_post_wpide_save_dashboard_notes', function () use ( $wpide_notes_capability ) {
    if ( ! current_user_can( $wpide_notes_capability ) ) {
        wp_die( 'You are not allowed to edit these notes.' );
    }

    check_admin_referer( 'wpide_save_dashboard_notes' );

    $notes = isset( $_POST['wpide_notes'] ) ? wp_kses_post( wp_unslash( $_POST['wpide_notes'] ) ) : '';
    update_option( 'wpide_dashboard_notes', $notes, false );

    wp_safe_redirect( admin_url( 'index.php' ) );
    exit;
} );
```

## Notes

Notes are stored in the wpide_dashboard_notes option.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Shared Notes Dashboard Widget" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
