WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Widget description?

[Resolved] Widget description?

  • I finally got around to playing with widget creation and so far so good, but I have several widgets controls in the same plugin. That works fine, but I’d love to put a description on them like all the default widgets in the list.

    How do I do that? Is it in the register command? I have this so far:

    register_widget_control(array(‘Jsearch Tags’,’widgets’),’widget_jsearch_tags_control’);

    I can’t seem to find the documentation that would allow a description, but I suspect it’s there somewhere.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did I post this in the wrong section or something? It can’t be that no one at all knows the answer to this is it?

    Here’s the answer. Instead of using these like in the sample widgets:

    register_sidebar_widget(array(‘YOURTITLE’,’widgets’),’YOURFUNCNAME’);
    register_widget_control(array(‘YOURTITLE’,’widgets’),’CNTRLFUNCNAME’);

    Use these:

    wp_register_sidebar_widget( ‘WIDGETID’, ‘YOURTITLE’, ‘YOURFUNCNAME’, array(‘description’ => __(‘THEDESCRIPTION’)) );
    wp_register_widget_control( ‘WIDGETID’, ‘YOURTITLE’, ‘CNTRLFUNCNAME’);

    There’s fairly limited documentation on these functions currently, but I was able to find a working example in the widgets.php file in the wp-includes file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Widget description?’ is closed to new replies.