meta box Archives - wiki

WordPress create custom dashboard widget using meta box

WordPress create custom dashboard widget using meta box

add_action( 'wp_dashboard_setup', 'setup_dashboard_widget');

function setup_dashboard_widget() {
    add_meta_box( 'my_dashboard_widget', 'Widget using meta box', 'sample_dashboard__widget_view', 'dashboard', 'side', 'high'  );
}

function sample_dashboard__widget_view() {
   ?>
   <div>
		This is the dashboard widget using meta box - add_meta_box() function 
   </div>
   <?php 
}

Output

meta box widget

 

Related topics

ref: https://codex.wordpress.org/Function_Reference/wp_add_dashboard_widget

By bm on June 23, 2016 | wordpress | A comment?
Tags: , , , ,