Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Andrew Misplon

    (@misplon)

    Hi stevesicherman

    Thanks for your interest.

    The framework does make it relatively easy to create your own plugin and add widgets to the Widget Bundle. We’re a little behind on documentation but hope to have our developer docs out pretty soon. In the mean time I’ll ask Braam if he can hop on here tomorrow and give you a general direction if you’d like to get going right away.

    Plugin Author Braam Genis

    (@braam-genis)

    Hi stevesicherman

    Yep, Greg has done some really awesome work to make adding new widgets quite easy for developers.

    The simplest starting point would probably be to copy and rename the button widget folder right in the SiteOrigin Widget Bundle source and adapt it for your needs from there. You could do the same with any of the other widgets, if you’d like a more advanced starting point.

    There are a couple of gotchas, though. You’ll have to stick to the naming convention we’re using. E.g. Say you want to call your widget the Totally Awesome widget, the class name would be SiteOrigin_Widget_TotallyAwesome_Widget. We’re planning on changing this, but it’s necessary for now.

    You’ll also need to keep the header above your class with at least the Widget Name field present.

    Then you should be good to go. Hope that helps!

    Thread Starter Steve

    (@stevesicherman)

    Got it, thank you!

    Thread Starter Steve

    (@stevesicherman)

    One more question, is there anything I should namespace to prevent clashes with any future widgets you may be adding?

    Plugin Author Braam Genis

    (@braam-genis)

    We’ve avoided use of namespaces to remain compatible with PHP 5.2.4 which is the minimum supported version required by WordPress. But if your server supports PHP 5.3+ and you’re fine with the implications of using namespaces in WordPress as explained here, then it’s probably not a bad idea to namespace your custom classes and functions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Boilerplate for custom widgets’ is closed to new replies.