Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <php
- /**
- * Register widget area
- *
- */
- function fp_dashboard_widgets_init() {
- register_sidebar( array(
- 'name' => __('Extra Dashboard Widgets'),
- 'id' => 'fp_extra_dashboard_widgets',
- 'before_widget' => '<div>',
- 'after_widget' => '</div>',
- 'before_title' => '<h2 class="rounded">',
- 'after_title' => '</h2>',
- ) );
- }
- add_action( 'widgets_init', 'fp_dashboard_widgets_init' );
- /**
- * Add widget area to the dashboard.
- *
- * This function is hooked into the 'wp_dashboard_setup' action below.
- */
- function fp_extra_dashboard_widgets_add_dashboard_widgets() {
- wp_add_dashboard_widget(
- 'fp_extra_dashboard_widgets', // Widget slug.
- __('Extra Dashboard Widgets'), // Title.
- 'fp_output_extra_dashboard_widgets' // Display function.
- );
- }
- add_action( 'wp_dashboard_setup', 'fp_extra_dashboard_widgets_add_dashboard_widgets' );
- /**
- * Create the function to output the contents of the extra Dashboard widget.
- */
- function fp_output_extra_dashboard_widgets() {
- // Display whatever it is you want to show.
- if ( is_active_sidebar( 'fp_extra_dashboard_widgets' ) ) : ?>
- <ul id="fp-dashboard-widgets">
- <?php dynamic_sidebar( 'fp_extra_dashboard_widgets' ); ?>
- </ul>
- <?php endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement