Created
November 30, 2017 07:31
-
-
Save kartikparmar/94c7ad8b6e0dcec5fd34790e210a265a to your computer and use it in GitHub Desktop.
Adding dashboard widget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a widget to the dashboard. | |
* | |
* This function is hooked into the 'wp_dashboard_setup' action below. | |
*/ | |
function wc_orders_dashboard_widgets() { | |
wp_add_dashboard_widget( | |
'wc_order_widget_id', // Widget slug. | |
'WooCommerce Orders', // Title. | |
'wc_orders_dashboard_widget_function' // Display function. | |
); | |
} | |
add_action( 'wp_dashboard_setup', 'wc_orders_dashboard_widgets' ); | |
/** | |
* Create the function to output the contents of our Dashboard Widget. | |
*/ | |
function wc_orders_dashboard_widget_function() { | |
echo "Hello World !"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment