siteorigin / so-widgets-bundle

The SiteOrigin Widgets Bundle gives you all the elements you need to build modern, responsive, and engaging website pages. Using the Widgets Bundle, you can quickly and effortlessly add buttons, sliders, heroes, maps, images, carousels, features, icons, and so much more.
https://siteorigin.com/widgets-bundle/
94 stars 64 forks source link

Add more control over widget folders structure #679

Open NazarkinRoman opened 6 years ago

NazarkinRoman commented 6 years ago

Would be great to have some control over widget file loading process. For now it just looks for */*.php pattern which is not flexible. For example, I'd like to have next directory structure:

my-first-widget
-- widget.php
-- template.php

my-second-widget
-- widget.php
-- template.php

Current widgets loading process does not allow be to implement this. There is no any filters inside SiteOrigin_Widgets_Bundle->get_widget_objects() and SiteOrigin_Widgets_Bundle->get_widgets_list() functions to control glob pattern.

Different approach without using glob: load only registered widget files from internal storage of SiteOrigin_Widgets_Widget_Manager class.

AlexGStapleton commented 6 years ago

Unfortunately, this isn't something we're currently interested in doing but I can definitely understand why you would want this. I'm going to put this on our backlog internally and close this one to remove it from the priority list.

AlexGStapleton commented 6 years ago

Actually, we've decided to keep this open purely for public future reference as this may have come up one or twice in the past.

Internal Note: Slack