Skip to content

Instantly share code, notes, and snippets.

@dingo-d
Created January 16, 2017 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dingo-d/869283ac78f8eaf17e99fd619e957c75 to your computer and use it in GitHub Desktop.
Save dingo-d/869283ac78f8eaf17e99fd619e957c75 to your computer and use it in GitHub Desktop.
Example of dashboard widget for WordPress.
<?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