Created
January 16, 2017 07:45
-
-
Save dingo-d/869283ac78f8eaf17e99fd619e957c75 to your computer and use it in GitHub Desktop.
Example of dashboard widget for WordPress.
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 | |
/** | |
* Dashboard widget | |
* | |
* @package WordPress | |
* @version 1.0.0 | |
* @author Denis Žoljom <denis.zoljom@gmail.com> | |
* @license GNU General Public License v2 or later | |
* @link http://madebydenis.com/ | |
* @since 1.0.0 | |
*/ | |
/********* Add More Dashboard Widget ***********/ | |
add_action( 'wp_dashboard_setup', 'utter_add_dashboard_widgets' ); | |
if ( ! function_exists( 'utter_add_dashboard_widgets' ) ) { | |
/** | |
* Add Dashboard Widgets | |
* | |
* @since 1.0.0 | |
*/ | |
function utter_add_dashboard_widgets() { | |
wp_add_dashboard_widget( 'dashboard_widget', esc_html__( 'Utter Addons','utter' ), 'utter_additional_addons' ); | |
} | |
} | |
if ( ! function_exists( 'utter_additional_addons' ) ) { | |
/** | |
* Utter Additional addons | |
* | |
* @return void Dashboard widget HTML. | |
*/ | |
function utter_additional_addons() { | |
?> | |
<div class="most_read"> | |
ADD WIDGET IFRAME | |
</div> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment