Forums

Need help authoring widget (1 post)

  1. tsalagi_red
    Member
    Posted 3 years ago #

    I am a newbie at php, trying to write a widget to display a simple friends list from the Friend List plugin for WPMU. I am able to activate my widget on the plugins page, but I can't get it to show up on the sidebar widgets menu.

    Following is the code. What am I doing wrong?


    <?php
    /*
    Plugin Name: My Friends Widget
    Plugin URI: http://software.elohigadugi.org/
    Description: Returns friends list when used with Friend List plugin.
    Version: 0.01
    Author: Tsalagi Red
    Author URI: http://software.elohigadugi.org/
    */
    function widget_myfriendswidget_init() {
    if ( !function_exists('register_sidebar_widget'))
    return;
    function widget_myfriendswidget($args) {
    echo $before_widget;
    echo $before_title . 'My Friends' . $after_title;
    list_friends('display', '', '');
    echo $after_widget;
    }
    register_sidebar_widget('My Friends Widget', 'widget_myfriendswidget');
    add_action('plugins_loaded', 'widget_myfriendswidget_init');
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags