WordPress.org

Ready to get started?Download WordPress

Forums

simple iframe into admin panel google charts (2 posts)

  1. schmunk
    Member
    Posted 2 years ago #

    Hi i want to put a iframe with: http://imagecharteditor.appspot.com (google chart generator). There are some options...

    Either put it in "dashboard", linked as a menu item in the admin menu(bottom) or as a menu item in "tools" menu.

    How do i do this?
    Do i have to create a plugin?

    Cheers

  2. schmunk
    Member
    Posted 2 years ago #

    Solved this. Instead of putting it in a plugin i just put it in the Dashboard. Put this in custom-functions.php or functions.php in your theme:

    // Create the function to output the contents of our Dashboard Widget
    function iframe_dashboard_widget_function() {
        // Display whatever it is you want to show
        echo '<iframe src="http://imagecharteditor.appspot.com/" width="100%" height="1000px" frameBorder="0">Browser not compatible.</iframe>';
    }
    
    // Create the function use in the action hook
    function example_add_dashboard_widgets() {
        wp_add_dashboard_widget('iframe_dashboard_widget', 'Google Charts', 'iframe_dashboard_widget_function');
    }
    
    // Hook into the 'wp_dashboard_setup' action to register our other functions
    add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );

Topic Closed

This topic has been closed to new replies.

About this Topic