WordPress.org

Ready to get started?Download WordPress

Forums

set widget name text (1 post)

  1. doodaddy
    Member
    Posted 6 years ago #

    I'm writing a multiple-instance widget using the widget_many template provided in widgets.php. All is well, except I can't seem to mimic the behavior of the Text widget (for example) that displays the $title variable as part of the widget name on the admin page.

    If I set it just before wp_register_sidebar_widget like so:

    if (!(empty($title))) $name = __('My Widget :' . $title);

    ...it works, but then the first instance of My Widget: title also become the name for the generic draggable "model" widget on the left side of the admin screen.

    I'm following the code to text-widget pretty much exactly, but can't find where it changes the $name of each widget instance!

Topic Closed

This topic has been closed to new replies.

About this Topic