[wp-hackers] Registering widget function

BoBB rjorgy at gmail.com
Sat May 6 06:36:50 GMT 2006


Can you register a widget with a reference to a class function like you can
plugins? I am trying to use the following code but no widget shows up.

if (!function_exists('widget_irgShowCoComments_init')) {
    function widget_irgShowCoComments_init() {
        global $irgSCC;
        if (function_exists('register_sidebar_widget') &&
function_exists('register_widget_control')) {
            register_sidebar_widget('showCoComments', array(&$irgSCC,
'widget_irgShowCoComments'));
            register_widget_control('showCoComments', array(&$irgSCC,
'widget_optionsPage'), '700', '450');
        }
    }
}

if (function_exists(add_action)) {
    add_action('plugins_loaded', 'widget_irgShowCoComments_init');
}


More information about the wp-hackers mailing list