• raytri

    (@raytri)


    I’ve looked around for an answer to this, and found nothing — not even the question!

    I’m building a site that includes several custom widgets. Everything works fine, but on the Appearance -> Widgets screen, my custom widgets are mixed in randomly with all the default widgets in the “Available Widgets” area.

    My question: Is there a way (other than editing widgets.php) to control the order in which widgets are listed under “Available widgets”? I don’t care if my custom widgets are listed first or last — I’d just like them to be grouped together.

    Thanks!

Viewing 1 replies (of 1 total)
  • nickohrn

    (@nickohrn)

    Unfortunately the widgets that are listed under “Available Widgets” are not sortable by you. They are displayed using the function wp_list_widgets which can be found in /wp-admin/includes/widgets.php. In that function, the widgets are forcefully sorted by name before iterating through them.

    What I usually do when I have custom widgets (as part of a custom theme or whatever) is name them so they have a prefix: “My Theme Name: Custom Widget Name”. That leads to them all being grouped together.

Viewing 1 replies (of 1 total)
  • The topic ‘Control display order of "available widgets" on widgets screen’ is closed to new replies.