If you don’t want to use the Dashboard Widgets API
you can use this code snippet that I have quickly concocted as a starting point:
function dashboard_daily_post_metabox() {
add_meta_box( 'wt_id', 'Daily Post', 'dashboard_daily_post_process', 'dashboard', 'normal', 'high' );
}
add_action( 'wp_dashboard_setup', 'dashboard_daily_post_metabox' );
function dashboard_daily_post_process() {
global $wpdb;
?>
<form method="post">
<label>Age <input type="text" name="wt_age" value="<?php echo $wpdb->prefix; ?>" /></label>
<input type="submit" class="button-primary" value="Save" />
</form>
<?php
}
As you can see you have access to the global $wpdb
variable and you can process your request as you wish.
You can quickly test this code by dumping it in your theme’s functions.php
file.